Help!, change spread pips to points

To add comments, please log in or register
Mark
753
Mark  
Hi!
I have an EA and It does not allow a Buy or a Sell order if spread is high, but problem is that EA only limit the spread in pips and I need to limit the spread in points. Could someone help me? 😀
Thank you!


Text("Current Spread: "+DoubleToString(Spread(),1)+" pips",3);

double Spread(string symbol=NULL)

   {

   double res=(int)SymbolInfoInteger(NN(symbol),SYMBOL_SPREAD);

   int digits=(int)SymbolInfoInteger(NN(symbol),SYMBOL_DIGITS);

   if(digits==5 || digits==3 || digits==1) res=res*0.1;

   return(res);

   }

Catalin Zachiu
27204
Catalin Zachiu  
Instead of "res=res*0.1 "change to " res=res*1" or try to input at max spread setting 0.6 for example .
To add comments, please log in or register