MQL4 Trailing Stop from Given Stoploss

 

Hey all,

I execute my orders in my EA as such.

         stopLoss = low*0.9975;

         OrderSend(Symbol(),OP_BUY,0.1,Ask,Slippage,stopLoss,NULL);


All the trailing stop examples I find online deal in fixed pips where as I am dealing in a dynamic price. Is there anyway to enable trailing stop-like behavior given this parameter?

Thanks.

 
Alexander Whipp: Is there anyway to enable trailing stop-like behavior given this parameter?
Of course, code it to trail.
 
Search the codebase for some stoploss manager, like auto stoploss or auto sl. Then understand the code and adapt it to your needs.
 
Thanks for the responses. I was overthinking it last night. Just needed to keep track of my active trade's stop loss and calculate the pips between entry and SL. Then I use that as the trailing stop.
 
Alexander Whipp: calculate the pips between entry and SL. Then I use that as the trailing stop.

"Between entry and SL" is a constant.

Reason: