Pls Help guys

#1
Hi guys,
I want an afl to draw a histogram,
Where the moving average is the zero line and it should be subtracted from the close.
I.e if the close is higher than MA then it will be plotted above the zero line an if close is below the MA it will be plotted below the zero line.
This is code for MA
n = Param("Length",14,2,200,1,1);
Plot(MA(C,n),"CMA",ParamColor("color",colorcycle),ParamStyle("style"),0,0,-(n-1)/2);
Pls Help.:)
 

sr114

Well-Known Member
#3
Hi guys,
I want an afl to draw a histogram,
Where the moving average is the zero line and it should be subtracted from the close.
I.e if the close is higher than MA then it will be plotted above the zero line an if close is below the MA it will be plotted below the zero line.
This is code for MA
n = Param("Length",14,2,200,1,1);
Plot(MA(C,n),"CMA",ParamColor("color",colorcycle),ParamStyle("style"),0,0,-(n-1)/2);
Pls Help.:)
See the code whether serve ur purpose

Code:
n = Param("Length",14,2,200,1,1);
x1=MA(c,n);
xx=iif(C > x1,1,-1);
Plot(xx,"CMA",IIf(C>x1, ParamColor("Up Color",colorpaleGreen ), ParamColor("Down Color",colororange)), styleHistogram);
rgds