I was detecting it by checking if on the current bar I am flat and the previous bar I was not but a similar method would not work with intrabar execution.
Then I resolved to use Performance.AllTrades.Count but I am not sure it counts just the trades of the script I am running or is it influenced by trades in ither strategies-scripts running concurrently.
I could use event driven methods like OnOrderUpdate but it looks too complicated for me and I am using a managed approach to keep things simple.
Any idea?
Thank you
G
Comment