trade.PositionModify(PositionTicket,(CurrStoploss+1000*_Point),0);
To do something like this.
double NormalizePrice(double price) { double step_price=SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_SIZE); if(step_price>0.0) price = step_price*MathRound(price/step_price); return(NormalizeDouble(price,_Digits)); }
Of course you also need to check that for a buy trade, TP is above BID price + (min. stop level allowed by your broker) and SL is below BID price - (min. stop level allowed by your broker).
Opposite for a sell trade.
How can you be sure the current price is above the new stop level you are applying.
kkk am never sure of anything because am doing my first project, i just do trial and errors until i get a possible solution
To do something like this.
Of course you also need to check that for a buy trade, TP is above BID price + (min. stop level allowed by your broker) and SL is below BID price - (min. stop level allowed by youok
okay let me check it out , but what surprises me is that it works on currencies
if(CurrStoploss<SL){ trade.PositionModify(PositionTicket,(CurrStoploss+1000*_Point),0); }
double new_sl=CurrStoploss+1000*_Point; double Bid=SymbolInfoDouble(_Symbol, SYMBOL_BID); if(CurrStoploss<SL && new_sl<Bid-SYMBOL_TRADE_STOPS_LEVEL){ trade.PositionModify(PositionTicket, new_sl,0); }
I did not test or compile this. Just to note that you can only update stop loss to a level that is well below the current bid price(when it is a long position).
new_sl<Bid-SYMBOL_TRADE_STOPS_LEVEL*_Point
Am kinda of lost here i have followed your recommendations and it working only for buys and the sl is incrementing buy every tick
Am kinda of lost here i have followed your recommendations and it working only for buys and the sl is incrementing buy every tick

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use