Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 778

 

Good morning.

How to make a function run every i hours (i=1, 4, 12, 24)?

You can find out the local time of the computer, and then?

Ozero.

 
Ozero:

Good morning.

How to make a function run every i hours (i=1, 4, 12, 24)?

You can find out the local time of your computer.

Ozero.



Run on the clock and monitor the appearance of a new bar or use OnTimer()

OnTimer

Function OnTimer() is called when the Timer event occurs, which is generated by the system timer only for Expert Advisors and indicators - you cannot use it in scripts. The frequency of the event occurrence is set when subscribing to notifications about this event to be received by the EventSetTimer() function.

You can unsubscribe from receiving timer events for a particular Expert Advisor using the EventKillTimer() function. The function must be defined with void type, it has no parameters:

voidOnTimer();

It is recommended to call the EventSetTimer() function once in the OnInit() function, and the EventKillTimer() function should be called once in OnDeinit().

Every Expert Advisor and every indicator works with its own timer and receives events only from it. As soon as the mql4 program stops operating, the timer is destroyed forcibly, if it was created but hasn't been disabled by the EventKillTimer() function.

 
Ozero:

Good morning.

How to make a function to run every i hours (i=1, 4, 12, 24)?

You can find out the local time of the computer, and then?

Ozero.

Subtract TimeHour from it and execute program when the value is approximately 3600*x, where x is number of hours. If you don't need exact time at the beginning of the hour +/- 1 tick, timer is easier to work with.
 

Good afternoon Smart People!

I'm at kindergarten level in codes - change the colour, thickness of lines, erase the inscription, etc.. The chart indicator of Murray's levels, which I am talking about, is not friendly on the chart with self-similar ones with different period settings ... The purpose:_to make the indicator not to interfere with its brothers, but with different settings, i.e. to achieve the work of 3 identical indicators. Please advise how to do it. Thank you.

 
Good afternoon. Need help on a simple EA helper. I need an EA which opens 1 order in the chosen direction, the chosen lot at the formation of a new candle, respectively, given the time frame chart. Maybe someone has seen such an EA or can write one.
 
Podgeneral:

Good afternoon Smart People!

I'm at kindergarten level in codes - change the colour, thickness of lines, erase the inscription, etc.. The chart indicator of Murray's levels, which I am talking about, is not friendly on the chart with self-similar ones with different period settings ... The purpose:_to make the indicator not to interfere with its brothers, but with different settings, i.e. to achieve the work of 3 identical indicators. Please advise how to do it. Thank you.

It can be done. So can you. If you want to.
 
Hello, help. The profile is missing in MT4. In the profiles file program, the profile name is there, but there are no charts and the toolbar is not active. In the installation folder "profiles", there is no folder with such a profile. If some other profile is missing, it would not be so offensive, but a lot of work has been invested in this one. Help me, tell me where it's gone.
 
Podgeneral:

Good afternoon Smart People!

I'm at kindergarten level in codes - change the colour, thickness of lines, erase the inscription, etc.. The chart indicator of Murray's levels, which I am talking about, is not friendly on the chart with self-similar ones with different period settings ... The purpose:_to make the indicator not to interfere with its brothers, but with different settings, i.e. to achieve the work of 3 identical indicators. Please advise how to do it. Thank you.

in the name of levels add a period
 
pako:
In the name of the levels, add the period
Thank you. I will try.
 
pako:
in the name of the levels, add the period
Podgeneral:
Thank you. I am trying.
I have added in levels and indicator names and set different periods, but the chart disappears and only one indicator, the last one set, hangs.
Reason: