Download MetaTrader 5
To add comments, please log in or register
Publish your task in Freelance service and developers will execute your order.
Carl Schreiber
5927
Carl Schreiber 2014.10.12 18:38 

Hi

I am experimenting with the good old CCI and enabled to see its 'hidden' buffers in the MarketWatch:

#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 LightSeaGreen
#property indicator_color2 clrNONE
#property indicator_color3 clrNONE
#property indicator_color4 clrNONE
...

int init(){

   string short_name;
   IndicatorBuffers(4);
   IndicatorDigits(1);
   SetIndexBuffer(1, RelBuffer);
   SetIndexBuffer(2, DevBuffer);
   SetIndexBuffer(3, MovBuffer);
   SetIndexStyle(1, DRAW_NONE);
   SetIndexStyle(2, DRAW_NONE);
   SetIndexStyle(3, DRAW_NONE);
   SetIndexLabel(1, "Rel");
   SetIndexLabel(2, "Devi");
   SetIndexLabel(3, "sma");

//---- indicator lines
   SetIndexStyle(0, DRAW_LINE);
   SetIndexBuffer(0, CCIBuffer);
//----
   if(CCIPeriod <= 0)
       CCIPeriod = 14;
//----
   SetIndexDrawBegin(0, CCIPeriod+1);
  
//---- name for DataWindow and indicator subwindow label
   short_name="CCI(" + CCIPeriod + ")";
   IndicatorShortName(short_name);
   SetIndexLabel(0, short_name);
   SetLevelValue(0,0.0);
   SetLevelValue(1,100.0);
   SetLevelValue(2,-100.0);

//----
   return(0);
}
// everything else is the standard CCI.

Now I see the CCI-chart window (for Gold) ranges from 1301.5 to -410?

I would expect a range between +500 and -500:


Is this a feature or a bug?

(The arrows on the chart are from s.th. else!)

Halley
198
Halley 2014.10.13 00:43  
gooly:

Hi

I am experimenting with the good old CCI and enabled to see its 'hidden' buffers in the MarketWatch:

Now I see the CCI-chart window (for Gold) ranges from 1301.5 to -410?

I would expect a range between +500 and -500:


Is this a feature or a bug?

(The arrows on the chart are from s.th. else!)


It is correct behaviour. It scales the y-axis to fit all the buffers, regardless the display style.
Carl Schreiber
5927
Carl Schreiber 2014.10.13 08:01  

hmm - correct behaviour? It is the simplest way for the programmer but for me as a user it is annoying.

In addition if put two different indicators in the same separate window like two rsi with a different length it can happen that the faster is painted above the slower but the values of the faster is smaller than the slower!!

Is this a correct behaviour too?

/
To add comments, please log in or register