Quote:
Originally Posted by cencurut
Dear All,
Could anyone point out to me a sample for StopLoss coding. I'm planning to include it on my first EA product.
Thanks in advance.
|
here some of coding example ;
extern double StopLoss = 0.0;
.....
....
double l_price_12;
..................
..................
if (StopLoss == 0) l_price_12 = 0;
else l_price_12 = NormalizeDouble(Ask - StopLoss * Point, Digits);
if (OrderSend(Symbol(), OP_BUY, LotsOptimized(), Ask, slippage, l_price_12, l_price_4, "M buy", Magic, 0, Blue) > -1) gi_180 = FALSE;
PlaySound("alert.wav");
.......
.......
best of luck,
MANSTIR