Hi all.
I'm new on this forum, but not new to guide trading and EA's. I'm very happy to see the activity on Cliqforex and looking to get to know you.
I'm just about ready with my little simple EA, but based on coding the SL ordermodify for brief trades.
What I'm trying to achieve is that;
When price reaches 20pips profit: adjust SL from -40pip to -20pips. (Reduce SL in half)
When price reaches 40pips profit: Trailingstop kicks in. (Breake even )
This works perfectly well for LONG positions, but maybe not for brief positions.
If anyone can spot a clear error/solution, I'd be eternally grateful.
Here is the code :
Inserted Code dual newSL; if((Bid-OrderOpenPrice())gt;=200*Point) newSL=OrderOpenPrice()-200*Point; if((Bid-OrderOpenPrice())gt;=400*Point) newSL=Bid-(TrailingStop*Point); newSL=NormalizeDouble(newSL,Digits); if(newSLgt;OrderStopLoss()) OrderModify(OrderTicket(),OrderOpenPrice(),newSL,O rderTakeProfit(),0,Green); return(0); } else // move to brief position if((OrderOpenPrice()-Ask)gt;=200*Point) newSL=OrderOpenPrice() 200*Point; if((OrderOpenPrice()-Ask)gt;=400*Point) newSL=(TrailingStop*Point) Ask; newSL=NormalizeDouble(newSL,Digits); if(newSLlt;OrderStopLoss() }
Thanks beforehand,
Oddvin