I have IOGMode.Enabled
I want orders to be sent as soon as a tick fulfills my condition. For example:
if ( my_stop_loss >= Bars.Close[0] )
{
sell_order.Send();
}
1) When I use OrderCreator.MarketThisBar, it actually waits until the close of the bar (e.g. on a minute bar, it could wait up to 1 minute before processing the order.
2) When I use OrderCreator.MarketNextBar, then it processes the order on the following tick.
Is this the correct/expected behavior? Is there some way I can send the order immediately (i.e. as soon as a tick satisfies my condition?
Logic of MarketNextBar with IOGMode.Enabled
-
- Posts: 60
- Joined: 03 Mar 2011
- Has thanked: 9 times
- Been thanked: 2 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Logic of MarketNextBar with IOGMode.Enabled
Hello AntiMatter
Our MultiCharts .NET Programming guide provides comprehensive information regarding order objects in MultiCharts.
4.6.1 Orders:
IOrderMarket OrderCreator.MarketThisBar(SOrderParameters orderParams); - creates a Market order that should be sent on the Close of the bar where it was generated.
Our MultiCharts .NET Programming guide provides comprehensive information regarding order objects in MultiCharts.
4.6.1 Orders:
IOrderMarket OrderCreator.MarketThisBar(SOrderParameters orderParams); - creates a Market order that should be sent on the Close of the bar where it was generated.
That is correct and expected behavior. There is no way to send the order when the tick satisfies your condition. You can send the order only on the next tick after the tick satisfies your condition.When I use OrderCreator.MarketNextBar, then it processes the order on the following tick.
-
- Posts: 60
- Joined: 03 Mar 2011
- Has thanked: 9 times
- Been thanked: 2 times
Re: Logic of MarketNextBar with IOGMode.Enabled
Am I the only person to think that it be better to have a way to send an order *immediately*, or am I missing something here?
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Logic of MarketNextBar with IOGMode.Enabled
(...)You can send the order only on the next tick after the tick satisfies your condition.
As Henry said, you can also send the order on the next tick. In that case, you'll need to use IntrabarOrderGeneration, with which orders that are scheduled for 'next bar' are send on 'next tick'.Am I the only person to think that it be better to have a way to send an order *immediately*, or am I missing something here?
As you meant immediately in the sense of submit orders on the same tick as the conditions are evaluated, I thought that, with IOG, MarketThisBar would become 'this tick' (but you'll need to verify that yourself).
-
- Posts: 60
- Joined: 03 Mar 2011
- Has thanked: 9 times
- Been thanked: 2 times
Re: Logic of MarketNextBar with IOGMode.Enabled
No, it doesn't.I thought that, with IOG, MarketThisBar would become 'this tick' (but you'll need to verify that yourself).
As per my initial post: If we have a one minute chart, with IOGMode.Enabled, then OrderCreator.MarketThisBar waits until the close of the 1-minute bar before it is processed.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Logic of MarketNextBar with IOGMode.Enabled
At the moment that is not technically possible to send an order during the same calculation that the order is generated.Am I the only person to think that it be better to have a way to send an order *immediately*, or am I missing something here?
-
- Posts: 60
- Joined: 03 Mar 2011
- Has thanked: 9 times
- Been thanked: 2 times
Re: Logic of MarketNextBar with IOGMode.Enabled
OK Thanks.
This can be a problem in low and medium volume markets, where you could perhaps wait more than a minute before the order is processed. This could be the case even in some reasonably well traded stocks, but at a quite time of the day.
This can be a problem in low and medium volume markets, where you could perhaps wait more than a minute before the order is processed. This could be the case even in some reasonably well traded stocks, but at a quite time of the day.
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Logic of MarketNextBar with IOGMode.Enabled
That's right.No, it doesn't.
As per my initial post: If we have a one minute chart, with IOGMode.Enabled, then OrderCreator.MarketThisBar waits until the close of the 1-minute bar before it is processed.
But in that situation you can use MarketNextBar, so you don't have to wait another minute.
I thought orders could also be send on forced CalcBar() recalculation; with ExecControl.RecalcLastBarAfter().This can be a problem in low and medium volume markets, where you could perhaps wait more than a minute before the order is processed. This could be the case even in some reasonably well traded stocks, but at a quite time of the day.
-
- Posts: 60
- Joined: 03 Mar 2011
- Has thanked: 9 times
- Been thanked: 2 times
Re: Logic of MarketNextBar with IOGMode.Enabled
Ah, will try this, thanks.I thought orders could also be send on forced CalcBar() recalculation; with ExecControl.RecalcLastBarAfter().