Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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).
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?
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.
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...
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.