Download MetaTrader 5
To add comments, please log in or register
Add our Facebook page to friends. Follow the latest news!
tabarzin
19
tabarzin 2016.03.22 18:58 

I want to set condition when moving average crossed UP. enter Buy with 20 point above current price.

and it should not enter if current price is more than 100 Point above Crossed Price. 

 for example: for Gold 

FastMa crossed SlowMA  at $1250. 

Entre buy at 1250.20  but does not enter if the price was $1251 . (+100)

so the range should be between 1250.20 to 1251.

is this correct code?  

int PipMinDifference; 
int PipMaxDifference; 
double CurrentPrice;
   
  if(FastMa > TrendMa + PipMinDifference * Point )  
  CurrentPrice = iClose(NULL,0,0)+PipMindifference;  // Take current close price 
  
  if(FastMa<=CurrentPrice+PipMaxDifference)  // check if current price is below MaximumPipDifference   Ex $1251
  
 Order = SIGNAL_BUY;
/
To add comments, please log in or register