I am trying this strategy for quite long, and the issue that I need to understand is, that If I programmed the strategy to enter at the close of the bar, the strategy always executes the trade a tick after the close price (maybe Spread). so in each complete trade Buy/Sell, I have a loss of 2 ticks because of the market spread/late execution ...
How to come over this issue and manage to open a trade at the exact location of the Close[0]. ?
Actually, I tried to switch the straight entries to Entries limit a tick bellow or Up depending on the type so I will manage to open the trade at the exact location,
However I faced an error in my strategy maybe because I didn't cancel the unfilled trade...
My questions
1- can you suggest me any solution to overcome this issue?
2- Do you think Entries limit is the only partial solution, since there is this risk that the market takes off without hitting my entry limit and executing order?
3- if yes. Can you advise me on how cancelling a pending order after 2 bars, so if my market moved 2 bars without executing the entry limit. I want it to be cancelled to it will not affect lated entries.
Please, note my code is over 500 lines, and all on protected override void OnBarUpdate().
Note, I hope there with be an alternative solution without using entry limit.
Thank you .
Comment