Questions from Beginners MQL5 MT5 MetaTrader 5 - page 990
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
Question: Why a Handel set to one period does not pass values toCopyBuffer on other timeframes. And what to do?
If the problem was in shifting of array buffer element at different timeframe I would solve the issue. And so it's not clear at all.
Question: Why a Handel set to one period does not pass values toCopyBuffer on other timeframes. And what to do?
If the problem was in shifting of array buffer element at different timeframe, I would solve the issue. And so it's not clear at all.
If the handle was created successfully, it is created with the parameters you have passed to it during its creation. And it will give the indicator data at any timeframe. However, it will give the data of the timeframe that you specified during creation. And to correctly display them on the working timeframe, you need to convert the received data from the indicator handle to the timeframe your indicator works in.
Was just checking this out. But the PROBLEM is that by setting the handel to one permanent period, in
CopyBuffer value on other timeframes is NOT TRANSFERABLE. The value was on the set handle period and 0.0 (zero) on the smaller timeframes. Moved in search of the buffer... zero. Why isn't it passed toCopyBuffer ?
I have it copied...
Another question is what gets copied :) Most likely you are requesting more bars to copy than there are on that TF, print
If the handle was created successfully, it was created with the parameters you gave it when you created it. And it will give the indicator data at any timeframe. But it will give the data of the timeframe that was set during creation. And to correctly display them on the working timeframe, you need to convert the data obtained from the indicator handle to the timeframe your indicator works in.
Did I do the experiment correctly?
I gave you a direction...
Study it:
I have it copied...
Another question is what's copying :) Most likely you are asking for more bars to copy than there are on that TF, print
kopeyka2:
Верно ли я провел эксперемент.?
...
... Even when switching to another timeframe the values should be from the set D1. That's exactly what I don't see. Or something is wrong? Is there something else I should add when setting a handle? Since there is no buffer transfer.
Simply speaking, experiment with CopyByffer , what to put in it should be. But it's not there.
You haven't checked availability of data, but you are trying to copy. Look at the code above - there in second timer every minute and a half the non-native timeframe is accessed - to keep data up to date. And the first thing in the code is to check if the requested data is available. If they are not ready, then it returns zero for the next tick and the complete calculation of the indicator. And when all data has been received and calculated, and displayed, the amount of calculated data is returned at the end - in order not to do the complete recalculation on the next tick.
Thank you. I read it all. I'll keep looking.
What are you looking for? The code above is fully working. You can dissect it however you like. I pointed out your mistake - you don't check data availability.
Even on this line here:
int lm=IBarShift(NULL,PERIOD_D1, iTime(NULL, PERIOD_CURRENT, limit));
Where's the check for what iTime() returned? There is no check. But you shove an unknown result right into iBarShift(). Are you sure you're giving the function what you expect?
If the handle was created successfully, it's created with those parameters, that were passed to it during its creation. And it will pass the indicator data at any timeframe. However, it will give the data of the timeframe that was set during creation. And to correctly display them on the working timeframe, you need to convert the received data from the indicator handle to the timeframe your indicator works in.
That's exactly what I thought. The issue of misunderstanding is the word "parameters". So I started looking at ALL the variables that are involved in the handle --> CopyBuffer
1) My question from the beginning was to switch the timeframe SCREEN to save the handle data. As it is in MT4.
And in fact it turns out so:
ALWAYS and on ALL timeframes gives the same value of 10
Having got nothing here I moved on.
2) And I quote:"Gets the data of the specified buffer of the specified indicator in the specified amount into the buffer array".
That is, by settingthe count by hand we should have an INTERVAL with the values . And there they are! BUT!!!!!! Only when the handle period corresponds to
PERIOD_H1timeframe on the monitor screen. All values are transmitted clearly. But moving to another timeframe, there is NO data on the screen.
They are NOT transmitted in any way!!!! And my question was exactly that. And the number of bars is not so important here if they are NOT there!!!!
I looked at the suggested indicatorMTF_LRMA.mq5 but it's the same. It switches to another timeframe on the screen and the data goes by the screen timeframe. I need it on a handheld.
For example: iClose(NULL, PERIOD_H1, 5); on all timeframes it will give the same value: close on 5 bars on H1.
So far all examples were on CopyBuffer count correction. But the array is empty.