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?
Intra bar realtime order is not triggered with IOG enabled. [SOLVED]
- JoshM
- Posts: 2196
- Joined: May 20 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
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.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.
I think you can use the TradeManager for that. There's a TradeManager example here.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?
resolved this issue through the next codeI think you can use the TradeManager for that. There's a TradeManager example here.
Code: Select all
foreach (TradeManager.Order ord in TradeManager.TradingData.Orders.Items)
{
if (ord.State == ETM_OrderState.eTM_OS_Submitted) worcProf.CancelOrder(ord.OrderID);
}
yes, resubmit order on every tickDid 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.
- Henry MultiСharts
- Posts: 9165
- Joined: Aug 25 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Hello 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.
Please validate the order generation conditions in your code.
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.