Add this in your code:
mysymbol.RefreshRates();
Anthony Garot:
Where should I add it, like this ? :-DAdd this in your code:
#include <Trade\SymbolInfo.mqh>
CSymbolInfo mysymbol;
//+------------------------------------------------------------------+
//| Script program start function |
mysymbol.RefreshRates();
//+------------------------------------------------------------------+
void OnStart()
{
double Ask=mysymbol.Ask();
Print("Ask is : ",Ask);
}
Alain Verleyen:
Where should I add it, like this ? :-D
Where should I add it, like this ? :-D
Ha! Point taken.
:-D
void OnStart() { mysymbol.RefreshRates(); double Ask=mysymbol.Ask(); Print("Ask is : ",Ask); }
Anthony Garot:
Tanks so much! The first time to try mt5 TradeClass : -(
Ha! Point taken.
:-D

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
#include <Trade\SymbolInfo.mqh>
CSymbolInfo mysymbol;
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
double Ask=mysymbol.Ask();
Print("Ask is : ",Ask);
}
print result is 0.0, I don't know why? maybe I missed something?
thanks your reply,,,