Please edit your post and use the code button (Alt + S) to paste your code.
I have moved your post here to the MQL4 and MetaTrader 4 sub-forum. In future, please post in the relevant section.
int velasSinCalcular=rates_total-prev_calculated,i,j; //---- for(i=velasSinCalcular-1; i>=0; i--) { bool y=(Close[i+1]>=iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_UPPER,i+1) && iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_UPPER,i)>=Close[i] && true); Print(i,j); Label0Buffer[i]=High[i]+_Point; }
When i==rates_total-1,i+1=rates_total and this shift does not exist so you will get an Array out or range error.
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
Hi. I'm making a CI which does not work properly. When debugging stops in "bool y=..." line in OnCalculate(). I tested some options for that line and found that instead functions (iBands), variables (Close[]), if I replace for numbers or constants, indicator works. I have to say that Indicator, in debug mode, starts, then JUST ENDS in line mentioned before. No errors, no messages, no warnings. JUST ENDS!!! No array overflow message...
Why is this? I attached code and images showing working and noWorking mode. MetaEditor is ver.5.00 build 2143 13/Sep/2019. MT4 is ver.4.00 build 1220 13/Sep/2019.
Thanks in advance.