¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io
Date

Re: Looking for TWS/Gateway versions v965-970

 

HI Ryan

If is the API I have 966 968, 969

Carlos




-----Original Message-----
From: Ryan Ballentine <rballentine@...>
To: [email protected]
Sent: Thu, May 28, 2020 6:41 pm
Subject: Re: [TWS API] Looking for TWS/Gateway versions v965-970

Just going to beg again for some assistance here -- I really need this. I have Models with foreign currency in them and I can't even zero out the foreign currency. I don't want to just close the Models because I have four years of trading history in them.?

If you have a copy of the installer, that would be ideal. If you have one of these Gateway versions installed on your computer but don't have the installer itself, please send me a direct message, hopefully we can figure out a way for you to send me the install directory itself.

Thanks so much.


IBApi.EWrapper.updateMktDepth 'operation' field

 

Hi, in the TWS API, I was wondering how to interpret the IBApi.EWrapper.updateMktDepth's "Operation" field. The TWS API documentation is a bit sparse with regard to this.
?
For instance, what is the correct behavior for the orderbook after a 2-Deletion entry? In the case of something like
Position 4 - Operation 2 - Side 1 -? Price 0.0 - Size 0
which says to delete the 4th bid side entry, does that mean the bids in position 5 onward should be moved higher in the book?
?
Also, while the vast majority of operations seem to be 1-updates, how does one interpret 0-inserts that appear after the request begins? Again, how should the subsequent bids or offers be handled in the case of an 0-insert?
?
It appears that these 0-inserts happen only after 2-deletions, but is this generally the case? How does 1-updates differ from a 2-delete followed by a 0-insert?
?
Thank you very much for anyone who can help.
?


Re: Looking for TWS/Gateway versions v965-970

 

¿ªÔÆÌåÓý

I presume you¡¯re talking about the API rather than TWS or Gateway?

?

Here¡¯s 970.06:

?

?

Richard

?

?

From: [email protected] <[email protected]> On Behalf Of Ryan Ballentine
Sent: 28 May 2020 23:42
To: [email protected]
Subject: Re: [TWS API] Looking for TWS/Gateway versions v965-970

?

Just going to beg again for some assistance here -- I really need this. I have Models with foreign currency in them and I can't even zero out the foreign currency. I don't want to just close the Models because I have four years of trading history in them.?

If you have a copy of the installer, that would be ideal. If you have one of these Gateway versions installed on your computer but don't have the installer itself, please send me a direct message, hopefully we can figure out a way for you to send me the install directory itself.

Thanks so much.


Re: Looking for TWS/Gateway versions v965-970

Ryan Ballentine
 

Just going to beg again for some assistance here -- I really need this. I have Models with foreign currency in them and I can't even zero out the foreign currency. I don't want to just close the Models because I have four years of trading history in them.?

If you have a copy of the installer, that would be ideal. If you have one of these Gateway versions installed on your computer but don't have the installer itself, please send me a direct message, hopefully we can figure out a way for you to send me the install directory itself.

Thanks so much.


Re: How can I know when a stop limit order is triggered?

 

Not-native order types, such as stp lmt for US stocks or OCA group orders, are held on the IB servers until their condition is met, and only then submitted to the exchange. So the order status for non-native order types will remain as 'PreSubmitted' even though they are active. (PreSubmitted corresponds to the blue order status color in TWS)


Re: Conid changing?

 

I generally prefer to make as few assumptions about the persistence, validity and relevance of conids as possible. Due to scarcity of information I prefer to treat them as merely a "black box" interface sporadically exposed in the API for some peculiar tasks when there is no alternatives based on more universal tools, and not quite reliably useful beyond that.?

So yes, I'd suggest if/when you need conids just get them from contract data received in portfolio updates and by fetching stock lookup. I usually assume that a received Conid would likely be useful for a single trading day at most.

Updating conids is really cheap and easy anyway.


Re: Conid changing?

 

Does that mean that they never re-use conid's? So you don't inadvertently?end up buying orange juice futures for instance or it will always return an error??


On Thu, May 28, 2020 at 8:06 PM CarlErikson <carl.erikson@...> wrote:
My approach to this problem is to send the order with the conid that you think is right. If the conid is no longer valid, you will receive an error message. Catch this error message by making a contract details query to IB (using symbol, exchange) and then use the result as the new conid. You can do this automatically in the code and it is fairly fast.

Good luck.


Re: Conid changing?

 

My approach to this problem is to send the order with the conid that you think is right. If the conid is no longer valid, you will receive an error message. Catch this error message by making a contract details query to IB (using symbol, exchange) and then use the result as the new conid. You can do this automatically in the code and it is fairly fast.

Good luck.


Re: Conid changing?

 

