How to plot this histogram above zeroline

#1
hi friends
need a small trick to plot histogram bars above zeroline.
HTML:
_SECTION_BEGIN("OSCP");
SetChartBkColor(64);
r1 = Param( "Fast avg", 9, 2, 200, 1 );
r2 = Param( "Slow avg", 18, 2, 200, 1 );
BARCOLOR =IIf(OscP( r1,r2)>0,colorGreen,IIf(OscP( r1,r2)<0,colorRed,Null));
Plot( OscP( r1,r2), _DEFAULT_NAME(), BARCOLOR, styleHistogram );

_SECTION_END();
This code plots above & below zeroline.
I need it to plot above zeroline.
any hints please!
regards
 

asnavale

Well-Known Member
#2
hi friends
need a small trick to plot histogram bars above zeroline.
HTML:
_SECTION_BEGIN("OSCP");
SetChartBkColor(64);
r1 = Param( "Fast avg", 9, 2, 200, 1 );
r2 = Param( "Slow avg", 18, 2, 200, 1 );
BARCOLOR =IIf(OscP( r1,r2)>0,colorGreen,IIf(OscP( r1,r2)<0,colorRed,Null));
Plot( OscP( r1,r2), _DEFAULT_NAME(), BARCOLOR, styleHistogram );

_SECTION_END();
This code plots above & below zeroline.
I need it to plot above zeroline.
any hints please!
regards

**********************

Hi Ford,

Is this what you want shown in the image below? The upper portion is what your code plots. The bottom part is the modified chart with all of histogram starting from Zero line.



-Anant
 
#3
Hi asnavalejee

Thanks. It is exactly what i wanted as shown in bottom plot.
please give the code line for doing it.

I wanted it mainly to plot it that way as step1 to make waddah attar explosion
mt4 code.
regards
ford
 

sr114

Well-Known Member
#4
hi friends
need a small trick to plot histogram bars above zeroline.
HTML:
_SECTION_BEGIN("OSCP");
SetChartBkColor(64);
r1 = Param( "Fast avg", 9, 2, 200, 1 );
r2 = Param( "Slow avg", 18, 2, 200, 1 );
BARCOLOR =IIf(OscP( r1,r2)>0,colorGreen,IIf(OscP( r1,r2)<0,colorRed,Null));
Plot( OscP( r1,r2), _DEFAULT_NAME(), BARCOLOR, styleHistogram );

_SECTION_END();
This code plots above & below zeroline.
I need it to plot above zeroline.
any hints please!
regards
use the absolute val of the osc to get the histogram above zero always

e.g. - abs(osc) and u will get it.

use this code line to get it right

Plot( abs(OscP( r1,r2)), _DEFAULT_NAME(), BARCOLOR, styleHistogram );

rgds
subroto
 
#5
Hi subroto jee

Thank you for the hint and codeline.
you have that proactive nature-a Blessing from God.
Thank God & Thank you!

MACD histogram bars have a deadzone and when bar explodes beyond that zone,good trade entries happen-as shown in waddah attar explosion-mt4 code.
best regards
ford
 

Similar threads