- The indicator is removed and reloaded on TF change.
-
Perhaps you should read the manual. UninitializeReason
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
Remember the uninit reason in a global variable and query it during OnInit().
![Event Handling Functions - Functions - Language Basics - MQL4 Reference Event Handling Functions - Functions - Language Basics - MQL4 Reference](https://c.mql5.com/36/50/event-handling-functions-functions.png)
Event Handling Functions - Functions - Language Basics - MQL4 Reference
- docs.mql4.com
Event Handling Functions - Functions - Language Basics - MQL4 Reference
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have a certain block of code in OnInit() function which I only want to execute once everytime the indicator is attached to the chart,
but I dont want it to be executed when the timeframe is changed , so it there a way to accomplish this ?