In most of my strategies, I always try to wait for the current bar to completely close before I make a decision. Meaning if I act I do it on the first tick of the new bar that opens. The problem is that in code everything i tried always take the last tick of the last bar even though it tells me it's the first tick of the new bar. The last thing i used is the IsFirstTickOfBar which should do exactly what i want, but when it opens a position at that time it opens it on the last bar not on the new one.
Here is an exemple with the code used and the result :
If anyone knows why it works that way, I would greatly appreciate it if you could explain it to me.
Thank you

Comment