It works as intended, but when I switch the time frame (HTF or LTF, doesn`t matter), it dissapears and has to be reattached.
Any advice?
It works as intended, but when I switch the time frame (HTF or LTF, doesn`t matter), it dissapears and has to be reattached.
Any advice?
Convert the Script into an Indicator, and put the timeframes switch inside the OnInit() event handler.
As alternatives, 2 indicators are attached.
Strictly speaking this script will not work correctly depending on the symbols selected in the Market Watch.
TimeCurrent() is returning the last update time of any symbol in the Market Watch, if they are a lot of symbols then fine, if there are only symbol(s) with low activity, your counter will not move.
Additionally, using sleep(1000), you can have a shift of almost 1 second in your counter.
Exemple : it should be 00:37:05
My countdown timer (MT4) uses the timer to update.
Indicators: Zero Lag Timer - Indices - Articles, Library comments - MQL5 programming forum #8 (2017)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Simple Bar Timer:
It is a script to display the time remaining until next bar arrives.
Author: Conor Mcnamara