for(int j=0; j<2; j++) {ma[0,j]=mah_buf[i]; ma[1,j]=mal_buf[i]; ma[2,j]=uf_buf[i]; ma[3,j]=lf_buf[i]; //Everyting appears to work fine up to this point. }
should be:
for(int j=0; j<2; j++) {ma[0,j]=mah_buf[i+j]; ma[1,j]=mal_buf[i+j]; ma[2,j]=uf_buf[i+j]; ma[3,j]=lf_buf[i+j]; //Everyting appears to work fine up to this point. }
ma[x,0] is always equal ma[x,1] so idf will be 0 all the time.
But i don't see the point why you use this additional 2 dimensional array...
//z
damn yes that isnt going to work that way is it, i was trying to put the values of the 4 lines current and previous values in an array to make it easy to compare them I probably should have just done it like this in the first place.
if(mah_buf[i]>mah_buf[i+1]) idf++; if(mah_buf[i]<mah_buf[i+1]) idf--; if(mal_buf[i]>mah_buf[i+1]) idf++; if(mal_buf[i]<mal_buf[i+1]) idf--; if(uf_buf[i]>uf_buf[i+1]) idf++; if(uf_buf[i]<uf_buf[i+1]) idf--; if(lf_buf[i]>lf_buf[i+1]) idf++; if(lf_buf[i]<lf_buf[i+1]) idf--;
Yeah arrays are only useful if you have a large dataset.
btw, i just saw that you use the two dimensional array totally wrong should be like:
ma[1][j] =#someNumber
//z
Yeah arrays are only useful if you have a large dataset.
btw, i just saw that you use the two dimensional array totally wrong should be like:
//z
oh ok yeah i see what your saying ... i was trying to get the line values from the buffer and into the array as the buffer was filled, then i was going to draw a 3 colored histogram to show direction, up down or indeterminate .. i didnt think it through properly, im going to redo that part of it
Yeah arrays are only useful if you have a large dataset.
btw, i just saw that you use the two dimensional array totally wrong should be like:
ma[1][j] =#someNumber

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Can anyone see why the first alert is returning zero every time ? I wanted it to compare the buffers current and previous values and therefore the Alert should return a varying result of either 0, 1 or 2 depending if the direction is up down or mixed but it isnt working that way