problem with Symbol() function

 

Hi all, I'm trying to recall a Global Variable from an expert in this way

string HOUR_ = StringConcatenate("HOUR_",Symbol()); 
GlobalVariableSet(HOUR_,HOUR()); 


GlobalVariableGet(StringConcatenate("HOUR_","EURJPY"))

If I apply the expert (with GlobalGet only) on a EURJPY chart the code works well, but I need to apply the expert on another symbol chart, and this doesn't work.

I don't understand where is the problem because if I print Symbol() and "EURJPY" the outcome is the same.

Thank you

 
  1. "Doesn't work" is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless. How do you know it didn't work? Did you print out _LastError?

  2. Press F3 and verify you actually have created that other symbol. Did you run the code on "another symbol chart?"
Reason: