Re: Ways of filtering bad quotes from TWS
I filter for zero last price, ask and bid price in both the data source and the data client. I haven't had problems with other quotes being off but I'm only essentially dealing with the Minis and I understand stocks have had some quote problems. As I view it, there are 2 kinds of bad ticks that happen - single bad ticks and clumps of bad ticks. To get rid of single bad ticks, just make sure that if you get a tick that is outside your tolerance range, like greater than +/- 2% or 5%%, and if the next tick is back inside your desired range, you have a high probability that it was a bad tick. You can make the assumption that clumps of bad ticks are actually good ticks. Or you could pop up a dialog that would warn of possible bad ticks and whether or not to filter. It is not an exact science with stocks because if you get a harmonic alignment between the exchange and a market maker or other large influential party who made a mistake, hundreds of trades can be busted, thus leading to "bad ticks". But in this case you will only find out after the fact that they were indeed bad ticks. So instead of tick filtration you will need tick correction. --- In twsapi@y..., "mbluhm2001" <mbluhm2001@y...> wrote: I guess I will reply to myself and ask a different question:
Is anyone else getting bad quotes, i.e. quotes == 0 from the TWS interface. If not, it seems I must be doing something wrong.
Thanks, Mark
--- In twsapi@y..., "mbluhm2001" <mbluhm2001@y...> wrote:
I have been getting a price quote of zero for some of the stock tickers throughout the trading day. So I decided to put in a filter and wanted to see if anyone else had any better ideas. The way
I'm trying it is the following:
IF the current price quote is greater than or less than the
previous quote by X% and the error counter is less than Y
THEN throw away the quote and increment the error counter
ELSE use the price quote and clear the error counter
The idea is to set some min and max % (i'm starting with 5%) that the
quote can be outside the previous quote. But to handle gaps, if
the quote is out of range Y number of times (i'm starting with 5)
then use
that new quote. Also I don't allow quotes that are a value of zero either.
Any thoughts would be helpful.
Thanks, Mark
|
Re: twsapi: Re: Help! Cancel order
Jaba,
?
Your program has put me 2 weeks ahead, but being a
tinkerer at heart I must always improve things.
?
That explains why I had the need to replace the
straight 6 in my 74 260Z with a 289 V8.
?
Bruce
toggle quoted message
Show quoted text
----- Original Message -----
Sent: Thursday, July 04, 2002 8:32
AM
Subject: twsapi: Re: Help! Cancel
order
Hey Bruce, and I thought that the project I put on my
pitiful website was good enough... :)
regards Jaba
--- In
twsapi@y..., "marinindextrader" <marinindextrader@y...> wrote: >
"Flyin an airplane is really simple too if you know how to do it. LOL" >
> Yep....its the landings that are tricky.... > >
Scott > > > > --- In twsapi@y..., "Bruce Hawkins"
wrote: > > Flyin an airplane is really
simple too if you know how to do it. LOL > > > > Thanks for
pointing me in the right direction I will see if I can > figure this
out. > > > > Have a safe holiday. > > >
> Bruce > >?? ----- Original Message ----- >
>?? From: mk_trading_911 > >?? To:
twsapi@y... > >?? Sent: Thursday, July 04, 2002 7:00
AM > >?? Subject: twsapi: Re: Help! Cancel order >
> > > > >?? Bruce, it's really
simple. > > > >?? existingId =
Cells(ActiveCell.row, 13).value > > > >?? it
means that existingId get's loaded with whatever there is in > the
> >?? column 13 of the active row on the spreadsheet. then
it passes > that > >?? number to tws1.cancelOrder,
and it cancels it. > > > >?? Since you don't have
spreadsheet, you need to store that ID > number >
>?? when you send your buy/sell order for execution. Or, a bit
more > >?? complicated, request open orders, get their IDs
and use one of > them > >?? to cancel that
order. > > > >?? MK > > >
>?? --- In twsapi@y..., "Bruce Hawkins"
wrote: > >?? > First of all thanks for the response,
here is the code in Excel > >?? > >
>?? > Sub cancelOrder() > >??
>???? clearError > >??
>???? > >??
>???? ' get existing id > >??
>???? Dim existingId As Long > >??
>???? existingId = Cells(ActiveCell.row,
13).value > >?? > > >??
>???? ' cancel order > >??
>???? Sheet5.Tws1.cancelOrder (existingId) >
>?? > End Sub > >?? > >
>?? > Maybe I did not make it clear but I am trying to come up
with a > >?? stand alone program, that being said in the
code above there > >?? > is references to sheets and
cells which don't exist in my prog. > I > >?? am
not sure what to put in there place. > >?? > >
>?? > Thanks, > >?? > >
>?? > Bruce > >?? >?? -----
Original Message ----- > >?? >?? From:
mk_trading_911 > >?? >?? To: twsapi@y...
> >?? >?? Sent: Thursday, July 04, 2002 6:21
AM > >?? >?? Subject: twsapi: Re: Help! Cancel
order > >?? > > >?? > >
>?? >?? Open the workbook, and press Alt-F11. Visual
Basic for > >?? Applications > >??
>?? should appear. All the code for cancelling an order is on
> sheet2 > >?? >?? (Orders). >
>?? > > >?? >?? What part of
the code do you have a problem with, exactly? > >??
>?? MK > >?? > > >??
>?? --- In twsapi@y..., "Bruce Hawkins"
wrote: > >?? >?? > Thanks for the response,
and if I was a little more savy > >?? regarding >
>?? >?? VB what you sent would be helpful. >
>?? >?? > > >??
>?? > I have looked at user's guide and Excel code trying to
come > up > >?? with > >??
>?? what I need and I can't figure it out. >
>?? >?? > > >??
>?? > But thanks anyway. > >??
>?? > > >?? >?? >
Bruce > >?? >?? >?? -----
Original Message ----- > >?? >??
>?? From: mk_trading_911 > >??
>?? >?? To: twsapi@y... > >??
>?? >?? Sent: Thursday, July 04, 2002 6:04
AM > >?? >?? >?? Subject: twsapi:
Re: Help! Cancel order > >?? >?? > >
>?? >?? > > >??
>?? >?? Either: store in your application's globals
the ID number > of > >?? the >
>?? >?? >?? orders you are sending, and
their status, or extract them > >?? from >
>?? >?? TWS > >??
>?? >?? (Tws1.reqOpenOrders). Once you know the ID,
then use: > >?? >?? >??
Tws1.cancelOrder (orderId). It's all in the Excel > spreadsheet
> >?? VBA > >?? >??
>?? Macros, and user's manual. > >??
>?? >?? I hope this helps. > >??
>?? > > >?? >??
>?? MK > >?? >?? > >
>?? >?? > > >??
>?? >?? --- In twsapi@y..., "Bruce Hawkins"
> wrote: > >??
>?? >?? >? I have been struggling with this
for 2 days, does > anyone > >?? have >
>?? >?? VB > >??
>?? >?? code for canceling a pending order. I 've
tried 6 > >?? >?? >?? > ways
from Sunday to make it work and I am totally lost. > >??
>?? >?? > > >??
>?? >?? > Thanks, > >??
>?? >?? > > >??
>?? >?? > Bruce > >??
>?? > > >?? >?? > >
>?? >??
>???????? Yahoo! Groups Sponsor
> >?? >??
>??????????????
ADVERTISEMENT > >?? >??
>?????????????
> >?? >??
>??????? > >??
>?? > > >?? >??
>?? To unsubscribe from this group, send an email to: >
>?? >?? >??
twsapi-unsubscribe@y... > >?? >?? >
> >?? >?? > > >??
>?? > > >?? >??
>?? Your use of Yahoo! Groups is subject to the Yahoo! Terms
> of > >?? >?? Service. >
>?? > > >?? > > >??
>???????? Yahoo! Groups Sponsor
> >??
>?????????? >
>?? > > >?? >?? To
unsubscribe from this group, send an email to: > >??
>?? twsapi-unsubscribe@y... > >?? >
> >?? > > >?? > >
>?? >?? Your use of Yahoo! Groups is subject to the
Yahoo! Terms of > >?? Service. > > > >
> >???????? Yahoo! Groups
Sponsor >
>??????????????
ADVERTISEMENT >
>?????????????
> >??????? > > >
>?? To unsubscribe from this group, send an email to: >
>?? twsapi-unsubscribe@y... > > > > >
> > >?? Your use of Yahoo! Groups is subject to the
Yahoo! Terms of > Service.
To
unsubscribe from this group, send an email
to: twsapi-unsubscribe@...
Your use of
Yahoo! Groups is subject to the .
|
Re: twsapi: parameter list for orderstatus?
Yes,
not very good names for variables, but till now seems to not cause much
problems.
?
Michel.
toggle quoted message
Show quoted text
the word
Status is a reserved property name for certain objects
When I type it
into my editor it automatically caps the lead letter....
Try
changing the variable declaration to a different name, such as TWSstatus
or something
There are three and counting uses of VB keywords or
propertey names in the standard TWS API:
"right", "currencey" and
Now "status"
Pretty lame IMHO
Scott
PS please let us know
if this resolves the issue
|
Re: twsapi: parameter list for orderstatus?
the word Status is a reserved property name for certain objects When I type it into my editor it automatically caps the lead letter.... Try changing the variable declaration to a different name, such as TWSstatus or something There are three and counting uses of VB keywords or propertey names in the standard TWS API: "right", "currencey" and Now "status" Pretty lame IMHO Scott PS please let us know if this resolves the issue --- In twsapi@y..., "Michel" <migurull@t...> wrote: 'price' must be Single, not Double. Here is my declaration line: Private Sub tws_orderStatus(ByVal id As Long, ByVal Status As String, ByVal Filled As Long, _ ByVal Remaining As Long, ByVal price As Single)
Michel. -----Mensaje original----- De: cyberbri_2000 [mailto:no_reply@y...] Enviado el: jueves, 04 de julio de 2002 22:05 Para: twsapi@y... Asunto: Re: twsapi: parameter list for orderstatus?
This gets the same error...
Sub tws1_orderStatus(ByVal id As Long, ByVal status As String, ByVal filled As Long, ByVal remaining As Long, ByVal price As Double)
It would be helpful to see your declaration line, if it's different in any way.
Brian
> It works for me (I use VB 5) but I pass parameters 'ByVal' in the > order > status event. > > Michel.
> -----Mensaje original----- > De: cyberbri_2000 [mailto:no_reply@y...] > Enviado el: jueves, 04 de julio de 2002 21:45 > Para: twsapi@y... > Asunto: twsapi: parameter list for orderstatus? > > > I'm getting an error in VB 6 that says the declaration does not > match > the event description. > > From the object browser I got this info and coded the sub like > this... > > Sub tws1_orderStatus(id As Long, status As String, filled As Long, > remaining As Long, price As Single) > 'orderstatus event > End Sub > > This is from the user guide... > void orderStatus(long id, String status, long filled, long > remaining, > float price, permId) > > I tried to add permId to the declaration and other combinations > but > that didn't work. Anyone have a working orderstatus declaration? > Not sure what I'm doing wrong.
Yahoo! Groups Sponsor ADVERTISEMENT
To unsubscribe from this group, send an email to: twsapi-unsubscribe@y...
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|
Re: twsapi: parameter list for orderstatus?
'price' must be Single, not Double. Here is my declaration
line:
Private Sub tws_orderStatus(ByVal id As Long, ByVal Status As String,
ByVal Filled As Long, _ ByVal Remaining As Long, ByVal price As
Single)
Michel.
toggle quoted message
Show quoted text
This gets the
same error...
Sub tws1_orderStatus(ByVal id As Long, ByVal status As
String, ByVal filled As Long, ByVal remaining As Long, ByVal price As
Double)
It would be helpful to see your declaration line, if it's
different in any way.
Brian
> It works for me (I use
VB 5) but I pass parameters 'ByVal' in the > order > status
event. > > Michel.
>?? -----Mensaje
original----- >?? De: cyberbri_2000
[mailto:no_reply@y...] >?? Enviado el: jueves, 04 de julio de
2002 21:45 >?? Para: twsapi@y... >?? Asunto:
twsapi: parameter list for orderstatus? > > >??
I'm getting an error in VB 6 that says the declaration does
not >?? match >?? the event
description. > >?? From the object browser I got this
info and coded the sub like >?? this... >
>?? Sub tws1_orderStatus(id As Long, status As String, filled
As Long, >?? remaining As Long, price As
Single) >?? 'orderstatus event >?? End
Sub > >?? This is from the user
guide... >?? void orderStatus(long id, String status, long
filled, long >?? remaining, >?? float price,
permId) > >?? I tried to add permId to the declaration
and other combinations > but >?? that didn't
work.? Anyone have a working orderstatus declaration? >??
Not sure what I'm doing wrong.
To
unsubscribe from this group, send an email
to: twsapi-unsubscribe@...
Your use of
Yahoo! Groups is subject to the .
|
Re: twsapi: parameter list for orderstatus?
This gets the same error...
Sub tws1_orderStatus(ByVal id As Long, ByVal status As String, ByVal filled As Long, ByVal remaining As Long, ByVal price As Double)
It would be helpful to see your declaration line, if it's different in any way.
Brian
toggle quoted message
Show quoted text
It works for me (I use VB 5) but I pass parameters 'ByVal' in the order status event.
Michel. -----Mensaje original----- De: cyberbri_2000 [mailto:no_reply@y...] Enviado el: jueves, 04 de julio de 2002 21:45 Para: twsapi@y... Asunto: twsapi: parameter list for orderstatus?
I'm getting an error in VB 6 that says the declaration does not match the event description.
From the object browser I got this info and coded the sub like this...
Sub tws1_orderStatus(id As Long, status As String, filled As Long, remaining As Long, price As Single) 'orderstatus event End Sub
This is from the user guide... void orderStatus(long id, String status, long filled, long remaining, float price, permId)
I tried to add permId to the declaration and other combinations but that didn't work. Anyone have a working orderstatus declaration? Not sure what I'm doing wrong.
|
Re: twsapi: parameter list for orderstatus?
It
works for me (I use VB 5) but I pass parameters 'ByVal' in the order status
event.
?
Michel.
toggle quoted message
Show quoted text
I'm getting an error
in VB 6 that says the declaration does not match the event
description.
From the object browser I got this info and coded the sub
like this...
Sub tws1_orderStatus(id As Long, status As String, filled
As Long, remaining As Long, price As Single) 'orderstatus event End
Sub
This is from the user guide... void orderStatus(long id,
String status, long filled, long remaining, float price,
permId)
I tried to add permId to the declaration and other
combinations but that didn't work.? Anyone have a working orderstatus
declaration?? Not sure what I'm doing
wrong.
Thanx, Brian
To
unsubscribe from this group, send an email
to: twsapi-unsubscribe@...
Your use of
Yahoo! Groups is subject to the .
|
Re: twsapi: Re: Ways of filtering bad quotes from TWS
I dont
know how you handle your quotes and sizes so I can't help.
The
way in which I handle them is through the use of a 'one shoot' timer of 200 ms.
In my tickPrice event I update a variable LastPrice = price and enable the
timer. In my tickSize event I update a variable LastSize = size and also enable
the timer if it is not. Then in the Timer.Timer event I disable the timer and do
the job with LastPrice and LastSize.
This
way I allow a 200ms. time window after every price or size event to wait for the
second event (size or price) to update the other variable and if the second
event dont comes, simply the other variable is unchanged when I use them in my
Timer.timer event.
?
Michel.
[Michel]??-----Mensaje
original----- De: mbluhm2001
[mailto:mbluhm2001@...] Enviado el: jueves, 04 de julio de 2002
21:35 Para: twsapi@... Asunto: twsapi: Re: Ways
of filtering bad quotes from TWS
toggle quoted message
Show quoted text
Tbanks
for the reply. Thanks what I'm doing with the 0 price quotes, throwing
them away. I didn't mention that I'm also getting what seems to be quotes
that non zero but incorrect. So I'm trying to filter them with some type
of algrothrim so I don't get caught executing a bad trade. I also wanted
to make sure that its not something I'm doing incorrectly with my
interface to TWS.
Thanks, Mark
|
parameter list for orderstatus?
I'm getting an error in VB 6 that says the declaration does not match the event description.
From the object browser I got this info and coded the sub like this...
Sub tws1_orderStatus(id As Long, status As String, filled As Long, remaining As Long, price As Single) 'orderstatus event End Sub
This is from the user guide... void orderStatus(long id, String status, long filled, long remaining, float price, permId)
I tried to add permId to the declaration and other combinations but that didn't work. Anyone have a working orderstatus declaration? Not sure what I'm doing wrong.
Thanx, Brian
|
twsapi: Re: Ways of filtering bad quotes from TWS
Tbanks for the reply. Thanks what I'm doing with the 0 price quotes, throwing them away. I didn't mention that I'm also getting what seems to be quotes that non zero but incorrect. So I'm trying to filter them with some type of algrothrim so I don't get caught executing a bad trade. I also wanted to make sure that its not something I'm doing incorrectly with my interface to TWS. Thanks, Mark --- In twsapi@y..., "Michel" <migurull@t...> wrote: Yes, I sometimes get quotes and/or sizes =0 for a litle moment buy I dont understand your problem: 'if lastPrice = 0 then... exit sub'
Michel. -----Mensaje original----- De: mbluhm2001 [mailto:mbluhm2001@y...] Enviado el: jueves, 04 de julio de 2002 19:37 Para: twsapi@y... Asunto: twsapi: Re: Ways of filtering bad quotes from TWS
I guess I will reply to myself and ask a different question:
Is anyone else getting bad quotes, i.e. quotes == 0 from the TWS interface. If not, it seems I must be doing something wrong.
Thanks, Mark
--- In twsapi@y..., "mbluhm2001" <mbluhm2001@y...> wrote: > I have been getting a price quote of zero for some of the stock > tickers throughout the trading day. So I decided to put in a filter > and wanted to see if anyone else had any better ideas. The way I'm > trying it is the following: > > IF > the current price quote is greater than or less than the previous > quote by X% and the error counter is less than Y > > THEN > throw away the quote and increment the error counter > > ELSE > use the price quote and clear the error counter > > The idea is to set some min and max % (i'm starting with 5%) that the > quote can be outside the previous quote. But to handle gaps, if the > quote is out of range Y number of times (i'm starting with 5) then use > that new quote. Also I don't allow quotes that are a value of zero > either. > > Any thoughts would be helpful. > > Thanks, > Mark
Yahoo! Groups Sponsor ADVERTISEMENT
To unsubscribe from this group, send an email to: twsapi-unsubscribe@y...
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|
Re: twsapi: Re: Ways of filtering bad quotes from TWS
Yes, I
sometimes get quotes and/or sizes =0 for a litle moment buy I dont understand
your problem: 'if lastPrice = 0 then... exit sub'
?
Michel.
toggle quoted message
Show quoted text
I guess I
will reply to myself and ask a different question:
Is anyone else
getting bad quotes, i.e. quotes == 0 from the TWS interface. If not, it
seems I must be doing something wrong.
Thanks, Mark
---
In twsapi@y..., "mbluhm2001" wrote: > I have
been getting a price quote of zero for some of the stock > tickers
throughout the trading day. So I decided to put in a filter > and
wanted to see if anyone else had any better ideas. The way I'm > trying
it is the following: > > IF >?? the current
price quote is greater than or less than the previous > quote by X% and
the error counter is less than Y > > THEN >??
throw away the quote and increment the error counter > >
ELSE >?? use the price quote and clear the error
counter > > The idea is to set some min and max % (i'm starting
with 5%) that the > quote can be outside the previous quote. But to
handle gaps, if the > quote is out of range Y number of times (i'm
starting with 5) then use > that new quote.? Also I don't
allow quotes that are a value of zero > either. > > Any
thoughts would be helpful. > > Thanks, >
Mark
To
unsubscribe from this group, send an email
to: twsapi-unsubscribe@...
Your use of
Yahoo! Groups is subject to the .
|
twsapi: Re: Help! Cancel order
Hey Bruce, and I thought that the project I put on my pitiful website was good enough... :)
regards Jaba
toggle quoted message
Show quoted text
--- In twsapi@y..., "marinindextrader" <marinindextrader@y...> wrote: "Flyin an airplane is really simple too if you know how to do it. LOL"
Yep....its the landings that are tricky....
Scott
--- In twsapi@y..., "Bruce Hawkins" <hawkinsk001@h...> wrote:
Flyin an airplane is really simple too if you know how to do it. LOL
Thanks for pointing me in the right direction I will see if I can figure this out.
Have a safe holiday.
Bruce ----- Original Message ----- From: mk_trading_911 To: twsapi@y... Sent: Thursday, July 04, 2002 7:00 AM Subject: twsapi: Re: Help! Cancel order
Bruce, it's really simple.
existingId = Cells(ActiveCell.row, 13).value
it means that existingId get's loaded with whatever there is in the
column 13 of the active row on the spreadsheet. then it passes that
number to tws1.cancelOrder, and it cancels it.
Since you don't have spreadsheet, you need to store that ID number
when you send your buy/sell order for execution. Or, a bit more complicated, request open orders, get their IDs and use one of them
to cancel that order.
MK
--- In twsapi@y..., "Bruce Hawkins" <hawkinsk001@h...> wrote: > First of all thanks for the response, here is the code in Excel > > Sub cancelOrder() > clearError > > ' get existing id > Dim existingId As Long > existingId = Cells(ActiveCell.row, 13).value > > ' cancel order > Sheet5.Tws1.cancelOrder (existingId) > End Sub > > Maybe I did not make it clear but I am trying to come up with a stand alone program, that being said in the code above there > is references to sheets and cells which don't exist in my prog. I
am not sure what to put in there place. > > Thanks, > > Bruce > ----- Original Message ----- > From: mk_trading_911 > To: twsapi@y... > Sent: Thursday, July 04, 2002 6:21 AM > Subject: twsapi: Re: Help! Cancel order > > > Open the workbook, and press Alt-F11. Visual Basic for Applications > should appear. All the code for cancelling an order is on sheet2
> (Orders). > > What part of the code do you have a problem with, exactly? > MK > > --- In twsapi@y..., "Bruce Hawkins" <hawkinsk001@h...> wrote: > > Thanks for the response, and if I was a little more savy regarding > VB what you sent would be helpful. > > > > I have looked at user's guide and Excel code trying to come up
with > what I need and I can't figure it out. > > > > But thanks anyway. > > > > Bruce > > ----- Original Message ----- > > From: mk_trading_911 > > To: twsapi@y... > > Sent: Thursday, July 04, 2002 6:04 AM > > Subject: twsapi: Re: Help! Cancel order > > > > > > Either: store in your application's globals the ID number of
the > > orders you are sending, and their status, or extract them from > TWS > > (Tws1.reqOpenOrders). Once you know the ID, then use: > > Tws1.cancelOrder (orderId). It's all in the Excel spreadsheet
VBA > > Macros, and user's manual. > > I hope this helps. > > > > MK > > > > > > --- In twsapi@y..., "Bruce Hawkins" <hawkinsk001@h...> wrote:
> > > I have been struggling with this for 2 days, does anyone
have > VB > > code for canceling a pending order. I 've tried 6 > > > ways from Sunday to make it work and I am totally lost. > > > > > > Thanks, > > > > > > Bruce > > > > > > Yahoo! Groups Sponsor > > ADVERTISEMENT > > > > > > > > To unsubscribe from this group, send an email to: > > twsapi-unsubscribe@y... > > > > > > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service. > > > Yahoo! Groups Sponsor > > > To unsubscribe from this group, send an email to: > twsapi-unsubscribe@y... > > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Yahoo! Groups Sponsor ADVERTISEMENT
To unsubscribe from this group, send an email to: twsapi-unsubscribe@y...
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|
Opps heres the URL
jclarke at hotpop.com
|
Autotrader gives you
Charting using the IB data feed, ie futures, stocks, options. Indicators EMA,SMA,TMA,WMA, MACD, CCI, REI, ADX, BBands, KBands, RSI, williams and StochRSI, stochastics and more..
Highly flexible charts and unlimited charts onscreen all from TWS API.
Historical updating of futures data automatically from CME website. Optimising of tick feeds in favourite parameters. Overnight On/Off.
Integration with TWAPI to execute trades manually using single clicks to buy and sell.
In the future I am adding auto-trailing stops and strategies using easy language.
I have a free seven day demo.
Regards James Clarke
jclarke at hotpop.com (change the at to an @ for antispam).
|
Re: twsapi: TraderGuard is now 4.56MB - check TWSAPI file area.
Is there in any way the possibility to expand your
program to connect it to TradeStation2000i to execute fully automated
orders?
If so please mail me privately...
?
Thanks in advance
?
MK
?
toggle quoted message
Show quoted text
----- Original Message -----
Sent: Wednesday, July 03, 2002 9:18
PM
Subject: twsapi: TraderGuard is now
4.56MB - check TWSAPI file area.
TraderGuard is recompiled as you asked.
You can test
it with ANY symbol you want ! I also removed dapt.database from program to
lower its size to 4.56MB Just type any symbol into "symbol" text field and
click connect.
You can download it from FILES area.. It is for as long
as Scott will allow it.
If not there please, use this link to get
it.
:))
AMJ
To
unsubscribe from this group, send an email
to: twsapi-unsubscribe@...
Your use of
Yahoo! Groups is subject to the .
|
twsapi: Re: Help! Cancel order
"Flyin an airplane is really simple too if you know how to do it. LOL" Yep....its the landings that are tricky.... Scott --- In twsapi@y..., "Bruce Hawkins" <hawkinsk001@h...> wrote: Flyin an airplane is really simple too if you know how to do it. LOL
Thanks for pointing me in the right direction I will see if I can figure this out. Have a safe holiday.
Bruce ----- Original Message ----- From: mk_trading_911 To: twsapi@y... Sent: Thursday, July 04, 2002 7:00 AM Subject: twsapi: Re: Help! Cancel order
Bruce, it's really simple.
existingId = Cells(ActiveCell.row, 13).value
it means that existingId get's loaded with whatever there is in
the column 13 of the active row on the spreadsheet. then it passes that number to tws1.cancelOrder, and it cancels it.
Since you don't have spreadsheet, you need to store that ID number when you send your buy/sell order for execution. Or, a bit more complicated, request open orders, get their IDs and use one of them to cancel that order.
MK
--- In twsapi@y..., "Bruce Hawkins" <hawkinsk001@h...> wrote: > First of all thanks for the response, here is the code in Excel > > Sub cancelOrder() > clearError > > ' get existing id > Dim existingId As Long > existingId = Cells(ActiveCell.row, 13).value > > ' cancel order > Sheet5.Tws1.cancelOrder (existingId) > End Sub > > Maybe I did not make it clear but I am trying to come up with a stand alone program, that being said in the code above there > is references to sheets and cells which don't exist in my prog. I am not sure what to put in there place. > > Thanks, > > Bruce > ----- Original Message ----- > From: mk_trading_911 > To: twsapi@y... > Sent: Thursday, July 04, 2002 6:21 AM > Subject: twsapi: Re: Help! Cancel order > > > Open the workbook, and press Alt-F11. Visual Basic for Applications > should appear. All the code for cancelling an order is on sheet2 > (Orders). > > What part of the code do you have a problem with, exactly? > MK > > --- In twsapi@y..., "Bruce Hawkins" <hawkinsk001@h...> wrote: > > Thanks for the response, and if I was a little more savy regarding > VB what you sent would be helpful. > > > > I have looked at user's guide and Excel code trying to come up with > what I need and I can't figure it out. > > > > But thanks anyway. > > > > Bruce > > ----- Original Message ----- > > From: mk_trading_911 > > To: twsapi@y... > > Sent: Thursday, July 04, 2002 6:04 AM > > Subject: twsapi: Re: Help! Cancel order > > > > > > Either: store in your application's globals the ID number of the > > orders you are sending, and their status, or extract them from > TWS > > (Tws1.reqOpenOrders). Once you know the ID, then use: > > Tws1.cancelOrder (orderId). It's all in the Excel spreadsheet VBA > > Macros, and user's manual. > > I hope this helps. > > > > MK > > > > > > --- In twsapi@y..., "Bruce Hawkins" <hawkinsk001@h...> wrote: > > > I have been struggling with this for 2 days, does anyone have > VB > > code for canceling a pending order. I 've tried 6 > > > ways from Sunday to make it work and I am totally lost. > > > > > > Thanks, > > > > > > Bruce > > > > > > Yahoo! Groups Sponsor > > ADVERTISEMENT > > > > > > > > To unsubscribe from this group, send an email to: > > twsapi-unsubscribe@y... > > > > > > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service. > > > Yahoo! Groups Sponsor > > > To unsubscribe from this group, send an email to: > twsapi-unsubscribe@y... > > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Yahoo! Groups Sponsor ADVERTISEMENT
To unsubscribe from this group, send an email to: twsapi-unsubscribe@y...
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|
Re: Ways of filtering bad quotes from TWS
I only access a futures account so I cant say more than the commodity quotes I get seem fine... Why dont you post the symbols your having problems with and perhaps a few other members with stock accounts can see if they can duplicate your problem... Scott --- In twsapi@y..., "mbluhm2001" <mbluhm2001@y...> wrote: I guess I will reply to myself and ask a different question:
Is anyone else getting bad quotes, i.e. quotes == 0 from the TWS interface. If not, it seems I must be doing something wrong.
Thanks, Mark
--- In twsapi@y..., "mbluhm2001" <mbluhm2001@y...> wrote:
I have been getting a price quote of zero for some of the stock tickers throughout the trading day. So I decided to put in a filter and wanted to see if anyone else had any better ideas. The way
I'm trying it is the following:
IF the current price quote is greater than or less than the
previous quote by X% and the error counter is less than Y
THEN throw away the quote and increment the error counter
ELSE use the price quote and clear the error counter
The idea is to set some min and max % (i'm starting with 5%) that the
quote can be outside the previous quote. But to handle gaps, if
the quote is out of range Y number of times (i'm starting with 5)
then use
that new quote. Also I don't allow quotes that are a value of zero either.
Any thoughts would be helpful.
Thanks, Mark
|
Re: Ways of filtering bad quotes from TWS
I guess I will reply to myself and ask a different question: Is anyone else getting bad quotes, i.e. quotes == 0 from the TWS interface. If not, it seems I must be doing something wrong. Thanks, Mark --- In twsapi@y..., "mbluhm2001" <mbluhm2001@y...> wrote: I have been getting a price quote of zero for some of the stock tickers throughout the trading day. So I decided to put in a filter and wanted to see if anyone else had any better ideas. The way I'm trying it is the following:
IF the current price quote is greater than or less than the previous quote by X% and the error counter is less than Y
THEN throw away the quote and increment the error counter
ELSE use the price quote and clear the error counter
The idea is to set some min and max % (i'm starting with 5%) that the quote can be outside the previous quote. But to handle gaps, if the quote is out of range Y number of times (i'm starting with 5) then use that new quote. Also I don't allow quotes that are a value of zero either.
Any thoughts would be helpful.
Thanks, Mark
|
Re: twsapi: Re: Help! Cancel order
Flyin an airplane is really simple too if you know
how to do it. LOL
?
Thanks for pointing me in the right direction I
will see if I can figure this out.
?
Have a safe holiday.
?
Bruce
toggle quoted message
Show quoted text
----- Original Message -----
Sent: Thursday, July 04, 2002 7:00
AM
Subject: twsapi: Re: Help! Cancel
order
Bruce, it's really simple.
existingId =
Cells(ActiveCell.row, 13).value
it means that existingId get's loaded
with whatever there is in the column 13 of the active row on the
spreadsheet. then it passes that number to tws1.cancelOrder, and it
cancels it.
Since you don't have spreadsheet, you need to store that ID
number when you send your buy/sell order for execution. Or, a bit more
complicated, request open orders, get their IDs and use one of them to
cancel that order.
MK
--- In twsapi@y..., "Bruce Hawkins"
wrote: > First of all thanks for the response,
here is the code in Excel > > Sub
cancelOrder() >????
clearError >???? >???? '
get existing id >???? Dim existingId As
Long >???? existingId = Cells(ActiveCell.row,
13).value > >???? ' cancel
order >???? Sheet5.Tws1.cancelOrder
(existingId) > End Sub > > Maybe I did not make it clear
but I am trying to come up with a stand alone program, that being said in
the code above there > is references to sheets and cells which don't
exist in my prog. I am not sure what to put in there place. >
> Thanks, > > Bruce >?? ----- Original
Message ----- >?? From: mk_trading_911 >??
To: twsapi@y... >?? Sent: Thursday, July 04, 2002 6:21
AM >?? Subject: twsapi: Re: Help! Cancel order >
> >?? Open the workbook, and press Alt-F11. Visual
Basic for Applications >?? should appear. All the code
for cancelling an order is on sheet2 >?? (Orders). >
>?? What part of the code do you have a problem with,
exactly? >?? MK > >?? --- In
twsapi@y..., "Bruce Hawkins"
wrote: >?? > Thanks for the response, and if I was a little
more savy regarding >?? VB what you sent would be
helpful. >?? > >?? > I have looked at
user's guide and Excel code trying to come up with >??
what I need and I can't figure it out. >?? >
>?? > But thanks anyway. >?? >
>?? > Bruce >?? >?? -----
Original Message ----- >?? >?? From:
mk_trading_911 >?? >?? To: twsapi@y...
>?? >?? Sent: Thursday, July 04, 2002 6:04
AM >?? >?? Subject: twsapi: Re: Help! Cancel
order >?? > >?? > >??
>?? Either: store in your application's globals the ID number of
the >?? >?? orders you are sending, and
their status, or extract them from >?? TWS
>?? >?? (Tws1.reqOpenOrders). Once you know the
ID, then use: >?? >?? Tws1.cancelOrder
(orderId). It's all in the Excel spreadsheet VBA >??
>?? Macros, and user's manual. >??
>?? I hope this helps. >?? >
>?? >?? MK >?? >
>?? > >?? >?? --- In
twsapi@y..., "Bruce Hawkins"
wrote: >?? >?? >? I have been struggling
with this for 2 days, does anyone have >?? VB
>?? >?? code for canceling a pending order. I
've tried 6 >?? >?? > ways from Sunday to make
it work and I am totally lost. >?? >?? >
>?? >?? > Thanks, >??
>?? > >?? >?? >
Bruce >?? > >?? > >??
>???????? Yahoo! Groups Sponsor
>??
>??????????????
ADVERTISEMENT >??
>?????????????
>?? >???????
>?? > >?? >?? To unsubscribe
from this group, send an email to: >?? >??
twsapi-unsubscribe@y... >?? > >?? >
>?? > >?? >?? Your use of
Yahoo! Groups is subject to the Yahoo! Terms of >??
Service. > >
>???????? Yahoo! Groups Sponsor
>?????????? >
>?? To unsubscribe from this group, send an email
to: >?? twsapi-unsubscribe@y... > > >
>?? Your use of Yahoo! Groups is subject to the Yahoo! Terms
of Service.
To
unsubscribe from this group, send an email
to: twsapi-unsubscribe@...
Your use of
Yahoo! Groups is subject to the .
|
twsapi: Re: Help! Cancel order
Bruce, it's really simple. existingId = Cells(ActiveCell.row, 13).value it means that existingId get's loaded with whatever there is in the column 13 of the active row on the spreadsheet. then it passes that number to tws1.cancelOrder, and it cancels it. Since you don't have spreadsheet, you need to store that ID number when you send your buy/sell order for execution. Or, a bit more complicated, request open orders, get their IDs and use one of them to cancel that order. MK --- In twsapi@y..., "Bruce Hawkins" <hawkinsk001@h...> wrote: First of all thanks for the response, here is the code in Excel
Sub cancelOrder() clearError ' get existing id Dim existingId As Long existingId = Cells(ActiveCell.row, 13).value
' cancel order Sheet5.Tws1.cancelOrder (existingId) End Sub
Maybe I did not make it clear but I am trying to come up with a stand alone program, that being said in the code above there is references to sheets and cells which don't exist in my prog. I am not sure what to put in there place. Thanks,
Bruce ----- Original Message ----- From: mk_trading_911 To: twsapi@y... Sent: Thursday, July 04, 2002 6:21 AM Subject: twsapi: Re: Help! Cancel order
Open the workbook, and press Alt-F11. Visual Basic for
Applications should appear. All the code for cancelling an order is on sheet2 (Orders).
What part of the code do you have a problem with, exactly? MK
--- In twsapi@y..., "Bruce Hawkins" <hawkinsk001@h...> wrote: > Thanks for the response, and if I was a little more savy regarding VB what you sent would be helpful. > > I have looked at user's guide and Excel code trying to come up with what I need and I can't figure it out. > > But thanks anyway. > > Bruce > ----- Original Message ----- > From: mk_trading_911 > To: twsapi@y... > Sent: Thursday, July 04, 2002 6:04 AM > Subject: twsapi: Re: Help! Cancel order > > > Either: store in your application's globals the ID number of the > orders you are sending, and their status, or extract them from TWS > (Tws1.reqOpenOrders). Once you know the ID, then use: > Tws1.cancelOrder (orderId). It's all in the Excel spreadsheet VBA > Macros, and user's manual. > I hope this helps. > > MK > > > --- In twsapi@y..., "Bruce Hawkins" <hawkinsk001@h...> wrote: > > I have been struggling with this for 2 days, does anyone have VB > code for canceling a pending order. I 've tried 6 > > ways from Sunday to make it work and I am totally lost. > > > > Thanks, > > > > Bruce > > > Yahoo! Groups Sponsor > ADVERTISEMENT > > > > To unsubscribe from this group, send an email to: > twsapi-unsubscribe@y... > > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Yahoo! Groups Sponsor
To unsubscribe from this group, send an email to: twsapi-unsubscribe@y...
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|