Change histogram code to "small height bars" (like a tape)

 

How do I have to change below code of that histogram code in order to be able to drag n drop that indicator into an existing cci indicator window? When I do it now it shows:


It should be like the above sidewinder indicator at top (yellow, green, red), only a small "line". (shown at bottom of cci, around 300 line)

Thank you


#property copyright "Copyright © 2007"
#property link      "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_minimum -0.05
#property indicator_maximum 1.05
#property indicator_buffers 7
#property indicator_color1 Aqua
#property indicator_color2 LawnGreen
#property indicator_color3 LimeGreen
#property indicator_color4 Yellow
#property indicator_color5 SaddleBrown
#property indicator_color6 OrangeRed
#property indicator_color7 Orange
#property indicator_width1 3
#property indicator_width2 3
#property indicator_width3 3
#property indicator_width4 3
#property indicator_width5 3
#property indicator_width6 3
#property indicator_width7 3


//---- input parameters
extern int     NumBars     = 1000; 

//---- buffers

double UpBuffer1[];
double UpBuffer2[];
double UpBuffer3[];
double UpBuffer4[];

double DnBuffer1[];
double DnBuffer2[];
double DnBuffer3[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   
//---- 
   SetIndexStyle(0,DRAW_HISTOGRAM,0,3,Aqua);
   SetIndexStyle(1,DRAW_HISTOGRAM,0,3,LawnGreen);
   SetIndexStyle(2,DRAW_HISTOGRAM,0,3,LimeGreen);
   SetIndexStyle(3,DRAW_HISTOGRAM,0,3,Yellow);
   
   SetIndexStyle(4,DRAW_HISTOGRAM,0,3,SaddleBrown);
   SetIndexStyle(5,DRAW_HISTOGRAM,0,3,OrangeRed);
   SetIndexStyle(6,DRAW_HISTOGRAM,0,3,Orange);
  
   
   SetIndexBuffer(0,UpBuffer1);
   SetIndexBuffer(1,UpBuffer2);
   SetIndexBuffer(2,UpBuffer3);
   SetIndexBuffer(3,UpBuffer4);
   
   SetIndexBuffer(4,DnBuffer1);
   SetIndexBuffer(5,DnBuffer2);
   SetIndexBuffer(6,DnBuffer3);
   
//---- 
   IndicatorShortName("CZI");   

   SetIndexLabel(0,"Strong UpTrend / ZLR long OK");
   SetIndexLabel(1,"Retrace UpTrend");   
   SetIndexLabel(2,"Choppy UpTrend");
   SetIndexLabel(3,"Flat Trend");
   
   SetIndexLabel(4,"Strong DownTrend / ZLR short OK");
   SetIndexLabel(5,"Retrace DownTrend");   
   SetIndexLabel(6,"Choppy DownTrend");
//----
   
....
....
....
 
Jagg:

How do I have to change below code of that histogram code in order to be able to drag n drop that indicator into an existing cci indicator window? When I do it now it shows:

It should be like the above sidewinder indicator at top (yellow, green, red), only a small "line". (shown at bottom of cci, around 300 line)

Thank you

Hi Jagg,

1. You have to attach the histogram first and the the CCI later. That way you will have CCI above the histogram.

2. Why don't you experimenting by changing the value of these two ...

#property indicator_minimum -0.05
#property indicator_maximum 1.05

Change the max value to bigger than 1.05 (for example 5 or 10) and change the min value to smaller than -0.05 (for example -5 or -10). However if you don't like it, we just have to change the histogram into the arrow :(.

:D

 

Oh that simple ;). Changed the min/max to -15/15 and dragged it in, looking good as for the size. Only problem left is now it's shown on the zeroline.

How can I bring it down (near the ~300 line of the cci)?


 
Jagg:

Oh that simple ;). Changed the min/max to -15/15 and dragged it in, looking good as for the size. Only problem left is now it's shown on the zeroline.

How can I bring it down (near the ~300 line of the cci)?

That's the problem Jagg, histogram is drawn from zero.

How about min = -0.05 and max = 15 ?, the value doesn't have to be the same, you know, just play with it ;) .

:D

 

min = 0, max = 35 did it, perfect! Thanks!!!


 
Jagg:

min = 0, max = 35 did it, perfect! Thanks!!!

Hi Jagg,

You can also change the max min value from common tab on indicator property window.

Whatever it is, lets play it again, shall we ?. Add this ...

//---- input parameters
extern double  Histogram_Value = 1.75;
extern int     NumBars         = 1000; 

Then change all of assigned value to buffer from 1 to Histogram_Value. Leave assigned value 0 alone though. Can you do it ?