@sr.... pls try this.... i hope this is what u r searching for....
> > _SECTION_BEGIN("HA Delta");
> > /////////////////////////////////////////////////////////////////////////////
> > //
> > // Heikin Ashi Delta Indicator - Calculated Properly with no use of AMA
> > //
> > //
> > // I believe it is the same as proposed on
www.educofin.com
> > //
> > // I have some new ideas that worth the test:
> > // Use EMA() instead of MA() for intraday or faster markets
> > // Use Histogram Increase / Decrease for the same thing
> > //
> > // I would only use this indicator with a confirmation.
> > //
> > // It means that after a crossover (or a Histogram increase/decrease) the
> > price most go Higher than the crossover High to buy/go long.
> > //
> > // Or, the price most lower than the crossover low to sell/go short.
> > //
> > //
> > // Using confirmation as described above, the Histogram Increase/Decrease
> > seams better to trade intraday futures than the crossovers when using SMAs.
> > //
> > //
> > //
> > // JF Derzi, December 2012
> > //
> > //
> >
> > HaClose[0] = (Open[0]+High[0]+Low[0]+Close[0]) / 4;
> > HaOpen[0] = (HaClose[0] + Open[0]) / 2; // Here is the problem when using
> > Arrays: Haopen always uses its previous value
> > HaHigh[0] = Max( High[0], Max( HaClose[0], HaOpen[0] ) );
> > HaLow[0] = Min( Low[0], Min( HaClose[0], HaOpen[0] ) );
> >
> > for (i=1; i<BarCount; i++)
> > {
> > HaClose
= (Open+High+Low+Close) / 4;
> > Haopen = (HaClose[i-1] + HaOpen[i-1]) / 2; // Here is the problem when
> > using Arrays: Haopen always uses its previous value
> > HaHigh = Max( High, Max( HaClose, HaOpen ) );
> > Halow = Min( Low, Min( HaClose, HaOpen ) );
> > }
> >
> > if ( ParamToggle("Indicator", "Altered (EMA)|Classic (SMA)", 1) )
> > {
> > HADelta_Line = MA( HaClose - HaOpen, Param("haDelta Line SMA Periods", 3,
> > 1, 10) );
> > HADelta_Signal = MA( HaDelta_Line, Param("haDelta Signal SMA Periods", 3,
> > 3, 20) );
> > }
> > else
> > {
> > HADelta_Line = EMA( HaClose - HaOpen, Param("haDelta Line EMA Periods",
> > 3, 1, 10) );
> > HADelta_Signal = EMA( HaDelta_Line, Param("haDelta Signal EMA Periods", 3,
> > 3, 20) );
> > }
> >
> > HaDelta_Histogram = HaDelta_Line - HaDelta_Signal;
> > Plot( HaDelta_Line, "HaDelta_Line" , ParamColor("haDelta Line color",
> > colorRed ), ParamStyle("haDelta Line style") );
> > Plot( haDelta_Signal, "HaDelta_Signal", ParamColor("haDelta Signal color",
> > colorBlue ), ParamStyle("haDelta style") );
> >
> > if ( ParamToggle("Plot HaDelta CrossOvers", "No|Plot", 1) )
> > {
> > PlotShapes(shapeUpArrow * Cross(HaDelta_Line, HaDelta_Signal), colorYellow);
> > PlotShapes(shapeDownArrow * Cross(HaDelta_Signal, HaDelta_Line),
> > colorYellow);
> > }
> >
> > if ( ParamToggle("Show Histogram", "Hide|Show", 0) )
> > {
> > Plot( HaDelta_Histogram, "Histogram", ParamColor("Histogram color",
> > colorDefault ), styleNoTitle | ParamStyle("Histogram style", styleHistogram
> > | styleNoLabel, maskHistogram ) );
> > }
> >
> > if ( ParamToggle("Plot Histogram Increase/Decrease","No|Plot", 0) )
> > {
> > HaDelta_Delta=IIf(HaDelta_Histogram>Ref(HaDelta_Histogram, -1), 1, -1);
> > PlotShapes(shapeSmallUpTriangle * IIf(HaDelta_Delta>Ref(HaDelta_Delta,
> > -1), 1, 0), colorYellow);
> > PlotShapes(shapeSmallDownTriangle * IIf(HaDelta_Delta<Ref(HaDelta_Delta,
> > -1), 1, 0), colorYellow);
> > }
> >
> > _SECTION_END();
> >