Afl help

XRAY27

Well-Known Member
#1
hi
following is the code of Heiken Ashi Smoothed... i want just HACLOSE value without displaying normal candle..as shown in the below chart
View attachment 19441
........................................................................................
_SECTION_BEGIN("Heiken Ashi Smoothed");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack),ParamColor("Titleblock",colorLightGrey ));
SetChartOptions(0,chartShowArrows|chartShowDates);
GraphXSpace=5;
p=Param("Period",6,2,30,1);
Om=MA(O,p);
hm=MA(H,p);
lm=MA(L,p);
Cm=MA(C,p);
HACLOSE=(Om+Hm+Lm+Cm)/4;
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( Hm, Max( HaClose, HaOpen ) );
HaLow = Min( Lm, Min( HaClose, HaOpen ) );
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "" + Name(), colorWhite, styleCandle | styleNoLabel );
_SECTION_END();
 
Last edited:

amitrandive

Well-Known Member
#2
XRAY27

Again my learning continues:D

Attached code with HAClose in the title with normal candles.

The only issue is HAClose is also plotted.I do not know how to put in the parameters to turn the plotting of HAClose off.:confused:

Code:
_SECTION_BEGIN("Heiken Ashi Smoothed");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack),ParamColor("Titleblock",colorLightGrey ));
SetChartOptions(0,chartShowArrows|chartShowDates);
GraphXSpace=5;
p=Param("Period",6,2,30,1);
Om=MA(O,p);
hm=MA(H,p);
lm=MA(L,p);
Cm=MA(C,p);
HACLOSE=(Om+Hm+Lm+Cm)/4;
//HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
//HaHigh = Max( Hm, Max( HaClose, HaOpen ) );
//HaLow = Min( Lm, Min( HaClose, HaOpen ) );
//PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "" + Name(), colorWhite, styleCandle | styleNoLabel );
Plot(HaClose,"HACLOSE",colorRed,styleThick);
_SECTION_END();

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();
 

XRAY27

Well-Known Member
#3
Thanks for helping me to get the required afl... even on off is not there for HACLOSE ....its gives me a great help...
 
Last edited:

pratapvb

Well-Known Member
#4
Thanks for helping me to get the required afl... even on off is not there for HACLOSE ....its gives me a great help...
use styleNoDraw in Plot to not draw the line
 

amitrandive

Well-Known Member
#5
use styleNoDraw in Plot to not draw the line
pratapvb

Thanks for guidance

XRAY27 Attached full code with Pratap's comments incorporated .

Code:
_SECTION_BEGIN("Heiken Ashi Smoothed");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack),ParamColor("Titleblock",colorLightGrey ));
SetChartOptions(0,chartShowArrows|chartShowDates);
GraphXSpace=5;
p=Param("Period",6,2,30,1);
Om=MA(O,p);
hm=MA(H,p);
lm=MA(L,p);
Cm=MA(C,p);
HACLOSE=(Om+Hm+Lm+Cm)/4;
//HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
//HaHigh = Max( Hm, Max( HaClose, HaOpen ) );
//HaLow = Min( Lm, Min( HaClose, HaOpen ) );
//PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "" + Name(), colorWhite, styleCandle | styleNoLabel );
Plot(HaClose,"HACLOSE",colorRed,styleNoDraw);
_SECTION_END();

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();
 

Similar threads