I am trying to understand why and if there is a solution:
This is in a strategy. I am using UpdateOnBarClose = true.
It is doing entries doing reversal orders ie long then short then long
1) I have a short position.
2) signal to go long occurs on bar 0
3) I issue first a limit order :
Lorder01 = EnterLongLimit(0,false,tradesize,Close[0],"L01");
4) a condition checks if on bar 1 I am in a long position or not (ie I got reversed or not)
5) if not then I issue a market order at close of bar 1 :
Lorder01 = EnterLong(0,tradesize,"L01"); // on bar 1 close
Result from testing : the second market order is never executed by NT as if like it was never issued or accepted ... I do not see it anywhere in the orders tab. or excution tab.
So trying to troubleshoot I made a small change :
6) I change the condition to issue the market order on bar 2 if I am in a long position (ie if I got reversed or not) instead of on bar 1 :
Lorder01 = EnterLong(0,tradesize,"L01"); //on bar 2 close
Result from testing : suddenly everything works as intended but on 1 bar later than I want.
Can you help me understand why is this happening ? it seems to be NT7 internal functionning somehow that does not permit this.
Thanks
Comment