| Coding Forum Collaborate, receive help, or discuss coding related issues. |
![]() | | Tweet | |
| | #25 | ||
![]() | Re: Array (EasyLanguage) Quote:
I'm trying to build a Volume profile so it's a 2 dimensional array. First dimension unlimited and unknown is the range of each day (High of the day - Low of the day) * price scale (or tick scale as you want) Second dimensional array the volume of each level price (unknown ) So the final array is an array of the 2 first arrays each one unlimited. The final array I think is a 2 dimensional array. Is it possible ??? Or I must use ADE and maps collections ? Thanks again CrazyNasdaq | ||
| |
|
| | #26 | ||
![]() | Re: Array (EasyLanguage) Quote:
...call it whatever you will, you should draw out the data dependencies on a grid... and see how each piece of data relate to each other. Quote:
don't know, never tried it. if you write out your thoughts in a step-by-step pseudo code, e.g. one action per-line, one-line per-action, you might be able to work out the code logics.
__________________ ..........This is a terribly difficult question to answer. The only satisfactory answer is: "It depends"... Last edited by Tams; 10-26-2009 at 06:25 PM. | ||
| |
|
| | #27 | ||
![]() | Re: Array (EasyLanguage) Quote:
Maybe if I post my thoughts and my codes you or someone else could help me doing that and we can achieve a code on an indicator that many would like to have. Thanks again for your time CrazyNasdaq | ||
| |
|
| | #28 | ||
![]() | Re: Array (EasyLanguage) Quote:
before you start running, I would suggest you to learn to walk... (I am famous for helping people to go from step 1 to step 2, but absolutely refuse to assist anyone to skip from step zero to step 3) go through post #1 (which I know you haven't yet)... and the tutorial in post #2, then digest post #5 make a few exercises... array is about data manipulation, you have to be comfortable with a 2 dimensional array before you can work on a 3-D, because a 3-D is exponentially more complex in structure and data tracking.
__________________ ..........This is a terribly difficult question to answer. The only satisfactory answer is: "It depends"... | ||
| |
|
| | #29 | ||
![]() | Re: Array (EasyLanguage) you do not need a 2 or 3d array for this. a programming friend of mine did this in Visual Basic and used a 1-dimensional dynamic array. Here were the steps: 1) set up the basic array structure: if 'this bar' is first bar of a new day (date>date[1]), clear out array and set counter variables to zero if not a new day, then expand the existing array (the one created if the first if statement was true) to add new data, while preserving the existing array I believe you do this using the EL syntax Array_SetMaxIndex(ArrayNa me, #Elements) 2) populate array. something like this: barrange1 = ((high - Low) / 0.25)+1; x=0 For Counter1 = 0 to barrange1 begin bars1[x] = low +(0.25 * Counter1); x=x+1 end; note that the variable x is going to keep track of total elements in the array the part I don't understand is how often you have to re-set the size of the array and/or preserve the array so it doesn't lose data elements within the array. the code I write invariably is out of bounds of the array or some syntax just isn't right. its damn hard to find supporting documentation on EL. | ||
| |
|
| | #30 | ||
![]() | Re: Array (EasyLanguage) Quote:
I've read again the posts in the first page and the tutorial (post #2). Here is my way of doing it: 1) use a 1 tick chart with volume set to Trade volume and NOT tick count. ************************* ************ 2) identify the range of each day (past and real time) and reset it each new day: if date > Date[1] then begin OpenDay = open; HighDay = High; LowDay = low; CloseDay = close; end; If Date = date[1] then begin If high > HighDay then HighDay = High; If Low < LowDay then LowDay = Low; if time >= Sess1endtime then CloseDay = close; If time < Sess1endtime and lastbaronchart then CloseDay = close; end; RangeDay = HighDay - LowDay; ************************* ********************* 3) Identify the numbers of rows for each price of the day range : TickScale = minmove/priceScale; NRows = RangeDay * (1/TickScale); ************************* ********************* 4) Define the Array (1d dinamic array) regards volume: MyVol = iff(bartype < 2, Upticks + Downticks, volume); Array: MATRXIVoL[](0); iVolume = MyVol; iPrice = AvgPrice; if date > date[1] then begin Array_SetMaxIndex(MATRIX, NRows); // resize the array each day MATRIXVoL[iVolume] = 0; // rest to zero each day END; ************************* ********************** 5) Populate the Array for the past days and for the real time day if Date = Date[1] then begin fro iPrice = 0 to (NRows-1) begin MATRIXVoL[iVolume] = MyVol ; END; If AvgPrice = iPrice then begin MATRIXVoL[iVolume] = MATRIXVoL[iVolume] + MyVol; END; ************************* *********************** These are my steps, but as a newbie about arrays, I'm not so sure about step #5, specially the last part {if AvgPrice = iPrice then begin ......ecc.....} Then an other problem is: If this way is correct a functional, how can I draw the Volume profile ?? Thanks again TAMS for your patience and your time. P.S. I have some ideas about the plotting and using ADE about this Volume profile, but it would be better to talk about it in private and then posting the final work. If You want TAMS, write me in PVT to my TL private account. Last edited by Crazynasdaq; 10-27-2009 at 06:47 AM. | ||
| |
|
| | #31 | ||
![]() | Re: Array (EasyLanguage) Quote:
"for iPrice = 0 to (NRows-1) begin....... " is not the right way iPrice can't be = 0 at least it can be : for iPrice = HighDay downto LowDay begin MatrixVoL[iVolume] = MyVol; END; Or another way (I don't know if the syntax is correct): for iPrice = HighDay downto (HighDay - TickScale)=LowDay begin MatrixVoL[iVolume] = MyVol; END; This step is the most difficult !!! Last edited by Crazynasdaq; 10-27-2009 at 10:40 AM. | ||
| |
|
| | #32 | ||
![]() | Re: Array (EasyLanguage) Quote:
iPrice is the counter the loop would only makes sense if you use the counter to cycle the instructions inside the loop. e.g. for iPrice = HighDay downto LowDay begin MatrixVoL[iPrice] = MyVol(iPrice); END; p.s. I have not studied your code or logic, the above example is for LOOP illustration only, not a correction to your logics. more on For loop can be found here: FOR (EasyLanguage) http://www.traderslaboratory.com/for...uage-7074.html
__________________ ..........This is a terribly difficult question to answer. The only satisfactory answer is: "It depends"... | ||
| |
|
| The Following User Says Thank You to Tams For This Useful Post: | ||
Crazynasdaq (10-31-2009) | ||
![]() |
| Tags |
| array, easylanguage |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Buy at Open with Easylanguage | cleon | Coding Forum | 5 | 03-02-2011 12:16 PM |
| Antonio: Please help me on MP for easylanguage | nasdaq5048 | Market Profile | 13 | 09-23-2010 10:50 AM |
| Can function in TS8 return array? | ImXotep | Technical Analysis | 5 | 05-25-2009 03:13 AM |
| MT4 Indicator Array Problem. | ForexSurfr | Coding Forum | 0 | 02-16-2009 01:19 PM |
| Some EasyLanguage Help Please | jjthetrader | Coding Forum | 8 | 06-02-2008 05:20 PM |