First bar of the day should be the first bar after TimeHour() started over with counting.That will be of course the first bar of anything M1 , M5 , M15 etc they all start new bars.
I will try it soon, also I am working on this issue.
Thanks a lot.
I still read forums and researching, I can find similar forums, but can't find exactly what I want. ( maybe I do not understand their code style or ... )I made quickly screenshot, I hope this could help you clearly understand me.
Thanks in advance.
Ive had a few beers so i hope you get the idea im sure its wrong in every possible way.
I think open must be replaced by time.
Or maybe you can even do:
Ive had a few beers so i hope you get the idea im sure its wrong in every possible way.Or maybe you can even do:
( I tried to explain my issue in code source section )
Are you think why I do not open sub topics? I am still working on it. I can find solutions in forums. Now it's going good also little slowly.
Additionally: When I started to write Trade Panel EA's I was thought I need to write 4 function scripts Sell, Buy, Close all Order, EXIT ( remove ) EA. While I work on it I got a lot of idea's... now that EA's have over 3k lines. Still I should write almost 10 more useful functions if I decided about all of them.
Also maybe when I finish my that Trade Panel EA's I will write little story about how I started to write script for my Trade Panel EA's. ( even I don't finished it - really I belieave who will see it most people will say: Wow awesome! ) hehe :)
Thanks Mr. Marco.
Thank you all ( who reply my comments ) a lot and for your helps.
Thanks for your great example.Maybe if I take a time I will try explain with video / image tomorrow.
I research about this issue so hard.
( also I search like this keywords in google seo (not useful comment so far in seo): site:mql4.com | site:mql5.com first bar of the day )
Are you looking for a way to automatically detect the local > broker time offset? e.g. +1 hour
If you are going to have a manual setting (this is better because sometimes you don't want to use local time but another timezone altogether) the steps your follow are like in my script above:
1. Get midnight on broker time (using iTime or through calculation)
2. Convert it to a local midnight using your offset setting
3. Put local midnight through iBarShift to get the correct bar on your chosen timeframe.
Are you looking for a way to automatically detect the local > broker time offset? e.g. +1 hourIf you are going to have a manual setting (this is better because sometimes you don't want to use local time but another timezone altogether) the steps your follow are like in my script above:1. Get midnight on broker time (using iTime or through calculation)2. Convert it to a local midnight using your offset setting3. Put local midnight through iBarShift to get the correct bar on your chosen timeframe.
You absolutely understand me correctly - that I am looking for a way to automatically... - So, why? I have few important indicator ( self made - with different forums helped ) if I choose manual way - I could change their settings... that is long way - I am so lazy. :)Thanks so much more!Maybe I found solution ( at this time looks like it's working - I already tried 2 different brokers I get correct time ).
I believe question comes from lack of experience.
Q: How can I keep only Hour 1 in below outcome, please? ( Actually I found how can I keep only " 1 " from below outcome - but I need professional method, please ) ( e.g: result: 2017.02.27 01:00:00 - But I need to keep only: 1 )
Thanks a lot for everything.
( I will share how I found solution. - if you did not help I can't found solution - one more thanks a lot. )
I was looking for just below code.But I still need to test it.
If above code is not right, please let me know.
Thanks a lot @honest_knave and @Marco
Well Max consider this, if you are scanning for a pattern, and it forms, then your trigger will go off regardless of time stamp.
So the trigger can have several time stamps on different brokers, but the exact moment of the trigger would be about the same on all brokers.
Not exactly, but close enough.