Hello,
I have been stuck for many days now trying to solve a GV problem and have searched the forum for hours but could not find a solution. Any help would be very much appreciated. This is my problem:
I have 2 different charts running in 2 different pages. Chart 1 which is ES #F symbol runs on a 1 min chart in Page 1. Chart 2 which is ES U8 symbol on a 1 min chart runs in Page 2.
In real-time, Im trying to call the current price in chart 1 from chart 2 using Global variables.
This is the code i have applied to chart 1 in page 1:
function main() {
Close1 = Close(0);
setGlobalValue("val",Close1);
return null;
}
This is the code i have applied to chart 2 which runs in page 2 workspace:
function main() {
var vValue=getGlobalValue("val");
debugPrintln("current price = " + vValue);
return null;
}
when the above 2 codes are attached to each chart in each different page workspace, with chart 2 active to see the print output, i do not see the "chart 1" price update in real-time. I am making a mistake somewhere but cant work it out.
Any help would be very much appreciated.
Regards
Rod
I have been stuck for many days now trying to solve a GV problem and have searched the forum for hours but could not find a solution. Any help would be very much appreciated. This is my problem:
I have 2 different charts running in 2 different pages. Chart 1 which is ES #F symbol runs on a 1 min chart in Page 1. Chart 2 which is ES U8 symbol on a 1 min chart runs in Page 2.
In real-time, Im trying to call the current price in chart 1 from chart 2 using Global variables.
This is the code i have applied to chart 1 in page 1:
function main() {
Close1 = Close(0);
setGlobalValue("val",Close1);
return null;
}
This is the code i have applied to chart 2 which runs in page 2 workspace:
function main() {
var vValue=getGlobalValue("val");
debugPrintln("current price = " + vValue);
return null;
}
when the above 2 codes are attached to each chart in each different page workspace, with chart 2 active to see the print output, i do not see the "chart 1" price update in real-time. I am making a mistake somewhere but cant work it out.
Any help would be very much appreciated.
Regards
Rod
Comment