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
Hi
Thanks for the response
I did read your post which was regarding a time range or range / filter and I understood the conclusion but not the equations completely
By your answer I have to assume that I don't understand how to create an expression that would compare something like if(Time[1] == 7:15) in it's proper form because I don't understand the equations you posted.
You really need to start learning your way around the documentation . . .
Go to any function that uses a TimeFrame and you will see timeframe enumeration . . . and it links to here: Timeframe enumeration and that will tell you that Period_H1 is a value of 60 . . . in other words 60 minutes . . . 60 mins * 60 = seconds . . . datetimes are in seconds.
What you have coded won't work . . your time_select is NOT a datetime . . . remember, what is a datetime ? from the Documentation . . . "datetime type (integer representing the amount of seconds elapsed from midnight, 1 January, 1970)." if you want a datetime that means 7:15 am it has to be the number of seconds that have elapsed from 1 Jan 1970 to 7:15am today . . .
What you ave calculated is the number of seconds from Midnight to 7:15am this morning, and that is not a datetime.
I know this is not a datetime and I guess If I understood exactly what PERIOD_H1 I would have know that too.
I get it now I have to convert to seconds from 1,January, 1970
ok thanks
You need to read what is written and figure it out . . . if you don't understand a Function look it up and read about it till you understand it. The code that WHR posted is very simple maths . . . the only thing you might not be familiar with is the % . . . it doesn't mean percentage . . . look it up, you can find it here: https://docs.mql4.com/basis/operations/math
I did not understand the 86400 or why that was used.
I just figured this out == how many seconds in a day got it thanks
I continued to work through this and understand the various ways to conclude midnight of a particular day
Then as suggested some other methods to calculate 18hrs x 3600 which I see is the number of seconds in an hour multiplied X 18 to give me HR1800
I think I should be able to make some various time codes from this including some time codes for a particular time not only a range
Thanks again
Incomplete and crude but at least I do understand all the posts now thanks a bunch
Here is some of my progress, for a selectible time and/or time range
Incomplete and crude but at least I do understand all the posts now thanks a bunch
I thought about it right after I posted it but left to eat dinner lol
I know I can eventually figure out how to simply use an actual user input for 7:15 or some such time but still nice to see the results I was looking for.
One function understanding at a time I think I need to work on, I probably crammed too much information in learning syntax and didn't work through each and every dictionary function and topic good enough to really make things easier for me.
Anyhow after all this time I finally have a handle on time including managing my own to be able to learn mql better.
Thanks again all
Anything wrong with this ?
Yep thanks I see it
I thought about it right after I posted it but left to eat dinner lol
Please advise thanks