question about "This bar can only be used in close orders"

Questions about MultiCharts and user contributed studies.
z7c9
Posts: 7
Joined: 31 Jul 2010

question about "This bar can only be used in close orders"

Postby z7c9 » 14 Aug 2010

I'v designed a strategy,in my stratgy,there has one statement like this,

Code: Select all

buy 1 contract this bar at 2400 limit;


when compile,i got compiled errors,
'This bar'can only be used in close orders.
in my strategy,i have set [intrabarordergeneration=true],
i wonder if mc can buy this bar at alternative price?

janus
Posts: 747
Joined: 25 May 2009
Has thanked: 41 times
Been thanked: 83 times

Re: question about "This bar can only be used in close order

Postby janus » 15 Aug 2010

If you have [intrabarordergeneration=true] then the following order will be submitted on the next tick update inside the current bar, or the next bar if the current tick is the last one this bar:

Code: Select all

buy 1 contract next bar at 2400 limit;


I know it can be confusing as next bar implies the next real bar. That's true only if IOG is false. It would have been better if they had another type of order like:

buy 1 contract next tick at 2400 limit;

and the next bar would still mean the real next bar even with IOG turned on, and next tick would apply to the next tick even if IOG is turned off. In other words, use keywords that mean what they say rather than fudge things using IOG statements at the start of the code. Oh well, I suppose we can't have everything.


Return to “MultiCharts”