Global variables issue mql5 - page 2

 
Fernando Carreiro #:

Yes, that makes sense, but it really depends on how your Indicator reacts to chart changes.

If the indicator needs to reset data if you change time-frame, then it is best to keep track of the time-frame in the prefix. It it keeps that data, then it will be best NOT to use the time-frame in the prefix.

The same applies to the Symbol. If the Indicator needs to reset for a symbol change, then keep the symbol name in the prefix, but if it keeps the data regardless of the symbol, then don't use the symbol name in the prefix.

Thanks a lot