Normally, the conId cannot change. In your case, the stock references to another ISIN and therefore to another conId. The only thing you can do is to update your conId if the symbol does not match with the previous conId.


Re: How can I know when a stop limit order is triggered?

 

¿ªÔÆÌåÓý

I agree with ds-avatar: if you¡¯re not getting a ¡®Submitted¡¯ status, then the trigger conditions have not been met.

?

The fact that [child,trigger] changes to [trigger] merely reflects that the parent order is now completely filled, so the child order is no longer a child: it¡¯s just a presubmitted order waiting for its trigger condition to be satisfied.

?

Why the trigger has not been triggered is another matter altogether. It might be worth your while asking IB why it didn¡¯t fire.

?

I notice you have outsideRth=[true], but since I don¡¯t know your timezone I can¡¯t see from your log whether you actually were outside RTH at the time. If you were, then that might be the problem: I recall having had issues with triggers not firing outside RTH, but I¡¯m not sufficiently confident about this to say anything categorical.

?

Richard

?

?

From: [email protected] <[email protected]> On Behalf Of Levente
Sent: 28 May 2020 09:30
To: [email protected]
Subject: Re: [TWS API] How can I know when a stop limit order is triggered?

?

Thank you for the reply. I am using the default trigger method, which is double bid/ask, and yes, the order is SMART routed.

After further inspection of my log (shown below, with my comments), I noticed that the whyHeld field initially was set to?whyHeld=[child,trigger], as the stop limit order was a child order sent in a bracket. Then at some point later, at?07:44:26 (around the time when I expected the order to trigger, but long after the parent filled), the field changed to?whyHeld=[trigger].

I have never paid attention to this field before. Could it be that this field signals when the order is triggered, and maybe the status does not even change from PreSubmitted to Submitted? In any case, I don't understand what the transition from [child,trigger] to [trigger] means. The parent order filled at 07:12:16, but this change happened more than 30 minutes later. Also, the status [trigger] implies that the order is still waiting to be triggered.

-- bracket order placed, order with ID 3631 is a child stop limit order

2020-05-27 07:12:16,257 INFO? - IB -> PlaceOrder -> brOrderId=[3631], parentId=[3630], account=[U3532749], symbol=[STK/IIPR/NASDAQ/SMART/USD/None/0.0/null], action=[SELL], transmit=[true], orderType=[STP LMT], tif=[GTC], gat=[], gtd=[], size=[220.0], visibleSize=[0], limitPrice=[82.75], auxPrice=[82.8], trailStopPrice=[1.7976931348623157E308], aon=[false], outsideRTH=[true], hidden=[false], ocaGroup=[null], ocaType=[ReduceWithBlocking], FaGroup=[null], FaMethod=[None], FaPct=[null], FaProfile=[null]

-- IB sends back initial order updates, status is PreSubmitted, whyHeld is [child,trigger]

2020-05-27 07:12:16,459 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[220.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]

2020-05-27 07:12:16,459 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], filled=[0.0], remaining=[220.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[child,trigger]

-- parent order starts filling, IB "activates" the corresponding size for this order: remaining=[100.0]

2020-05-27 07:12:16,491 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[100.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]

2020-05-27 07:12:16,491 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], filled=[0.0], remaining=[100.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[child,trigger]

-- another partial fill of the parent, remaining increased to 120.0

2020-05-27 07:12:16,506 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[120.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]

2020-05-27 07:12:16,506 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], filled=[0.0], remaining=[120.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[child,trigger]

-- the last fill for the parent, remaining is 220 (the full order amount)
-- interestingly whyHeld is still [child,trigger]

2020-05-27 07:12:16,588 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[220.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]

2020-05-27 07:12:16,588 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], filled=[0.0], remaining=[220.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[child,trigger]

-- order status is still PreSubmitted, but whyHeld changes to [trigger]
-- this corresponds roughly to the time when I expected the order to trigger

2020-05-27 07:44:26,247 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[220.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]

2020-05-27 07:44:26,247 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], filled=[0.0], remaining=[220.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[trigger]

-- another order update, status still PreSubmitted, whyHeld=[trigger]
-- at this point the price already crossed way below the stop and limit prices

2020-05-27 07:50:35,898 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[120.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]

2020-05-27 07:50:35,898 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], filled=[0.0], remaining=[120.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[trigger]

-- this update is due to the fact that I have manually cancelled the order

2020-05-27 07:50:35,919 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PendingCancel], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[0.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]

