36

I'm not sure is it right or wrong? i try on backtest. i think it's strange.

for example :

if pips loss below -5000 points. i want to set stoploss when rebound again it has to stop at -1000 points.

if pips loss below -10000 points. i want to set stoploss when rebound again it has to stop at -2000 points.

if pips loss below -15000 points. i want to set stoploss when rebound again it has to stop at -3000 points.

input int Stoplosslv=5000;

input int Stoplosslvset=1000;

if(Stoplosslv>0){

if(Bid <= OrderOpenPrice()-(Point*Stoplosslv*3)){

double x = OrderOpenPrice()-Point*(Stoplosslvset*3);

OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),x,0,Green);

}

else if(Bid <= OrderOpenPrice()-(Point*Stoplosslv*2)){

double x = OrderOpenPrice()-Point*(Stoplosslvset*2);

OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),x,0,Green);

}

else if(Bid <= OrderOpenPrice()-(Point*Stoplosslv)){

double x = OrderOpenPrice()-Point*(Stoplosslvset);

OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),x,0,Green);

}

return(0);

}

if(OrderType()==OP_SELL) {

{

double x = OrderOpenPrice()+Point*(Stoplosslvset*3);

OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),x,0,Red);

}

{

double x = OrderOpenPrice()+Point*(Stoplosslvset*2);

OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),x,0,Red);

}