This line needs to be called every time at the start of OnCalculate - at the moment you are setting it once at the beginning instead of checking the latest time (the print statement should reveal the time is not changing)
This line needs to be called every time at the start of OnCalculate - at the moment you are setting it once at the beginning instead of checking the latest time
If you mean, Use That Line Under OnCalculate; Try This Before; But Didnt Work , Look :
MQL5 : langage de stratégies de trading intégré à la plateforme de trading MetaTrader 5, permet d'écrire vos propres robots de trading, indicateurs techniques, scripts et bibliothèques de fonctions
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.
wow, Perfect.
I Have To Use This Under OnCalculate; Right?
Yes that sounds right
Yes that sounds right
still, not working...
it's keep time value to false.
look :
Yes that sounds right
Note : it's an MT5 indicator.
Note : it's an MT5 indicator.
This line needs to be called every time at the start of OnCalculate - at the moment you are setting it once at the beginning instead of checking the latest time (the print statement should reveal the time is not changing)
Also I cannot see where you use the variable 'time' to control the program logic - at the moment you are just storing true or falseThis line needs to be called every time at the start of OnCalculate - at the moment you are setting it once at the beginning instead of checking the latest time
If you mean, Use That Line Under OnCalculate; Try This Before; But Didnt Work , Look :
If you mean, Use That Line Under OnCalculate; Try This Before; But Didnt Work , Look :
Please share the output of the print statements - a few executions please
Please share the output of the print statements - a few executions please
I tested it in OnCalulate() - works fine for me:
2023.12.06 22:36:16.745 time = true
2023.12.06 22:36:18.277 SecsSinceMidnight = 68777 TimeSinceMidnight = 19:06:17 [start = 09:00:00 end = 23:00:00]
2023.12.06 22:36:18.277 time = true
2023.12.06 22:36:19.642 SecsSinceMidnight = 68778 TimeSinceMidnight = 19:06:18 [start = 09:00:00 end = 23:00:00]
2023.12.06 22:36:19.642 time = true
2023.12.06 22:36:19.787 SecsSinceMidnight = 68778 TimeSinceMidnight = 19:06:18 [start = 09:00:00 end = 23:00:00]
2023.12.06 22:36:19.787 time = true
Changing to 21:00
2023.12.06 22:36:29.492 SecsSinceMidnight = 68788 TimeSinceMidnight = 19:06:28 [start = 21:00:00 end = 23:00:00]
2023.12.06 22:36:29.492 time = false
2023.12.06 22:36:29.605 SecsSinceMidnight = 68788 TimeSinceMidnight = 19:06:28 [start = 21:00:00 end = 23:00:00]
2023.12.06 22:36:29.605 time = false
2023.12.06 22:36:29.667 SecsSinceMidnight = 68788 TimeSinceMidnight = 19:06:28 [start = 21:00:00 end = 23:00:00]
2023.12.06 22:36:29.667 time = false
2023.12.06 22:36:29.732 SecsSinceMidnight = 68788 TimeSinceMidnight = 19:06:28 [start = 21:00:00 end = 23:00:00]
2023.12.06 22:36:29.732 time = false
I tested it in OnCalulate() - works fine for me:
2023.12.06 22:36:16.745 time = true
2023.12.06 22:36:18.277 SecsSinceMidnight = 68777 TimeSinceMidnight = 19:06:17 [start = 09:00:00 end = 23:00:00]
2023.12.06 22:36:18.277 time = true
2023.12.06 22:36:19.642 SecsSinceMidnight = 68778 TimeSinceMidnight = 19:06:18 [start = 09:00:00 end = 23:00:00]
2023.12.06 22:36:19.642 time = true
2023.12.06 22:36:19.787 SecsSinceMidnight = 68778 TimeSinceMidnight = 19:06:18 [start = 09:00:00 end = 23:00:00]
2023.12.06 22:36:19.787 time = true
Changing to 21:00
2023.12.06 22:36:29.492 SecsSinceMidnight = 68788 TimeSinceMidnight = 19:06:28 [start = 21:00:00 end = 23:00:00]
2023.12.06 22:36:29.492 time = false
2023.12.06 22:36:29.605 SecsSinceMidnight = 68788 TimeSinceMidnight = 19:06:28 [start = 21:00:00 end = 23:00:00]
2023.12.06 22:36:29.605 time = false
2023.12.06 22:36:29.667 SecsSinceMidnight = 68788 TimeSinceMidnight = 19:06:28 [start = 21:00:00 end = 23:00:00]
2023.12.06 22:36:29.667 time = false
2023.12.06 22:36:29.732 SecsSinceMidnight = 68788 TimeSinceMidnight = 19:06:28 [start = 21:00:00 end = 23:00:00]
2023.12.06 22:36:29.732 time = false
maybe Im using time recall in a wrong place :
Are you sure you want to stop the indicator?😄
If you want to ignore bars whose times are outside the time range you specify, then you should analyze the times of the bars, not the current time