because i got so high reward/risk ratio (1.5)....it is considered a trending style...
so the trailing stop loss should have a trending style.....
the old code looks something like ...which in may opinion it is a thin way to update the trailing stop loss
Code: Select all
//for buy order
if (OrderStopLoss()<NormalizeDouble(current_ask4-1.0*stoploss_buy,Digits))
if(!OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(current_ask4-1.0*stoploss_buy,Digits),OrderTakeProfit(),0))
return;
//for sell order
if (OrderStopLoss()<NormalizeDouble(current_bid4-1.0*stoploss_sell,Digits))
if(!OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(current_bid4-1.0*stoploss_sell,Digits),OrderTakeProfit(),0))
return;
now the new updating of trailing stop loss is more flexible...in that, it is not so thin and it can handle a minor retracement
Code: Select all
// for buy
if (OrderStopLoss()<NormalizeDouble(OrderStopLoss()+0.10*(current_ask4-OrderStopLoss()),Digits))
if(!OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(OrderStopLoss()+0.10*(current_ask4-OrderStopLoss()),Digits),OrderTakeProfit(),0))
return;
//for sell
if (OrderStopLoss()>NormalizeDouble(OrderStopLoss()-0.10*(OrderStopLoss()-current_bid4),Digits))
if(!OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(OrderStopLoss()-0.10*(OrderStopLoss()-current_bid4),Digits),OrderTakeProfit(),0))
return;
now the dilemma is should i keep the nnfx rule of activating the trailing stop when price has traveled in my favor to 3 times the atr.
it sounds stupid to me to wait that long...in my opinion i should have it active from the start