When you call MarketInfo, you will get the latest up to date Ask etc. Pretty much the same as using RefreshRates and then Ask etc.
If the EA runs for a while and ticks are missed, Ask will be the same as it was at the program start, so can be updated with RefreshRates or MarketInfo.
MarketInfo has the advantage of getting you the Ask of a different pair if you need it.
But they return the same information.
printf("Ask = %.5f",Ask); printf("MarketInfo = %.5f",MarketInfo(NULL,MODE_ASK)); printf("SymbolInfoDouble = %.5f",SymbolInfoDouble(NULL,SYMBOL_ASK));
MarketInfo has the advantage of getting you the Ask of a different pair if you need it.
But they return the same information.
I intended my information to supplement GumRai rather than correct it... I should have chosen a different phrase to "they return the same information" (as in you can use them to retrieve the same info). My bad, and apologies for any confusion caused!
When you call MarketInfo, you will get the latest up to date Ask etc. Pretty much the same as using RefreshRates and then Ask etc.
If the EA runs for a while and ticks are missed, Ask will be the same as it was at the program start, so can be updated with RefreshRates or MarketInfo.
CopyRates() does need a RefreshRates()
CopyRates() does need a RefreshRates()
Thank you all !

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Is there any difference between to use "Ask" directly and to use "MarketInfo (Symbol(), MODE_ASK)" instead?
In another word, "MarketInfo (Symbol(), MODE_ASK) " = "Ask"? "MarketInfo (Symbol(), MODE_BID) " = "Bid"?
Otherwise, when are they same? When are they different? Thanks.