I am using 1 min bar with IOG on for my trade. Also, I have turned on the "limit to market order" with a setting of 5 seconds. My strategy is very simple.
Code: Select all
If condition1 then
begin
Buy ("Strategy 1") 1 next bar Price1 stop Price1 limit;
end;
if condition2 then
begin
Sell (Strategy 2") 1 next bar Price2 stop Price2 limit;
end;
The reason I am using limit order because the bid/ask spread is quite big for what I am trading.
It works fine except..... the last few second of the bar. I have an order generated at 10:56:59 and then cancelled at 10:57:01 without trigger the "Limit to Market order" function of MC. Are there any code to change the "Limit to Market Order" within the coding. Or I have to rewrite my whole strategy with seperate coding for the last 5 seconds of every minute.
I understand there are a lot of EL experts here may indicate a direction for me.
Thanks a lot.