Trailling Take Profit

 

Hello, I would like to add a Trailling Take Profit for my trading robot.


Quite simply, I open a position at $ 100 The StopLoss is at -20 $ If my position is at $ 180 (+80) then my TakeProfit will be at $ 200 and my StopLoss will be at $ 150


Regarding the StopLoss I have already managed to find a line of code and to implement it in my robot but for the Trailling Take Profit I can't do it ..


Thanks a lot for your answers,



Thomas, Your fellow Trader from France;)

 
ThomasBrd51: Quite simply, I open a position at $ 100 The StopLoss is at -20 $ If my position is at $ 180 (+80) then my TakeProfit will be at $ 200 and my StopLoss will be at $ 150
  1. You buy at $100. Your initial Stop Loss (ISL) is -20 or $80; fine. Market goes to $180 — whether your trailing Stop Loss (TSL) would be at $150 depends on how you set the trailing.
  2. There is nothing like a trailing (or leading) Take Profit, because it couldn't ever be hit. If you were leading by +20 (market at $180 TP at $200) if the market goes to $200, your leading TP would then be at $220. Useless.
Reason: