Indicator buffers are dynamic arrays managed by terminal. You should not use statically allocated ones on your own.
Roberto Gentili:
I would like to use an array of arrays as in the following code
... But I get the error "invalid array access": how can I fix it?If you want to use an array of arrays as index buffers in an indicator, you may use IndBufArray.mqh from the algotrading book (look into the section describing "IndUnityPercent" indicator).
MQL5 Book: Creating application programs / Creating custom indicators / Multicurrency and multitimeframe indicators
- www.mql5.com
Until now, we have considered indicators that work with quotes or ticks of the current chart symbol. However, sometimes it is necessary to analyze...
SetIndexBuffer is not used that way, and doesn't support two-dimensional arrays
these kind of arrays are used to store values in rows and columns
double data[2][2]; int OnInit() { //--- data[0][0] = 1.1; data[0][1] = 1.2; data[1][0] = 2.1; data[1][1] = 2.2; Print("This array value: ", data[1][0]); //--- return(INIT_SUCCEEDED); }
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 would like to use an array of arrays as in the following code
... But I get the error "invalid array access": how can I fix it?