Cleveland, Ohio
Posts: 6 since Aug 2011
Thanks Given: 4
Thanks Received: 1
|

// Sending code.
// All these Globals demos are Indicators sample code.
// MultiCharts sent me the GlobalVariable.dll which is placed in the same directory the MultiCharts.exe is in. Most likely it is C:\Program Files\TS Support\MultiCharts
// This is the Sending of the array data part. How to pass Global array data below.
Arrays:Arr_InitialData[50](0);// Declare array size 51 for array[0-50]. Arrays start with 0 and declared 50 is the max array number.
Vars:x(0);// Declare For loop variable is x starting with value 0.
Forx=0to50begin
Arr_InitialData[50]=x;// I am loading the array with numbers from 0 to 50.
// This creates global variables from "G_Arr0" to "G_Arr50" to pass the data globally.
// Yes the global variable is not an array but by creating 51 unique global variable names the data can be passed.
save_global_data(symbolname,ADE.BarInterval,ADE.BarID,"G_Arr"+numtostr(x,0),Arr_InitialData[x]);
// ADE.BarInterval is for 15 minutes = 15, note: 15 seconds is also 15.
end;
// This is the Sending of the array data part. How to pass Global array data above.
//-------------------------------------
// Receiving code.
// All these Globals demos are Indicators sample code.
// MultiCharts sent me the GlobalVariable.dll which is placed in the same directory the MultiCharts.exe is in. Most likely it is C:\Program Files\TS Support\MultiCharts
// This is the Receiving part of the array data. How to Receive Global array data below.
Arrays:Arr_ReceiveData[50](0);// Declare array size 51 for array[0-50]. Arrays start with 0 and declared 50 is the max array number.
Vars:x1(0);// Declare For loop variable is x starting with value 0.
Forx1=0to50begin
// This creates global variables from "G_Arr0" to "G_Arr50" to Receive the data globally.
// Yes the global variable is not an array but by creating 51 unique global variable names the data can be passed and received.
load_global_data(symbolname,ADE.BarInterval,ADE.BarID,"G_Arr"+numtostr(x1,0),Arr_ReceiveData[x1]);// ADE.BarInterval is for 15 minutes = 15, note: 15 seconds is also 15.
//load_global_data(symbolname, 15, ADE.BarID, "G_Arr" + numtostr(x1, 0), Arr_ReceiveData[x1]);
//load_global_data commented needs to have the sending bar time, so if this chart is 5 minutes and the sending chart is 15 you need to use the commented above one.
// ADE.BarInterval is for 15 minutes = 15, note: 15 seconds is also 15.
// One strange thing about globals is when sending from one graph to two other graphs. If you want two graphs to received array data create a second unique variable name for teh 2nd receiving graph..
end;
// This is the Receiving part of the array data. How to Receive Global array data above.
|