Forum

MQL4 trailing stop loss

In MQL4, the following trailing stop loss function, why the order will be continuously modified within the same 1 second? The effect I want is to adjust the SL position by 100 points every time the profit increases by 100 points. Is there anyone who can modify it for me? Thanks! datetime

Why does the trailing stop function not work properly in the following MQL4 CODE? Can anyone please help me to fix it?

When I want the effect: It starts when the profit reaches an increase of 300 points. If you hold a BUY order now, and every time the price rises by 100 points compared to the entry price, adjust the position of SL to SL+100 points. If you hold a SELL order now, and every time the price drops by 100