Trailing PNL Error

Hi , have set keyword for following in universal exit :

  1. Exit if PNL > 1350
  2. If Max PNL is greater than 1000 , then trail at 0.45 of Max PNL .
  3. Here exit took place as soon as Max PNL crossed 1,000 .
    Anything I’m missing here ?

The highlighted logic seems to say if less than 0.45* Max profit which is less than 1000. So it is fulfilled at 1000.

What are looking for?? Are you trying to trail 0.45 for every 1 point move in your PNL.

Example: Max profit moves from 1000 to 1010 your new trailing should move from 1000 to 1004.50 ??

hi, logic is if profit goes above 1000 then exit if pnl becomes less than 0.45 of profit i.e. 0.45 x 1000 = exit if pnl comes down to 450 from 1000 .
but its exiting as soon as profit hits 1000

Replace the 2nd condition. If PNL comes below 451.

This should check MaxProfit above 1000 and then if PNL comes below 451 it will exit.

thank you but i’m looking for profit to trail at 45% of max profit after it achieves 1000 .
so , if max profit goes to 1200 trailing SL will be 45% of 1200 i.e .540


check this tutorial of tradetron ( time 12.50 ) for reference .


(Max Profit - PNL in the Math Operation)

Replace the 2nd line with this line.

So it will check for a max profit of 1000 and also a minimum difference of 0.45 Max Profit.

Let me know if this needs tweaking.

thanks for your time and efforts buddy . will surely test it .

1 Like

You’re welcome.
Please let me know if this worked once you have tested it, so that I can verify if my logic worked. :slight_smile: