- ludo31:You must handle the extra arrays yourself.
I don't know if you understand my problem but sometimes I have the similar problem . I have 8 buffers ExtMapBuffer but the code need to use another array (2 arrays) here tableau1 and tableau2
as you an see how to use the 2 arrays (tableau1 and tableau2) may be the problem is those are not declared as a buffer ( and I can't becaue there are already 8 buffers )double tableau1[]; double tableau2[]; : int start() { if (!ResizeBuffer(tableau1, Bars)) return; if (!ResizeBuffer(tableau2, Bars)) return; : /////////////////////////////////////////////////////////////////////////////// bool ResizeBuffer(double& buffer[], int size){ if (ArraySize(buffer) != size){ ArraySetAsSeries(buffer, false); // Shift values B[2]=B[1]; B[1]=B[0] if (ArrayResize(buffer, size) <= 0){ Alert("ArrayResize [1] failed: ", GetLastError()); return(false); } ArraySetAsSeries(buffer, true); } return(true); }
yes, use more then 8 buffers, you should 1) resize it to allocate its buffer size, 2) set it as series in time order. before use it.
No you cant do dimensional arrays because it is not the amount of arrays that is limited, it is the amount of lines that can be drawn. As SetIndexBuffer(n, buffer)
If you want to use more than 8 drawing buffers to make more than 8 lines you have to make 2 indicators, but if you need extra buffers for calculations such as holding values to be used in iMAOnArray() you then do like WHR said and use regular arrays, with some modificatons so they act like buffers would.
This means to reindex the array every time a new bar starts, so move each value up one index in the array and to resize it accordingly, and to set the array as series.
yes, use more then 8 buffers, you should 1) resize it to allocate its buffer size, 2) set it as series in time order. before use it.
This means to reindex the array every time a new bar starts, so move each value up one index in the array and to resize it accordingly, and to set the array as series.
Resize adds elements to the end. When false you're adding elements to the end, then setting it true the new elements are now at zero - no move necessary.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello ;
I don't know if you understand my problem but sometimes I have the similar problem . I have 8 buffers ExtMapBuffer but the code need to use another array (2 arrays) here tableau1 and tableau2
here i the code (simple)
as you an see how to use the 2 arrays (tableau1 and tableau2) may be the problem is those are not declared as a buffer ( and I can't becaue there are already 8 buffers )
do you have an idea ??
the problem is may be here :
thanks