Retrieving buffers from Custom Indicators

 

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 

 
sablair   :

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

http://paulsfxrandomwalk.blogspot.com/ 

Regularly emailing the status of an account
  • 2012.06.14
  • Paul
  • paulsfxrandomwalk.blogspot.com
Prompted by a query, I thought I'd post a useful little utility that I have used for ages which emails the status of the account every hour.  After lengthy deliberation I decided to call it .... EmailStatus.  With only a small modification it could be used to log the status to a file, and the time...