Limit order cancelled & resent when using RecalcLastBarAfter
Posted: May 03 2016
[Issue Description]
If:
1).your signal uses RecalcLastBarAfter & AllowSendOrdersAlways & IOG
and
2).your signal generates same limit order on each recalculation
and
3).your signal is applied to a 1-tick based chart
The limit order is supposed to be issued to broker only once and kept there unchanged until filled. However in real test, it will be cancelled and resent very frequently, almost on every tick.
You can use the following simple signal to reproduce the issue. Just set the Price to a price that will not be filled and RecalcDur to some value shorter than the tick incoming interval of your instrument.
You will see the limit order of same price and quantity get cancelled and resent in the order tracker window:
I am using the latest MC x64 v9.1.12587.400 with the following settings:
This is a big trouble to me because most instruments I am dealing with are in slow market. They usually have one tick incoming longer than ten minutes and sometimes even hours, but my strategy need to buy/sell them realtime based on other dataN. Therefore I need to enable RecalcLastBarAfter & AllowSendOrdersAlways & IOG in my signal.
If:
1).your signal uses RecalcLastBarAfter & AllowSendOrdersAlways & IOG
and
2).your signal generates same limit order on each recalculation
and
3).your signal is applied to a 1-tick based chart
The limit order is supposed to be issued to broker only once and kept there unchanged until filled. However in real test, it will be cancelled and resent very frequently, almost on every tick.
You can use the following simple signal to reproduce the issue. Just set the Price to a price that will not be filled and RecalcDur to some value shorter than the tick incoming interval of your instrument.
Code: Select all
[IntrabarOrderGeneration = true];
[AllowSendOrdersAlways = true];
input: Price(1), RecalcDur(1);
buy("Test8") 1 contracts next bar Price limit;
if (LastBarOnChart_s = True) then begin
RecalcLastBarAfter(RecalcDur);
end;
I am using the latest MC x64 v9.1.12587.400 with the following settings:
This is a big trouble to me because most instruments I am dealing with are in slow market. They usually have one tick incoming longer than ten minutes and sometimes even hours, but my strategy need to buy/sell them realtime based on other dataN. Therefore I need to enable RecalcLastBarAfter & AllowSendOrdersAlways & IOG in my signal.