NexusFi: Find Your Edge


Home Menu

 





This is how you do Global Arrays.


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one bjschwenzer with 2 posts (1 thanks)
    2. looks_two Jura with 1 posts (1 thanks)
    3. looks_3 LoboTrader with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 6,444 views
    2. thumb_up 2 thanks given
    3. group 1 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

This is how you do Global Arrays.

  #1 (permalink)
bjschwenzer
Cleveland, Ohio
 
Posts: 6 since Aug 2011
Thanks Given: 4
Thanks Received: 1

Could you show how to create a Global array variable?
Also how to read the Global array variable in a different indicator or function.
Thank you

Look at my post below on how to do Global arrays.
Thank you

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
What broker to use for trading palladium futures
Commodities
Quantum physics & Trading dynamics
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
 
  #3 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


I was wondering the same thing today Bjschwenzer- but as far as I know there is no such thing as a Global Array, not in MultiCharts itself and not in the ELCollections or ADE DLL's (according to their documentation).

I hope I'm mistaken since I'd also like to use global arrays.

Regards,
Jura

Reply With Quote
Thanked by:
  #4 (permalink)
bjschwenzer
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.

Reply With Quote
Thanked by:
  #5 (permalink)
 
LoboTrader's Avatar
 LoboTrader 
Karlsruhe, Germany
 
Experience: Advanced
Platform: NinjaTrader & Metatrader
Broker: IB , TaiPan
Trading: Shares & ETF at the US and EU , some MNQ & MES
Posts: 31 since Nov 2011
Thanks Given: 289
Thanks Received: 14

 
Code
load_global_data(......)
save_global_data(....)
Hello

was searching for this code (save/load) but w/o success .

Could somebody give me a hint ?

Thx

Lobo

Do not trade alone
Follow me on Twitter Reply With Quote




Last Updated on January 26, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts