I am trying to access buffers 1 and 2 from the ZigZag Indicator via an indicator I am developing which uses the values stored in those two buffers. I have been using the CopyBuffer function passing as the second parameter the ordinal of the buffer I want to access. I realize when I use 1 or 2 it does not work, i.e. CopyBuffer returns -1, however if I use the ordinal 0 (which I do not need) CopyBuffer returns a result.
Are there any examples of indicators done that I could reference or does anyone know why would this be?
Thanks
sablair
I think your problem is probably because the second and third indicator buffers in the zigzag code are of type "INDICATOR_CALCULATIONS". Suggest changing them to "INDICATOR_DATA", altough that may not be the only change you have to do
SetIndexBuffer(0,ZigzagBuffer,INDICATOR_DATA); SetIndexBuffer(1,HighMapBuffer,INDICATOR_CALCULATIONS); SetIndexBuffer(2,LowMapBuffer,INDICATOR_CALCULATIONS);
Paul
- 2012.06.14
- Paul
- paulsfxrandomwalk.blogspot.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am trying to access buffers 1 and 2 from the ZigZag Indicator via an indicator I am developing which uses the values stored in those two buffers. I have been using the CopyBuffer function passing as the second parameter the ordinal of the buffer I want to access. I realize when I use 1 or 2 it does not work, i.e. CopyBuffer returns -1, however if I use the ordinal 0 (which I do not need) CopyBuffer returns a result.
Are there any examples of indicators done that I could reference or does anyone know why would this be?
Thanks
sablair