Download MetaTrader 5

Struggling with GV code - page 2

To add comments, please log in or register
Simon Gniadkowski
Moderator
18046
Simon Gniadkowski  
kminler:

I must have taken the print statement out when I cleaned up the Ha, I had a lot of other stuff in there I was testing.

I'm afraid that I don't understand "doesn't write to Global Variable either" I thought GlobalVariableGet saved the value into the GV and which would then be wrote to "currenthaLow"?

Not too sure that I follow your last line, I have the HA indicator runing on the Aussie 15 min, I attach GVTESTER to the AUDJPY, it is my expectation that

with each tick the value of haLow is recalculated by Ha and GVTESTER will get the new value.

This is indeed what happens when I run HA with the three lines inserted, however; for the life of me I cannot get the value to GVTESTER on the AUDJPY chart.

OK, I see the confusion now . . .

GVTESTER has a variable called haLow

Your HA Indicator has a variable called haLow

These variables have no connection with each other . . . they are called the same name but they are totally separate entities. You need to add the Global Variable code into the HA Indicator . . .

Keith
370
Keith  

OK finally got it, inserted the GV code into Ha and then deleted "GlobalVariableSet("TGV_gethaLow", haLow);" from GVTESTER,

so then GlobalVariableGet worked correctly.

Many, many thanks!!!

Simon Gniadkowski
Moderator
18046
Simon Gniadkowski  
kminler:

OK finally got it, inserted the GV code into Ha and then deleted "GlobalVariableSet("TGV_gethaLow", haLow);" from GVTESTER,

so then GlobalVariableGet worked correctly.

Many, many thanks!!!

You are welcome . . .
12
To add comments, please log in or register