daminda1989: but it show spread as whole number not as decimal. (ex: it show 0.2 spread as 2.0) how to correct this code?
DoubleToStr(MarketInfo(Symbol(), MODE_SPREAD)
- Of course it does. Spread returns the number of points the spread is. It is ALWAYS a whole number. Perhaps you mean the spread in pips. Spread/pips2points
- Why are you using a function call? Why not just spread = (Ask-Bid)/pips2dbl?
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I add following code to display Spread in chart. but it show spread as whole number not as decimal. (ex: it show 0.2 spread as 2.0) how to correct this code?