# NEED A SMALL HELP TO EDIT THIS AFL

#### gopan7805

##### New Member
FOLLOWING AFL I NEED TO WATCH IN HISTOGRAM STYLE(CURRENTLY IN LINE STYLE)...SOMEONE PLZ HELP ME TO EDIT THIS AFL.THANKS IN ADVANCE

_SECTION_BEGIN("Formula 43");
// Piecewise EMA is an EMA that restarts calculations each time
// the 'sincebar' argument is true
function PiecewiseEMA( array, range, sincebar )
{
factor = IIf( sincebar, 1, 2/(range+1) );
return AMA2( array, factor, 1-factor );
}
// parameters
m=4;
n=250;
// generate reversal signals based on EMA crossover rule
Lpf1 = EMA( C, 7 );
Lpf2 = EMA( C, 15 );
CrossPoint = Cross( Lpf1, Lpf2 ) OR Cross( Lpf2, Lpf1 );
// variable bar sum
DC = Close - Ref( Close, -1 );
CPC = Sum( DC, Periods );
// smooth CPC by piecewise 4 bar EMA
Trend = PiecewiseEMA( CPC, 4, CrossPoint );
// noise
DT = CPC - Trend;
Noise = 2 * sqrt( MA( DT^2, n ) );
// alternative 'linear' noise calculation
// Noise = 2 * MA( abs( DT ), n ) );
QIndicator = Trend/Noise;
//Plot(sign(Lpf1-Lpf2), "Rev", colorRed );

Plot( Qindicator, "Qindicator",IIf(Qindicator > 2,colorGreen, IIf(Qindicator < -2,colorRed, IIf(Qindicator > -2, colorBlack AND Qindicator < 2, colorBlack))));
PlotGrid( -1 );
PlotGrid( 1);
PlotGrid( 2,colorwhite );
PlotGrid( -2,colorwhite );
PlotGrid( 5 );
PlotGrid( 5);
_SECTION_END();