user_123:
Dear Community,
is there a possibilty to set the Index Buffer in a for loop? Something like this:
Unfortunately, the code will not compile. Do I really need to write everything individually?
Thank you for your help
Yes it's possible but not this way. You have to use an array, but as a buffer as already an array and SetIndexBuffer doesn't allow multidimensional array :
struct Buffer { double buffer[]; }; Buffer indi[40]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping for(int i=1;i<40;i++){ SetIndexBuffer(i,indi[i].buffer); } //... }
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
Dear Community,
is there a possibilty to set the Index Buffer in a for loop? Something like this:
Unfortunately, the code will not compile. Do I really need to write everything individually?
Thank you for your help