Page 1 of 1

Intra bar realtime order is not triggered with IOG enabled.

Posted: Mar 12 2015
by zysmn
Hi.
When tried to program a simple signal code, I faced with the following issues:
1. Sent managed Buy-Stop-order, for instance on 150 level price. IOG checked and it is in 3 position with "100 entries per bar". Sometimes positions opens immediately when price touched price level 150, but sometimes price touched 150 and moved higher, to 170 for example, without opening position. In this order disappears from chart. The position can opened either on the closing of the bar, or not opened at all. When price back to 149 or lower, order on 150 appears again. Can't understand, why it occurs, the doesn't triggered and the position doesn't opened.
2. Is it possible in any way from study code cancel all placed unmanaged orders, if aren't known how many they is exposed also which IDs their have? Or in some way to get IDs of all active orders, then to use them to cancel?

Re: Intra bar realtime order is not triggered with IOG enabl

Posted: Mar 15 2015
by JoshM
1. Sent managed Buy-Stop-order, for instance on 150 level price. IOG checked and it is in 3 position with "100 entries per bar". Sometimes positions opens immediately when price touched price level 150, but sometimes price touched 150 and moved higher, to 170 for example, without opening position. In this order disappears from chart. The position can opened either on the closing of the bar, or not opened at all. When price back to 149 or lower, order on 150 appears again. Can't understand, why it occurs, the doesn't triggered and the position doesn't opened.
Did you resubmit the buy-stop order on every tick to keep it 'alive'? But that's a pure guess without seeing the strategy's code.
2. Is it possible in any way from study code cancel all placed unmanaged orders, if aren't known how many they is exposed also which IDs their have? Or in some way to get IDs of all active orders, then to use them to cancel?
I think you can use the TradeManager for that. There's a TradeManager example here.

Re: Intra bar realtime order is not triggered with IOG enabl

Posted: Mar 16 2015
by zysmn
I think you can use the TradeManager for that. There's a TradeManager example here.
resolved this issue through the next code

Code: Select all

foreach (TradeManager.Order ord in TradeManager.TradingData.Orders.Items)
{
if (ord.State == ETM_OrderState.eTM_OS_Submitted) worcProf.CancelOrder(ord.OrderID);
}
Did you resubmit the buy-stop order on every tick to keep it 'alive'? But that's a pure guess without seeing the strategy's code.
yes, resubmit order on every tick

Re: Intra bar realtime order is not triggered with IOG enabl  [SOLVED]

Posted: Mar 19 2015
by Henry MultiŠ”harts
Hi.
When tried to program a simple signal code, I faced with the following issues:
1. Sent managed Buy-Stop-order, for instance on 150 level price. IOG checked and it is in 3 position with "100 entries per bar". Sometimes positions opens immediately when price touched price level 150, but sometimes price touched 150 and moved higher, to 170 for example, without opening position. In this order disappears from chart. The position can opened either on the closing of the bar, or not opened at all. When price back to 149 or lower, order on 150 appears again. Can't understand, why it occurs, the doesn't triggered and the position doesn't opened.
Hello zysmn,

Please validate the order generation conditions in your code.

Re: Intra bar realtime order is not triggered with IOG enabl

Posted: Mar 19 2015
by zysmn
I think I found out what the problem was. After incorrect closing MS in memory left hanging process, which I didn't see. Apparently the new process had conflict (or something like that) with the old, and there is a glitch. After rebooting the system study so far is working fine.