Now that I have a little time, I can post a few examples from code I wrote.
Global variable sender indicator:
if LastbaronChart then Begin
dummy = GVSetinteger(1, data);
end;
this sets integer global variable 1 to the integer stored in the variable data.
Global variable receiver indicator:
dummy = GVgetinteger(1);
if LastbaronChart then Begin
Plot1( dummy, "Plot1" ) ;
end;
this sets variable dummy to what was stored in global integer variable 1 in the sender indicator on a different chart.
The key for this is you have to use lastbaronchart since this as written will only work real time. It takes a lot more code to make GVs backtestable.
I am using this exact same technique in a strategy I have automated. One sender chart sends an integer to a receiver chart of a different interval.
All data everywhere (ADE)
Now for the hard stuff. ADE allows you to backtest easily but requires a little more than GVs.
ADE sender:
If ( Chart=1 ) then name="data1";
If ( Chart=2 ) then name="data2";
If ( Chart=1 ) then data=data1;
If ( Chart=2 ) then data=data2;
dummy = infomapdummy.Put(InfoMap, name, data);
{assorted DLL code I wont repeat}
ADE receiver:
{DLL code to define the different intervals from two sender charts}
data1 = infomapdummy.get(infomap,"data1");
data2 = infomapdummy.get(infomap,"data2");
I have this working where two sender charts of different intervals and symbols send data to a receiver chart. The backtesting works. Haven't finished the testing to automate though...