how can i plot HPI graph as bar graph

#1
HI All,

i am currently using HPI signal along with my other signals,
the formula i am using is as below:
Code:
_SECTION_BEGIN("HPI");
function HPI( MultFactor, PercentMove )
{
 M = ( H + L ) /2;
 My = Ref( M, -1 );

 I = abs( OpenInt - Ref( OpenInt, -1 ) );
 G = Max( OpenInt, Ref( OpenInt, -1 ) );
 
 K = PercentMove * Volume * ( M - My ) * ( 1  + sign( M - My ) * 2 * I / G );

 //return AMA2( K, MultFactor / 100000, ( 1 - MultFactor ) / 100000 );
 
 return AMA( K, 1/MultFactor )/100000;  	


}

OI = C;

Plot( HPI( 20, 100 ), _DEFAULT_NAME(), ParamColor("Color", ColorCycle ) );
_SECTION_END();
this is currently ploting line graph. is it possible to change it to bar graph.(eg :like oscillator afl)

please help me to get it done

Thanks & Regards,
Ben
 
#3
HI

Thanks for the replay. i have changed like below and it's working perfectly.

Code:
Plot( HPI( 20, 100 ), _DEFAULT_NAME(), ParamColor("Color", ColorCycle ),styleOwnScale | ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram ));
 
#4
HI

is it possible to fill the plot of these two with single color

Code:
DDayO = TimeFrameGetPrice("O", inDaily);// current day open 
DHiDay = TimeFrameGetPrice("H", inDaily); 
DLoDay = TimeFrameGetPrice("L", inDaily); 


Pivot = ParamToggle("Pivot_day", "No|Yes", 1);

if(Pivot)
{
H1= TimeFrameGetPrice("H", inDaily, -1); // yesterdays high
L1 = TimeFrameGetPrice("L", inDaily, -1); // low
C1= TimeFrameGetPrice("C", inDaily, -1); // close
Op = TimeFrameGetPrice("O", inDaily)-1; // current day open

}
else
{
H1 = TimeFrameGetPrice("H", inDaily); // yesterdays high
L1 = TimeFrameGetPrice("L", inDaily); // low
C1= TimeFrameGetPrice("C", inDaily);
Op = TimeFrameGetPrice("O", inDaily); // current day open

}


// PIVOT Calculation
PP = (H1+ L1 +L1 + C1 )/4;
PPA = (H1+ H1 +L1 + C1 )/4;
Plot(PP, "best up",colorBlack,4+8+2048 );
Plot(PPA, "best down",colorBlack,4+8+2048 ); 
//Plot( (H1),"HH",colorBrown,4+8+2048);
//Plot( (L1),"LL",colorAqua,4+8+2048);
_SECTION_END();
//---- pivot points
 

Similar threads