'SymbolInfoDouble' - no one of the overloads can be applied to the function call
The "Spread" value is in points, so it is an "Integer" property, not a "Double" property.
For function SymbolInfoInteger()
| SYMBOL_SPREAD | Spread value in points | int |
Documentation on MQL5: Market Info / SymbolInfoInteger
- www.mql5.com
Returns the corresponding property of a specified symbol. There are 2 variants of the function. 1. Immediately returns the property value. 2...
Độ Hà:
Can someone help me with this ?
Try this , you can use the symbol info tick structure
SymbolInfoTick - Market Info - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5//--- MqlTick tick_receiver; if(SymbolInfoTick(_Symbol,tick_receiver)){ Print("Got tick"); double bid=tick_receiver.bid; double ask=tick_receiver.ask; double point=_Point; double spread=(ask-bid); int spread_points=(int)MathRound(spread/point); }else{ Print("No tick"); }
Documentation on MQL5: Market Info / SymbolInfoTick
- www.mql5.com
The function returns current prices of a specified symbol in a variable of the MqlTick type. Parameters symbol [in] Symbol name. tick [out]...
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Can someone help me with this ?