Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1165
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
You can't lose a skill.
Yes? A hundred, then? With lemon...
In the screenshot, the buffer display is shifted five bars to the right. So - to get the fifth bar of the indicator buffer (with index 4), and further down the list to the left, where should we get them from? From Buffer[4] and further to the left.
In theory. In practice I haven't opened the code of indicators for a long time, I haven't worked with them for almost a year. Give it a try.
That's right. But I don't need those 5 values on the right, I want to have necessary value in Buffer[0] at once. Otherwise I will have to pass not only the buffer but the offset as well into a bunch of functions to calculate fractals by MA and other stuff. This is an unnecessary complication of the code and extra slow-down of calculations.
I can copy required values into Buffer (without 5 MA values to the right) only if I pass -2*ma_shift into CopyBuffer for start_pos.
That's the original question - where did the double negative offset come from. Please clarify. Perhaps it is a bug, or maybe it is a feature of MQL5.
This is correct. But I don't need those 5 values on the right, I want to have the desired value in Buffer[0] at once. Otherwise I will have to pass not only buffer, but shift as well into a bunch of functions for calculation of fractals by MA and other things. This is an unnecessary complication of the code and extra slow-down of calculations.
I can copy required values into Buffer (without 5 MA values on the right) only if I pass -2*ma_shift into CopyBuffer for start_pos.
That's the original question - where did the double negative offset come from. Please clarify. Perhaps it is a bug, or maybe it is a feature of MQL5.
You see that you are not understood. If you do so, you usually draw a picture. It's not clear yet WHAT you want to get.
Added: The picture should show WHAT the WHOLE result should be.
This is correct. But I don't need those 5 values on the right, I want to have the desired value in Buffer[0] at once. Otherwise I will have to pass not only the buffer but also the offset into a bunch of functions for calculation of fractals by MA and other things. This is an unnecessary complication of the code and extra slow-down of calculations.
I can copy required values into Buffer (without 5 MA values to the right) only if I pass -2*ma_shift into CopyBuffer for start_pos.
That's the original question - where did the double negative offset come from. Please clarify. Perhaps it is a bug, or maybe it is a feature of MQL5.
The shift is simply a shift in the mask display. The rightmost value will be in Buffer[0]. If you want to know the value on the zero bar, it will be in Buffer[0 + shift].
If you want it without + shift, specify 0 + shift inCopyBuffer(), then Buffer[0] will contain the desired value.
Can you tell me which inluder to plug in to get to the MathCorrelationKendall() function ?
Connect:
#include <Math\Stat\Math.mqh>
Connect:
Thank you.
All this is clear. Question - what starting position should be specified in CopyBuffer() to get "without + shift" in your terms?
You see that you are not being understood. In such a case, it is usual to draw a picture. It is not yet clear what you want to get.
Added: The drawing should show WHAT the result should be.
There was already a drawing. I will repeat it.
You want Buffer[0] to have the MA value corresponding to the red vertical line.
Buffer[1] must have the MA value to the left of the red line. And so on.
And it is all in the indicator.
This is all understandable. Question - what starting position to specify in CopyBuffer to get in your terms "without + shift" ?
The value you add for the MA offset is 1.