How To Set Stop Loss ?

Back to topics list To post a new topic, please log in or register
avatar
16
a2495432675 2016.02.05 20:47
 

The first EA I'm trying to understand, is the MT4 Example EA of Moving Average. 

A quite simple one, now I finally understand it. Now I'm trying to add stop loss to this EA. Only a practice.

But always failed.

What's wrong with my stop loss, it should be like a number like 300 points stop loss, or like (open price)±300  

See the following, it doesn't work  T.T! HELP!!Thank you a looooooot!!

//--- sell conditions
   if(Open[1]>ma1 && Close[1]<ma1 && ma1<ma)
     {
      res=OrderSend(Symbol(),OP_SELL,LotsOptimized(),Bid,SP,iHigh(0,0,0)+SL,0,"",MAGICMA,0,Red);
      return;
     }
//--- buy conditions
   if(Open[1]<ma1 && Close[1]>ma1 && ma1>ma)
     {
      res=OrderSend(Symbol(),OP_BUY,LotsOptimized(),Ask,SP,iHigh(0,0,0)-SL,0,"",MAGICMA,0,Blue);
      return;
     }

 T.T!Please also teach me about setting Take Profit……Thank You!

avatar
Moderator
3419
GumRai 2016.02.06 00:07 #
 

if SL is 300 points then you need to convert it to a decimal

ie SL*Point 

avatar
16
a2495432675 2016.02.14 03:37 #
 
GumRai:

if SL is 300 points then you need to convert it to a decimal

ie SL*Point 

Finally I set SL successfully……Thank You!
Back to topics list  

To add comments, please log in or register