Using ArrayFree sets the array size to zero, so of course you get the "array out of range" error.
Ok but how do I fix it?
Any help on the other questions?
double arrayBBLOW[5]; static datetime bar_time=0; if(Time[current]!=bar_time) { bar_time=Time[current]; for(int x=0;x<5;x++) { arrayBBLOW[x]=iBands(NULL,0,20,2.5,0,PRICE_CLOSE,2,current+1+x); } if(Close[current+1]<arrayBBLOW[0] && Close[current+2]<arrayBBLOW[1]) { //Do stuff } }This may give you some pointers
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have tried the search function but I dont know how to word it.
I want to load the previous 5 bars into an array for calculations later on in the program. I have the below so far but it does not work. So the data should be collected at the start of the new bar. These arrays have sent my head into a spin, when I hit debug it keeps saying array out of range.
If I get this working how do I then compare the data values loaded. ie Price closed outside of the bollinger bands?