2020-05-27 07:50:35,919 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PendingCancel], filled=[0.0], remaining=[0.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[null]

-- final order update

2020-05-27 07:50:35,937 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[Cancelled], filled=[0.0], remaining=[0.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[null]

?


Conid changing?

 

Hi,
I'm trading a system through the TWS-API and have noticed that some times the contracts ids/symbols for a stock changes. A little background:

I only trade stocks, currently on the OMXS Stockholm exchange. I have a local DB of all the assets I want to trade, where I keep the Symbol and the Conid etc, for each asset.
But sometimes I have noticed that I can't get data for my asset, and when I look into it, it looks like the Conid has changed. This happened today (or possibly yesterday) for the symbol "TETY". It used to be symbol "TETY" and Conid "366359662". But now Conid "366359662" has the symbol "TETY.OLD". The Symbol "TETY" now has Conid "422484376". The ISIN changed for the asset as well.

I assume something happened to this stock, perhaps it changed list at the exchange, or something similar. But my question is if there is a way to receive information about these updates, and also how I should deal with them? I assumed the Conid would be the ID IB gives me to keep track of the stock, but it seems like that can change, so would it be the Symbol that I should keep track of instead, and just update the Conid dynamically for the Symbol?

Thanks!
Micke


Re: How can I know when a stop limit order is triggered?

 

Thank you for the reply. I am using the default trigger method, which is double bid/ask, and yes, the order is SMART routed.

After further inspection of my log (shown below, with my comments), I noticed that the whyHeld field initially was set to?whyHeld=[child,trigger], as the stop limit order was a child order sent in a bracket. Then at some point later, at?07:44:26 (around the time when I expected the order to trigger, but long after the parent filled), the field changed to?whyHeld=[trigger].

I have never paid attention to this field before. Could it be that this field signals when the order is triggered, and maybe the status does not even change from PreSubmitted to Submitted? In any case, I don't understand what the transition from [child,trigger] to [trigger] means. The parent order filled at 07:12:16, but this change happened more than 30 minutes later. Also, the status [trigger] implies that the order is still waiting to be triggered.

-- bracket order placed, order with ID 3631 is a child stop limit order
2020-05-27 07:12:16,257 INFO? - IB -> PlaceOrder -> brOrderId=[3631], parentId=[3630], account=[U3532749], symbol=[STK/IIPR/NASDAQ/SMART/USD/None/0.0/null], action=[SELL], transmit=[true], orderType=[STP LMT], tif=[GTC], gat=[], gtd=[], size=[220.0], visibleSize=[0], limitPrice=[82.75], auxPrice=[82.8], trailStopPrice=[1.7976931348623157E308], aon=[false], outsideRTH=[true], hidden=[false], ocaGroup=[null], ocaType=[ReduceWithBlocking], FaGroup=[null], FaMethod=[None], FaPct=[null], FaProfile=[null]

-- IB sends back initial order updates, status is PreSubmitted, whyHeld is [child,trigger]
2020-05-27 07:12:16,459 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[220.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]
2020-05-27 07:12:16,459 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], filled=[0.0], remaining=[220.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[child,trigger]

-- parent order starts filling, IB "activates" the corresponding size for this order: remaining=[100.0]
2020-05-27 07:12:16,491 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[100.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]
2020-05-27 07:12:16,491 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], filled=[0.0], remaining=[100.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[child,trigger]

-- another partial fill of the parent, remaining increased to 120.0
2020-05-27 07:12:16,506 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[120.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]
2020-05-27 07:12:16,506 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], filled=[0.0], remaining=[120.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[child,trigger]

-- the last fill for the parent, remaining is 220 (the full order amount)
-- interestingly whyHeld is still [child,trigger]
2020-05-27 07:12:16,588 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[220.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]
2020-05-27 07:12:16,588 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], filled=[0.0], remaining=[220.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[child,trigger]

-- order status is still PreSubmitted, but whyHeld changes to [trigger]
-- this corresponds roughly to the time when I expected the order to trigger
2020-05-27 07:44:26,247 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[220.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]
2020-05-27 07:44:26,247 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], filled=[0.0], remaining=[220.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[trigger]

-- another order update, status still PreSubmitted, whyHeld=[trigger]
-- at this point the price already crossed way below the stop and limit prices
2020-05-27 07:50:35,898 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[120.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]
2020-05-27 07:50:35,898 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PreSubmitted], filled=[0.0], remaining=[120.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[trigger]

-- this update is due to the fact that I have manually cancelled the order
2020-05-27 07:50:35,919 INFO? - IB -> Order -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PendingCancel], symbol=[STK/IIPR/null/SMART/USD/None/0.0/null], side=[SELL], type=[STP LMT], tif=[GTC], gat=[null], gtd=[null], size=[0.0], displaySize=[0], price=[82.75], auxPrice=[82.8], trailStopPrice=[82.8], account=[U3532749], comm=[1.7976931348623157E308], aon=[false], outsideRth=[true], hidden=[false], displaySize=[0], ocaGroup=[588146979], ocaType=[ReduceWithBlocking], faGroup=[null], faMethod=[None], faPct=[null], faProfile=[null], Warning=[null]
2020-05-27 07:50:35,919 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[PendingCancel], filled=[0.0], remaining=[0.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[null]

-- final order update
2020-05-27 07:50:35,937 INFO? - IB -> OrderStatus -> brOrdId=[3631], clientId=[1], gatewayId=[588146980], parentId=[3630], status=[Cancelled], filled=[0.0], remaining=[0.0], lastPrice=[0.0], avgPrice=[0.0], whyHeld=[null]
?


Re: How can I know when a stop limit order is triggered?

 

I believe the order should have generated the Submitted status update message if it triggered. Since there was no such message I'm inclined to believe it did not trigger. Sometimes the stop remains inactive because market conditions technically are not satisfied for it to trigger. This may depend on the value of Order.TriggerMethod field and is more likely to happen in the less liquid stocks especially if the trigger method uses a double check, even when it looks like the stop level was penetrated. My understanding is that the Order.TriggerMethod field works only for IB's own routing (SMART) and actual trigger conditions seem to be pretty complex beyond the brief descriptions in the API docs (look for the page titled "Create a Conditional Order" in TWS user guide for a glimpse on additional technical requirements for some triggers).


How can I know when a stop limit order is triggered?

 

Gents,

Is there a way to find out from the API when a stop limit order is triggered?
Today the price dropped quickly below my stop limit order's stop and limit price, so the order did not fill.
However, looking at the notifications received from IB for that order (openOrder+orderStatus), the status stayed PreSubmitted all time time until I manually cancelled the order.
I was expecting that after the order is triggered the status changes to Submitted.
In such cases I would like to amend (lower) the limit price, but for that I would need to know when the order has been triggered.
Btw, after the order is triggered will the order type update to LMT, or will it stay as STP LMT ?

Best,
Levente


Re: Announcing new Clojure wrapper for the Java API

 

Hi! Trust you found me on Twitter, but for the benefit of all:

You get a ticker-id in the call-back. So when you originally make the request you need to update / append to a map that links your symbols to these ticker-ids. Bear in mind depending on the call-back the IB implementation itself tends to use tickerId, reqId, requestID all meaning the same thing.


website that will send notifications regarding earnings dates.

 




regards to everyone,



for some time i had been looking for a website or tool that would send me email alerts when one of the 20-something companies i trade would hold their earnings announcements. (it can be very costly to inadvertently hold options when a company will report earnings as the volatility crush after the announcement will often cause prices for one or the two halves of an options chain to go to zero).


i had not found any website or service that could do this but i did email several websites regarding this matter and the people at





took my inquiry and decided to add precisely this functionality to their website:

20200527 earnings date notification 001.JPG


just create an account on that website, create a watchlist on your portfolio and then enable earnings notifications on the hand symbol on the right.


i don't know how good this service is at keeping tracks of changes in earnings announcements dates but the notifications do work to perfection:


20200527 earnings date notification 002.JPG



very well, good luck to everyone,?regards,



marcos





Sent with Secure Email.


Re: How do you forward test a new strategy in paper account if you already have an existing strategy running in real account?

 



as mr. Pisa stated, it is perfectly possible to log in to two instances of tws and use different port numbers to send signals to a live or simulated account.



regarding testing, the best thing you can do is to use out of sample data. if you have 10 years of data, leave the last 2 out of sample and when you then add this data you will have an excellent evaluation of how your systems would have performed in real time, live data.

also, ninjatrader is the best platform i know and it is free to use on simulator to evaluate all kind of strategies, i recommend it.


Re: How do you forward test a new strategy in paper account if you already have an existing strategy running in real account?

 

¿ªÔÆÌåÓý

You can run two TWS or TWS-Gateway (paper - live) on the same machine always you're using a different port for each one.



El 27 may 2020, a las 8:19, Despair <boris@...> escribi¨®:

I'm wondering the same thing. I figured out that you can run the TWS and the gateway simultaneously on the same computer with one being logged in into your live account and the other in your paper trading account. So this is a possibility. Running two instances of the TWS so far never worked for me.


Re: Announcing new Clojure wrapper for the Java API

 

Thanks -- this is great! I gave up on the older version a while back, how can I define a listener that will get the symbol
associated with a realtime tick? I'm subscribing to multiple contracts obviously and there's no symbol information in
the map that is passed to the listener function.?


Re: How do you forward test a new strategy in paper account if you already have an existing strategy running in real account?

 

I'm wondering the same thing. I figured out that you can run the TWS and the gateway simultaneously on the same computer with one being logged in into your live account and the other in your paper trading account. So this is a possibility. Running two instances of the TWS so far never worked for me.