NexusFi: Find Your Edge


Home Menu

 





Two dimensional array in EasyLanguage


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one philloo with 2 posts (0 thanks)
    2. looks_two Big Mike with 2 posts (0 thanks)
    3. looks_3 aslan with 1 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 10,279 views
    2. thumb_up 2 thanks given
    3. group 6 followers
    1. forum 6 posts
    2. attach_file 3 attachments




 
Search this Thread
  #1 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 R.I.P. 1977-2026 
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,590

I'm having a bit of difficulty getting a two dimensional array to work in EasyLanguage.

Let's say that I want to store the volume at each tick(price) in an array. It seemed logical to me this should be a two dimensional array, one for price, one for the volume count.

8:00:01 AM Price = 84.00, Volume = 12
8:00:02 AM Price = 84.01, Volume = 3
8:00:03 AM Price = 84.00, Volume = 5

I want to be able to have an array with two rows -- 84.00 and 84.01 -- the the column of row 0 would show a total volume of 17 (84.00 12+5) and row 1 would show 3 (84.01 3).

 
Code
                            
Array:IntraBarPersist VolAtPrice[1000,1000](0); 

First note to self -- no way to have a dynamic [] two dimensional array? I guess we'll have to assume 1000 tick increments between High and Low of day are sufficient.

Ok, so now I am thinking about how to insert a value into the two dimensional array, but how am I to track which array index holds the price (Close) I want to insert the volume for?

Some help?

Thx,
Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
EA
Platforms and Indicators
Datafeed for Atas
Platforms and Indicators
Trump Media to sell instant access to market-moving soci …
Traders Hideout
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
No book, only a stair: journaling fills where price move …
Cryptocurrency
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Mes vs MNQ
6 thanks
NexusFi site changelog and issues/problem reporting
5 thanks
BERN ALGOS algo trading journal
3 thanks
Johnnys Journal
2 thanks
TopStep Trader disappointment
2 thanks
  #3 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
Market Wizard
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 624 since Jan 2010
Thanks Given: 356
Thanks Received: 1,129


You might want to look into ELCollections. It is the base of the ADE package for TS. It provides powerful collections that are implemented in C+ DLL, via EL routines. I have used ADE in MC, so the ELC should work fine.

Attached is the latest setup file from the TS wiki and the pdf.

The setup performs the following steps:
1. Places ELCollections.dll in the windows system directory
2. Places the ELCollections ELD files and documentation in a subdirectory of your program files directory
3. Creates program group TradeStation Forum/ELCollections and places shortcuts to the ELD and documentation
4. Automatically launches the TS import wizard for the ELD file

That last one does not make sense for MC.

I am sure there is some info on the MC forums as well.


Attached Thumbnails
Two dimensional array in EasyLanguage-elcollections.pdf  
Attached Files
Elite Membership required to download: ELC Setup.exe.zip
Reply With Quote
Thanked by:
  #4 (permalink)
 philloo 
Canada
 
Experience: Beginner
Platform: Multichart
Posts: 43 since Feb 2010
Thanks Given: 7
Thanks Received: 27

Maybe this link will help you

https://www.tradestation.com/wiki/display/EasyLanguage/Understanding+Arrays

phil


Reply With Quote
  #5 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 R.I.P. 1977-2026 
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,590



Can you cut/paste, I don't have a tradestation account.

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #6 (permalink)
 philloo 
Canada
 
Experience: Beginner
Platform: Multichart
Posts: 43 since Feb 2010
Thanks Given: 7
Thanks Received: 27

If you need related article to that one, just let me know.

phil


Attached Thumbnails
Two dimensional array in EasyLanguage-easylanguage-5680-20100505-14_34_00.pdf  
Reply With Quote
  #7 (permalink)
 MooreTech 
Orlando, Florida
 
Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Trading: ES
Posts: 57 since Aug 2010
Thanks Given: 6
Thanks Received: 73

I realize this thread is a bit dated, but figured I'd throw in my $.02 for what it's worth.

It would be logical to store the information in a two-dimensional array, however in your code you are using the wrong dimensions (1000 X 1000). Since you are only storing price and volume, the dimensions should be (1000 X 2). Therefore you could easily accomplish the same thing with 2 identical single-dimensional arrays (Price[1000] and Volume[1000]).

Single-dimensional arrays can be dynamic. See the reserve word "array_setmaxindex".

To store the values, you could try something similar to the following...

 
Code
                            
Vars:
tick(minmove/pricescale);

Array:
IntraBarPersist VolAtPrice[1000,2](0);

// calculate number of ticks above below prior day close, which is center point (500 element) in array. 
value1=(Close-CloseD(1))/tick;

// store price
VolAtPrice[500+value1, 1]=Close;

// increment volume
VolAtPrice[500+value1, 2]=VolAtPrice[500+value1, 2]+Volume; 
You will have to add in some code that eventually resets VolAtPrice[x,2] back to 0. I'm guessing you would do this on a new date.


Follow me on X Reply With Quote
Thanked by:




Last Updated on August 17, 2010


© 2026 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 - Downloads - Top
no new posts