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 8,499 views
    2. thumb_up 2 thanks given
    3. group 6 followers
    1. forum 6 posts
    2. attach_file 3 attachments




 
 

Two dimensional array in EasyLanguage

(login for full post details)
 
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,233 since Jun 2009
Thanks Given: 33,105
Thanks Received: 101,350

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


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread

Can you help answer these questions
from other members on NexusFi?
Request for MACD with option to use different MAs for fa …
NinjaTrader
News alerts
Traders Hideout
Trader Dale [email protected] or Scammer Dale
Trading Reviews and Vendors
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Searching for CurrentMonthOHL Indicator
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Tao te Trade: way of the WLD
37 thanks
Deaddogs Stock Trading
27 thanks
GFIs1 1 DAX trade per day journal
26 thanks
Supertradersams Thread Journal on NQ/MNQ
24 thanks
Leaving CFD trading and learning futures
11 thanks

(login for full post details)
 
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 623 since Jan 2010
Thanks Given: 351
Thanks Received: 1,123


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
Register to download File Type: zip ELC Setup.exe.zip (463.0 KB, 53 views)
The following user says Thank You to aslan for this post:
(login for full post details)
 
 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:443/wiki/display/EasyLanguage/Understanding+Arrays

phil

(login for full post details)
 
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,233 since Jun 2009
Thanks Given: 33,105
Thanks Received: 101,350



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


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread
(login for full post details)
 
 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  
(login for full post details)
 
 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+value11]=Close;

// increment volume
VolAtPrice[500+value12]=VolAtPrice[500+value12]+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 Twitter
The following user says Thank You to MooreTech for this post:

 




Last Updated on August 17, 2010


© 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