View Single Post
 
Old 11-01-2008, 07:17 AM
MANSTIR's Avatar
MANSTIR MANSTIR is offline
Senior Member
 
Join Date: Nov 2007
Posts: 162
MANSTIR is on a distinguished road
Quote:
Originally Posted by cencurut View Post
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