Questions from Beginners MQL5 MT5 MetaTrader 5 - page 531
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
It's a bit of a mess, isn't it?
...
Pardon my impertinence, but can you show me how to combine your code and mine?
An ancient folk wisdom says: if you want to help a hungry man, don't give him a fish, give him a fishing rod.
If you have any questions, do ask.
I don't agree, because the man makes an indicator, and in an indicator you need to work with arrays from OnCalculate().
It's a bit of a mess, isn't it?
And how do you know what day the 163 bar of the current TF is?
time[163]
So in the indicator you will get the opening date of the bar with index 163.And how do I know what day is on the 163 bar of the current TF?
I don't quite understand the question.
0 = today's
1 = yesterday, etc.
Print(time[163]) or Comment(time[163]) will print the date/time in human form.
corrected.
This way in the indicator you will get the open date of the bar with index 163.
Did an experiment, put 163 and got a line
2016.03.07 18:46:29.062 Start_day GBPUSD,H1: Start day 2016.02.25 03:00:00
And actually should have gotten the date 2016.03.01 00:00:00 !
I guess I'm not very good at explaining what I want to get, let me try again.
I need to make a calculation on each chart of the current TF. The calculation requires to know the date of the upper TF (days). Above I have attached the code - the idea is to know on each bar the maximum price of the upper TF at the time of the bar opening in the current TF.
I don't quite understand the question.
0 = today's
1 = yesterday, etc.
Print(time[163]) or Comment(time[163]) will print the date/time in human form.
corrected.
Use TimeToStruct().
I can't figure out how to use it.
The second value requires"MqlDateTime&dt_struct// structure for taking values", but I don't understand how to use this MqlDateTime.