If I understand you correctly and you want to hide fractals whose bar time does not fall within the range you specify, then you need to analyze the time of the bars (on which the fractals are located), and not the current time
[EDIT]
Apply your algorithm (below) not to TimeCurrent(), but to time[i]
(I did not check the correctness of the algorithm, and in this case it is better to remove the prints, otherwise you will get a million of them)
Bro What I Want is really really simple.
this indicator work all day long and print fractals arrows; I Want to work just from 9am to 11pm instead of all day long.
I ran it again with the settings 14:00-23:00, all prints are within the specified range:
2023.12.0700:50:23.669 EURUSD,H1: testing of Indicators\FractalsPrinter\FractalsPrinter.ex5 from2023.11.0600:00 to 2023.12.0600:00 started with inputs:
2023.12.0700:50:23.669 inpFrom=14:002023.12.0700:50:23.669 inpTo=23:002023.12.0700:50:53.4042023.11.0620:00:00 A new lower fractal 1.07260 appeared on the 2023.11.0617:00 bar
2023.12.0700:50:53.6892023.11.0621:00:00 A new upper fractal 1.07491 appeared on the 2023.11.0618:00 bar
2023.12.0700:51:00.0662023.11.0716:00:00 A new lower fractal 1.06655 appeared on the 2023.11.0713:00 bar
2023.12.0700:51:08.4262023.11.0719:00:00 A new lower fractal 1.06640 appeared on the 2023.11.0716:00 bar
2023.12.0700:51:09.8982023.11.0722:00:00 A new lower fractal 1.06724 appeared on the 2023.11.0719:00 bar
2023.12.0700:51:21.8052023.11.0815:00:00 A new lower fractal 1.06593 appeared on the 2023.11.0812:00 bar
2023.12.0700:51:35.8202023.11.0816:00:00 A new upper fractal 1.06777 appeared on the 2023.11.0813:00 bar
2023.12.0700:51:37.6272023.11.0818:00:00 A new lower fractal 1.06601 appeared on the 2023.11.0815:00 bar
2023.12.0700:51:39.4912023.11.0821:00:00 A new upper fractal 1.07159 appeared on the 2023.11.0818:00 bar
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
If I understand you correctly and you want to hide fractals whose bar time does not fall within the range you specify, then you need to analyze the time of the bars (on which the fractals are located), and not the current time
[EDIT]
Apply your algorithm (below) not to TimeCurrent(), but to time[i]
(I did not check the correctness of the algorithm, and in this case it is better to remove the prints, otherwise you will get a million of them)
Bro What I Want is really really simple.
this indicator work all day long and print fractals arrows; I Want to work just from 9am to 11pm instead of all day long.
I think Vladislav has a very good point - perhaps the timing control should come after the exit from Oncalculate()
If it is just a matter of printing, then the timing code should be elsewhere
OK, But This Indicator Print arrow, in OnCalculate(). After That, How We Can Control The Operation Time?
OK, But This Indicator Print arrow, in OnCalculate(). After That, How We Can Control The Operation Time?
I a guessing here, but you could put the timing and print statement at the end of OnCalculate()
The rest of the indicator code can run every time, the print code can be timed
I will be offline now until tomorrow, so I hope that helps for now
At the moment a new fractal appears, print something in the journal if the current time is in the range 09:00-23:00
In the settings, the time of prints is set, not the time of fractals
I just took the standard indicator, then added prints and filtered prints by timeIn the settings, the time of prints is set, not the time of fractals
Yes, the code below can be simplified. This function is several years old, I'm too lazy to change and test it.
In the settings, the time of prints is set, not the time of fractals
I just took the standard indicator, then added prints and filtered prints by timethanks a lot mate.
but this one still print all day long...
Of course, it doesn't. OnStart is only for scripts, not indicators.
Of course, it doesn't. OnStart is only for scripts, not indicators.
Yes, You right.
But I try other codes; no one works.
thanks a lot mate.
but this one still print all day long...
Log file?
It works correctly for me.
I ran it again with the settings 14:00-23:00, all prints are within the specified range:
Log file?
It works correctly for me.
I ran it again with the settings 14:00-23:00, all prints are within the specified range:
I share my screenshot.