Forums ProRealTime English forum ProOrder support trailing stops to all positions after they hit a combined profit? Reply To: trailing stops to all positions after they hit a combined profit?

#98409

Hey @Nicolas – I’ve been testing the above and recently found a flaw in my code;

One of these functions is calculating the total gain value for the system rather than only the current open positions;

(close-positionprice)*pointvalue)*countofposition)/pipsize

The solution or advice I’m looking for is to find a way to reset the floatingprofit at each new position open. Is there a function to do this?

 

Would this work … subtracting the system profit using strategyprofit function from the total accumalative floatingprofit:

FloatingProfit = Strategyprofit – (((close-positionprice)*pointvalue)*countofposition)/pipsize //actual open trade gains

 

Thanks in advance.

Bart