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
Okay, yesterday we got a little overexcited, I guess you also celebrated "Border Guard Day" like me.
Can you give me a link to the correct synchronisation of bars, because I also use this method of synchronisation by the last bar and that's it?
I won't give you a link (because I haven't met it yet), but I will describe the method.
The method concerns synchronisation of different instruments, although it can be used for synchronisation of different TFs.
I have been dealing with this problem for quite a long time, and even SD made a bug-fix for the bugs of this method that I have identified.
The synchronisation problem is related to the fact that different instruments have a different number of bars. Approximately the same is a false criterion, everything must be exact. Bar to bar. Otherwise, the meaning of synchronisation is lost.
The second aspect of this problem is how to display a bar if there is no bar on the current instrument?
So the essence of the method is simple: data on the instrument are requested strictly by times...
and the sample of time is taken from the standard buffer of the indicator time[]. Thus, you always know for sure that you are facing a bar that came synchronously with a bar on another instrument.
Again, if there is no such bar in the current instrument, you will not request it. And if the requested instrument does not have such a bar as a sample, you will get a zero in the count and can normally handle this exception, depending on the logic of your programme.
Implementation of synchronisation (in MQL4) for any number of FIs(from here):
By analogy for two symbols (from here):
I.e. everything is quite simple. Another thing is that the classical barometric (constant time discretisation) representation of price BPs is not the only one, much less always correct. Sometimes it is extremely useful to synchronise price BPs of another time dimension. That is, by introducing distortions that are non-linear from the point of view of classical time. Correspondingly, then the correlation will show non-linear interrelations of two classical VRs.Thanks for your help!
I was wrong I admit, I didn't think that synchronisation is so complicated.
I will try to figure it out and synchronise bars directly on this indicator as I need it very much.
Thank you all for the information!
I rewrote the indicator a bit. Now, supposedly, it should skip bad parts of history.
Since we have started, please check for errors :)
I will speak out once again for the necessity of algorithmic optimisation for all indicators. And also for the built-in mechanism of calculating indicator values in memory (file), so that during the tester optimisation the indicator does not calculate the same thing, but takes ready-made values from there.
Algorithmic optimisation for each indicator is different. For different ways of using correlation, I did, for example, this and this.
Reading from memory the values of indicators calculated in advance for the whole history was done only in my calculator. That is, I don't have a universal mechanism, because I only use my own solutions, which are not beautiful at all. But since I am for the improvement of everything, it would be great to have such a universal mechanism in case of the optimiser of the MT5 tester, because it gives acceleration by several orders of magnitude (experience of using it in my calculator), i.e. it outshines Cloud in terms of efficiency.
Hi there
Sometimes I spend time distorting the codes of others, usually the results of an incomplete or incomplete programme, both lack of time and lack of skill.
This time I would try to distort this wonderful indicator, and tried to do something like this:
- Drawing just a line, not a dotted plotting line
- To add a lot of symbols such as
Then to create 2 variants of the source code:
- Visual variant: a coloured line for each of the currency pairs correlation 1 thick line which is just the average of 7 lines ((A+B+C+D+E+F+G)/7)
- No visual variant: 1 line only, which is the result of the above formula ((A+B+C+D+D+E+F+G)/7)
Almost like adding 7 (or 8) original Correlation Indicator, but all summed up so that just averages as with the version, one of which is 7 lines + 1 (average), and the other version with 1 line (only average).
something like this:
For a number of reasons garbled code doesn't do what I want to do because of completely logical errors.
The main problem is with the buffers, synchronisation and recursive indentation part of the code:
if(bars1>bars2) { minBars=bars2; bars2=bars1-bars2; etc...+ as well as other logical errors.
some Print() functions have been added to help in the case of tracking variable values and return 0 instructions have been commented out in order to find where the code logically fails.
code and file