All the while I've been using functions like iClose("EURUSD",PERIOD_H1,0) to retrieve the latest bid price of EURUSD (or any other pairs)... no need to refresh. What I suspect is that RefreshRates only matter if you're using variables like Ask or Bid... but if you use function calls like iClose, it's automatically get and return you the latest value.
2. Yes, that's it. English is not my language.
I will consult the links that you propose to me.
But I'm not sure to find my answer, how to update the data of another chart
Refresh rates? Do you know why you need to refresh? and what are the cons for trading?
Now look here :
set(PARAMETERS); // generate and use optimized parameters
StartDate = 20160801;
TickTime = 100;
BarPeriod = 5; // 5 minutes bars
LookBack = 500; // maximum time period
// calculate the buy/sell signal with optimized parameters
vars Price = series(price());
vars Filtered = series(BandPass(Price,optimize(5,1,240,1),0.5));
vars Signal = series(FisherN(Filtered,500));
var Threshold = optimize(1,0.5,1.5,0.1);
// buy and sell
Stop = optimize(100,1,200) * ATR(optimize(100,1,200));
Trail = optimize(100,1,200) * ATR(optimize(100,1,200));
What part of "1) To use any pre-defined variables … you must call RefreshRates"
What part of "there are no pre-defined variables for other symbols. Re-read point 1" is unclear?
I wrote an EA that scans the market. The 28 main pairs. It determines the pair with the highest volatility of the 28 over 3 time horizons.
LOL, I guess I was too vague in my earlier post, and you missed my answer to your question completely.
Basically RefreshRates() is for you to update "predefined variables" for the current symbol - we all know this. Predefined variables are not changed during the execution of our code (so for each OnTick, the values remain constant). Also, predefined variables only exist for current symbol, so RefreshRates() do not have any effect on other symbols.
To retrieve up-to-tick values, we can make calls to MarketInfo() or iClose/iHigh/iLow/iOpen/iTime/iBar suite of functions:
string symbol, // symbol
int type // information type
So instead of using Ask, Bid, etc. we can do MarketInfo(Symbol(),MODE_ASK) and MarketInfo(Symbol(),MODE_BID), or iClose iHigh iLow, etc. This way we get the latest tick information without using RefreshRates().
The MarketInfo and iClose suite of functions also allow us to retrieve information of other pairs - there you have your answer. So there is no need for any RefreshRates() function for other symbols/pairs, because when you use MarketInfo() etc functions, you automatically get the latest values.
Now, to go further, if you want to make sure that the latest tick from other pair is at the start of that pair's new bar (i.e. first value of a new candle), you'll probably have to also check the times of those ticks, so that your computation only starts when every pair is in sync - I do that all the time, so I make use of global variables to keep track of times.
I hope I'm clear enough this time round.
Yes, you were pretty clear.
Of course they do, just not synchronously.
On MT5: Unless the chart is that specific pair/TF, you must Synchronize the terminal Data from the Server.
and Indicators Access / Data Access - Reference on
algorithmic/automated trading language for MetaTrader 5
Synchronize Server Data
with Terminal Data - Symbols - General - MQL5 programming forum