There's two issues with this code which I can't solve. The indicator is supposed to show how many pips away from the open of the day each candle has closed at.
Issues:
1: I can't make historical values be green for positive and red for negative. They all change depending on the current bar's value.
2: The historical data has to be built up one candle at a time in real time. ie the indicator isn't showing historical data. In the pic below you'll see there's no data for the indicator beyond about 30 bars back when I attached it.
As usual it's probably due to some fundamental misunderstandings, however any suggestions or pointers in the right direction would be really appreciated.
http://www.alfasecure.com/images/errors.gif
Issues:
1: I can't make historical values be green for positive and red for negative. They all change depending on the current bar's value.
2: The historical data has to be built up one candle at a time in real time. ie the indicator isn't showing historical data. In the pic below you'll see there's no data for the indicator beyond about 30 bars back when I attached it.
As usual it's probably due to some fundamental misunderstandings, however any suggestions or pointers in the right direction would be really appreciated.
Inserted Code
int i, counted_bars=IndicatorCounted(); i=Bars-counted_bars-1; while(i>=0) { double close = iClose(NULL, 0, 0); double open =iOpen(NULL, PERIOD_D1, 0); double diff =(close-open)/Point; color colour = Lime; if (diff < 0) { colour = Red; } SetIndexStyle(0, DRAW_HISTOGRAM, 0 , 5, colour); ExtMapBuffer1[i] = diff; i--; }
http://www.alfasecure.com/images/errors.gif