I want to assign a name on a variable and I want the name to include the Timeframe or the symbol name of the current chart. As an example suppose that I'm running my indicator on "W1" timeframe so I want my variable name to be XYZ_W1 . I want to know is it possible in MQL4 to do so ? Or as another example, suppose that I've attached my indicator on EURUSD chart and I'm going to assign ABC_EURUSD as the name of a variable, would it be possible to do so ?
thanking in advance for your kind guidance,
You are writing code, there is no chart, there is no timeframe. The code must be done before you can put it on a chart. So no, not possible.
Even if it were, what are you going to do if you put it on another pair/tf? Are you going to rename all your variables? Why?
As stated by WHRoeder, not possible and completely useless. And a very bad practice if it was possible.
This is possible with global variables: https://docs.mql4.com/globals/globalvariableset