Discussion of article "Creating a Multi-Currency Indicator, Using a Number of Intermediate Indicator Buffers"
it would be useful for such indicators to also sort this one
depending on their values. If there is such a function, please share it, so as not to invent a bicycle.
it would be useful to sort this in such indicators as well
depending on their values. If there is such a function, please share it, so as not to invent a bicycle.
There is no ready function, but I think it will not be difficult to sketch.
19.05.2010
Here is realised
Thank you.
The only thing I'd like to point out is that the synchronisation method doesn't always work. Here's a picture. Hole in quotes for 24 hours, but everything is synchronised (((.
This is very bad. Why is it so I can not understand, and most importantly, what to do about it?
Thank you.
The only thing I'd like to point out is that the synchronisation method doesn't always work. Here's a picture. Hole in quotes for 24 hours, but everything is synchronised (((.
This is very bad. Why is it so I can not understand, and most importantly, what to do about it?
The indicator uses 2 types of synchronisation
1 by the number of bars (there should be more bars on the chart than the required history by default 500 bars) this condition is apparently fulfilled.
2 by the time of opening of the zero bar on each currency pair - this condition is apparently also fulfilled.
I think it is worth adding a third type of synchronisation to check the opening time of each bar on each pair by analogy with the second type of synchronisation.
As I will be a little more free - I will make this type as well.
....
I think it is worth adding a third type of synchronisation to check the opening time of each bar on each pair by analogy with the second type of synchronisation.
In your image and similarity I made the function bool init_tf(...).
//+------------------------------------------------------------------+ //| Initialisation of the charts of the involved currency pairs | //| and data synchronisation check| //+------------------------------------------------------------------+ //| in.| //| mas[] is an array of names of the required characters | //| time_0 - current bar time[0]| //| count_Bars - required number of bars | //+------------------------------------------------------------------+ bool init_tf(string &mas[], datetime time_0, int count_Bars) { bool rez=false; // success flag int copied=0, // number of copied data counter=0, // error counter tmp_bars=0; // to check the number of available bars datetime tmp_time[1]; // array to check the bar time f_comment("There's a sychronisation in progress."); for(int i=0; i<count_symbol; i++) { //Print("i=",i," ",count_symbol," ",mas[i]); tmp_bars=Bars(mas[i],PERIOD_CURRENT); if(tmp_bars<count_Bars) { // check the number of bars Print("i=",i," Not enough bars (", mas[i],"-",fTimeFrameName(_Period),") MaxBars=",MaxBars," > Bars=",tmp_bars); counter++; } ResetLastError(); copied = CopyTime(mas[i],PERIOD_CURRENT,0,1,tmp_time); if(copied < 1) { // copy error Print("i=",i," Copy Error (", mas[i],"-",fTimeFrameName(_Period),") №",_LastError," (",ErrorDescription(_LastError),")"); counter++; } if(tmp_time[0]!=time_0) { // the time didn't match Print("i=",i," No time synchronisation (", mas[i],"-",fTimeFrameName(_Period),") delta ="",(long)(time_0-tmp_time[0])/60," min"); counter++; } }// end for(int i=0; i<k; i++) if(counter==0) { // everything is ok. no errors rez=true; f_comment("Everything. Okay."); } else f_comment("There's no synchronisation."+(string)counter); ChartRedraw( ); return(rez); }
I selected 12 pairs that will be at the championship. I made an indicator RVI_ALL only for the purpose of studying synchronisation. Started it. Result.
2010.05.30 16:55:26 RVI_ALL (EURUSD,M1) i= 10 No time synchronisation ( GBPJPY - M1 ) delta = 1 min
2010.05.30 16:55:26 RVI_ALL (EURUSD,M1) i= 5 No time synchronisation ( AUDUSD - M1 ) delta = 1 min
2010.05.30 16:55:26 RVI_ALL (EURUSD,M1) i= 1 No time synchronisation ( GBPUSD - M1 ) delta = 1 min
It is Sunday, there are no bars (last bar) on these symbols. The next tick, only on Monday. Then I remembered this article chart without holes https://www.mql5.com/en/articles/1407.
And there will be holes. There will be. We must fight them somehow. In principle, you can do the same as described in the article. But I have one question.
The indicator hangs on a single chart. And if there is a history swap on this symbol, I can find out about it, prev_calculated will be reset to zero.
But how do I know that the other symbols had a history swap or the data just came with a long delay?
And there will be holes. There's gonna be holes. They must be dealt with somehow. In principle, you can do the same as described in the article. But I have one question.
The indicator hangs on a single chart. And if there was a history swap on this symbol, I can find out about it, prev_calculated will be reset to zero.
But how do I know that the other symbols had a history swap or the data just came with a long delay?
1 Either do not allow the indicator to be drawn if there is a hole in the history and periodically poll the history at the moment of "patching" the hole. (A new tick on the current chart or a timer).
2.Or draw the indicator only up to the hole, provided that the hole in the history is far enough.
and slightly modify this function
bool init_tf(string &mas[], datetime time_0, int count_Bars, int shift) и далее по тексту copied = CopyTime(mas[i],PERIOD_CURRENT,shift,1,tmp_time);
Then call this function in a loop (from 0 to shiftbars).
In this case
shift
it will be the bar position on the current instrument and TF, which we check for synchronisation with other instruments.
I have no way of knowing there's a hole in the story.
https://www.mql5.com/ru/forum/1111/8747#comment_8747
The only way out is to copy the time and loop through the entire array, but this again can be a bummer, it's a vicious circle ( ((
If the developers do not change the concept of https://www.mql5.com/en/articles/1407 to make charts without holes, it may turn out that it is impossible to synchronise everything.
I have no way of knowing there's a hole in the story.
https://www.mql5.com/ru/forum/1111/8747#comment_8747
The only way out is to copy the time and loop through the entire array, but this again can be a bummer, it's a vicious circle ( ((
If the developers do not change the concept of https://www.mql5.com/en/articles/1407 to make charts without holes, it may turn out that it is impossible to synchronise everything.
Use synchronisation by time[] buffers and there will be no confusion.
Just a quote call should be accompanied by a pre-check by time, and then everything will be synchronised.
Although I agree that the way is not easy and there may be a lot of errors.
Hello!
I have doubts about the correctness of the dollar index formula, maybe they are false
Could someone please explain this formula in more detail and how it came about?
"The dollar index is a value of type double calculated using a formula kindly provided to me by Neutron."
Why cite formulas and reference someone else's name? Does he have seven eyes in his head? It turns out that first you need to read the article, then ask the authors of the formulas? If he is the author, then give the link where he gets it.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article Creating a Multi-Currency Indicator, Using a Number of Intermediate Indicator Buffers is published:
There has been a recent rise of interest in the cluster analyses of the FOREX market. MQL5 opens up new possibilities of researching the trends of the movement of currency pairs. A key feature of MQL5, differentiating it from MQL4, is the possibility of using an unlimited amount of indicator buffers. This article describes an example of the creation of a multi-currency indicator.
Author: Alexey