Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
twsapi: Re: VB Sample Project: How To Place An Order
David
开云体育Scott,
the problem with your code is that if you put orders
through? one after the other, TWS will complain about the duplicate order
as they will be (the orderid i mean) separated by 1 to 2 seconds(numbers
apart)
another way is to
Public gblOrderId&()
DIM IC%
?
ReDim Preserve gblOrderId(IC)
IC = IC + 9 gblOrderId(IC) = DatePart("YYYY", Date) & DatePart("M", Date) & DatePart("Y", Date) & IC ?
This way you know the day of the year and all orders of that
day, and you cancel any orders that not filled through the gblOrderId() array.
Of course, you would need to monitor it through the OrderStatus
event.
?
Thanks
David
PS Andrew your comments about sharing and not sharing are
disturbing...
when I helped you i did know that you had something to offer
(AI).
Just go with the flow... you may enjoy it. I would not mind
seeing your bit on AI anyway.
?
|
marinindextrader
Your right...
Goes to show ya I really am coming up from the bottom on this... I think the premise is sound in terms of time I myself dont (wont) quibble to much on this. I just threw this out there... Probably a whole hell of a lot better to stick another dimension in an array and just time stamp the call Thanks for pointing out the obvious flaw. On the otherhand though, crafty order id assignment could be an advantage i suppose Scott FWIW: I didn't know an IF statment from Jack's Shinola 6 months ago...but I am trying like the dickens to learn fast...its the damn logic that beach slaps me down every time.... Thansk --- In twsapi@y..., "David" <kotomo@p...> wrote: Scott,after the other, TWS will complain about the duplicate order as they will be (the orderid i mean) separated by 1 to 2 seconds(numbers apart) another way is toDatePart("Y", Date) & IC and you cancel any orders that not filled through the gblOrderId() array. Of course, you would need to monitor it through the OrderStatus event. disturbing... when I helped you i did know that you had something to offer (AI).your bit on AI anyway. creation and value.time and date, convert it to a long value and then and use this as anid. value and reports can be printed on a time basis.2,147,483,647 the symbol...for instance all trades with cisco will be between X andY... of trade it was...Long or Short...arbitrary system is ridiculousService. |
multicen2002
could you modify scott example and post it in file area??
i like to test drive it too. Thanks Andrew --- In twsapi@y..., "David" <kotomo@p...> wrote: Scott,after the other, TWS will complain about the duplicate order as they will be (the orderid i mean) separated by 1 to 2 seconds(numbers apart) another way is toDatePart("Y", Date) & IC and you cancel any orders that not filled through the gblOrderId() array. Of course, you would need to monitor it through the OrderStatus event. disturbing... when I helped you i did know that you had something to offer (AI).your bit on AI anyway. creation and value.time and date, convert it to a long value and then and use this as anid. value and reports can be printed on a time basis.2,147,483,647 the symbol...for instance all trades with cisco will be between X andY... of trade it was...Long or Short...arbitrary system is ridiculousService. |
marinindextrader
He was talking about different code Andrew...the footnote
discussion.... The proggie that demos orders is fine...its even customized for your 3030 start point...just download it and check it out Scott --- In twsapi@y..., multicen2002 <no_reply@y...> wrote: could you modify scott example and post it in file area??they will be (the orderid i mean) separated by 1 to 2 seconds(numbersseeing your bit on AI anyway.systemcreation timeanand date, convert it to a long value and then and use this as id.and time:store in a database, the id can be reconverted into its datevalueand reports can be printed on a time basis. and2,147,483,647 Y...type oftrade it was...Long or Short...arbitrary |
to navigate to use esc to dismiss