Spread monitoring script !HELP!
//++++ These are adjusted for 5 digit brokers. int pips2points; // slippage 3 pips 3=points 30=points double pips2dbl; // Stoploss 15 pips 0.0015 0.00150 int Digits.pips; // DoubleToStr(dbl/pips2dbl, Digits.pips) int init(){ if (Digits == 5 || Digits == 3){ // Adjust for five (5) digit brokers. pips2dbl = Point*10; pips2points = 10; Digits.pips = 1; } else { pips2dbl = Point; pips2points = 1; Digits.pips = 0; } // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl } int start(){ Comment(" Spread: ", DeltaToPips(Ask - Bid)); } string DeltaToPips(double d){ if (d > 0) string sign = "+"; else sign = ""; double pips = d / pips2dbl; string dPip = sign + DoubleToStr(pips, 0); if(Digits.pips==0) return(dPip); string dFrc = sign + DoubleToStr(pips, Digits.pips); if (dPip+".0" == dFrc) return(dPip); return(dFrc); }
Works!! Thanks alot!!
My problem was that some scripts work in experts/indicators and some works in experts\scripts.
Yours works in scripts and not in indicators and all the others on the net works on indicators ....
Is there a way to:
-make it refresh on it's own?
-move it where we want and the color we want?
Thank you for your help!
Hello,
I'm looking for a .mq4 script that will show the spread on my charts ( in pips) ex: 1.9, 2.0 ...
Every scripts I found wont seem to work on MetaTrader4 build 402. I have 5 digits and my settings are in live trading ...
Thanks for your help,
Vatco