It appears that the code below only checks the strategy p&l once the current trade is stopped-out?
Is that right?
Very often, the marked-to-market p&l is less than the “stopout” level but the algo carries on trading until the current position is exited. It seems to be only then that it checks the strategy p&l. I would like it to check the p&l after every change in price and stop trading immediately the “stopout” level is hit. How is this written?
Many thanks
if StrategyProfit <= StopOut then
QUIT
endif