Nothing is returned when I use the above code, and I am unsure why. Can anyone assist?
Hi Raptor,
Apologies for not being more specific. I would like to return a subchart that would display 1 or 0 at each data point along the chart based on the logical argument previously specified. The actual look of the chart is not really important, line or histogram. I just need to be able to see visually if the argument is true or not as I am moving through the chart.
Hi Raptor,
Apologies for not being more specific. I would like to return a subchart that would display 1 or 0 at each data point along the chart based on the logical argument previously specified. The actual look of the chart is not really important, line or histogram. I just need to be able to see visually if the argument is true or not as I am moving through the chart.
Hi Raptor,
Thanks, problem is now sorted. It has taken a bit of time to get my head around the buffers, but now I think I have it, and my code is working:
#property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 White double B1; double B2; double B3[]; int init() { SetIndexBuffer(0,B3); SetIndexStyle(0,DRAW_HISTOGRAM,0,0,0); return(0); } int start() { int counted_bars=IndicatorCounted(); double SCORE; for(int i=0;i<Bars;i++) { B1=iCCI(0,0,14,PRICE_TYPICAL,i); // Current level of CCI B2=iCCI(0,0,14,PRICE_TYPICAL,i-1); // Level of CCI 1 period ago if (B1 > B2) { SCORE=1; } else { SCORE=0; } B3[i]=SCORE; } return(0); }

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
I am trying to create a simple binary indicator, that returns value 1 when an argument is true, and 0 when the argument is false. For example:
Nothing is returned when I use the above code, and I am unsure why. Can anyone assist?