Questions from Beginners MQL5 MT5 MetaTrader 5 - page 784
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
Please help me with making up a function.
I have a current TF and an estimated TF, the function should return the difference between the two TFs in any combinations, if the measurement were in bars
How to implement this correctly?
I did it this way.
The problem is, I need this happiness for the indicator, but it does not want to initialize itself correctly and to this code
It reacts like this:
2017.09.22 14:23:27.742 donchian_channel_prognoz_MTF (Eu Splice,M5) K=3 Period=5
2017.09.22 14:23:27.776 donchian_channel_prognoz_MTF (Eu Splice,M5) test
2017.09.22 14:23:27.790 donchian_channel_prognoz_MTF (Eu Splice,M15) K=1 Period=15
The most confusing thing is that it prints a test that is already in the body of OnCalculate!
The first time the timeframe was defined correctly, but the second time it wasn't...
I don't know what's so strange...
I did it like this
The problem is, I need this happiness for the indicator, but it is strange and does not want to initialize correctly, in response to this code
It reacts like this:
2017.09.22 14:23:27.742 donchian_channel_prognoz_MTF (Eu Splice,M5) K=3 Period=5
2017.09.22 14:23:27.776 donchian_channel_prognoz_MTF (Eu Splice,M5) test
2017.09.22 14:23:27.790 donchian_channel_prognoz_MTF (Eu Splice,M15) K=1 Period=15
The most confusing thing is that it prints a test that is already in the body of OnCalculate!
The first time the timeframe was defined correctly, but the second time it wasn't...
I don't know what these wonders are.
Why do I have to go through all that trouble?
Isn't that easier?
What's with all the twists and turns?
Wouldn't that make it easier?
So the thread is for beginners, that's why I didn't know about this possibility, thanks for pointing it out.
Can you please tell me what is the most reliableiBarShift function with two TFs right now ?
I have a task to find, for example, on a minute bar the indicator value from the upper TF, for example, M15. The timeframes can be any, which complicates the solution.
For an hour TF, I did through the structure, but if it is M15, then here I am confused...
Can you please tell me what is the most reliable iBarShift function with two TFs right now ?
I have a task to find, for example, on a minute bar the indicator value from the upper TF, for example, M15. The timeframes can be any, which complicates the solution.
For an hour TF, I did through the structure, but if it is M15, here I am confused...
Spin this script:Searching Nearest Bar
Spin this script:Searching Nearest Bar
Thank you.
So the thread is for beginners, that's why I didn't know about this feature, thanks for the tip.
Can you please tell me what is the most reliable iBarShift function with two TFs right now ?
I have a task to find, for example, on a minute bar the value of the indicator from the upper TF, for example M15. The timeframes can be any, which complicates the solution.
For an hour TF, I did through the structure, but if it's M15, I'm confused here...
In this case you should try to forget about numbering of bars as it was in mql4. In mql5 everything is almost solved by bar time. In a pinch, you can use the Bars() function.
Alexei, this has been available in mql4 for a long time.
Apparently this shows that I don't know mql4 well either, which I never claimed...
And in this case try to forget about bar numbering as it was in mql4. In mql5 everything is almost solved by bar time. In a pinch, try to use the Bars() function.
Are you sure about rounding?
Suppose the time on m1 is 14:44, but I need 14:30 (first bar of M15).
Apparently this shows that I don't know mql4 very well either, which I never claimed...
Are you sure about the rounding?
Let's say the time on m1 is 14:44 and I need to get a time of 14:30 (first bar of m15).
This is something out of a different series. What do you need to get at 14:44 from the M15 bar period of 14:30? Take the function Copy**** in it put PERIOD_M15 and time 14:44 see what you get. And when the result is not what you expect, then the questions will be different.
It's something from another series. What do you need to get at 14:44 from the M15 bar period of 14:30? Take the function Copy**** in it put PERIOD_M15 and time 14:44 see what you get. And when the result is not what you expect, then the questions will be different.
Yes, that was the direction I was working in. Anyway, I got some help. Thank you, too.