Hi,

I am using profit in a TMF to adapt stops in dependency of actual profit of a trade. For this I want to optimize the thresholds using the optimize-function. As it buys always only one lot only, the profit during training is different than in real trading.

How can I handle profit to overcome this issue?

Current part of TMF looks like this:

Code
 if(TradeIsOpen && TradeProfit > level) {
		TradeTrailLock = 0.3; 
    if(TradeIsShort)
      TradeTrailLimit = max(TradeTrailLimit,TradePriceClose);
    else
 TradeTrailLimit = min(TradeTrailLimit,TradePriceClose);}

Last edited by StefanCGN; 12/09/19 20:19.