Showing posts with label AFL CODE-SETUP_HULL MOVING AVERAGE. Show all posts
Showing posts with label AFL CODE-SETUP_HULL MOVING AVERAGE. Show all posts

Friday, October 11, 2024

AFL CODE-SETUP_HULL MOVING AVERAGE

_SECTION_BEGIN("Heikin Ashi");

HaClose = (O + H + L + C)/4; 

HaOpen = AMA( Ref( HaClose, -1 ), 0.5 ); 

HaHigh = Max( H, Max( HaClose, HaOpen ) ); 

HaLow = Min( L, Min( HaClose, HaOpen ) ); 

xDiff = (HaHigh - Halow) * 10000;

barcolor = IIf(HaClose >= HaOpen,colorGreen,colorRed);

PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "", barcolor, styleCandle );

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));

if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )

{

ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));

}

_SECTION_END();


_SECTION_BEGIN("HMA");

P = ParamField("Price field",-1);

Periods = Param("Periods", 12, 2, 300, 1, 10 );

Plot( HMA( P, Periods ), "Hull-MA12", ParamColor( "Color", colorCustom7 ), ParamStyle("Style",styleThick) ); 

_SECTION_END();


_SECTION_BEGIN("DispMA");

P = ParamField("Field",-1);

Type = ParamList("Type", "Simple,Exponential,Double Exponential,Tripple Exponential,Wilders,Weighted",1);

Periods = Param("Periods", 5, 2, 300 );

Displacement = Param("Displacement", 2, -50, 50 );

m = 0;


if( Type == "Exponential" ) m = EMA( P, Periods );

if( Type == "Simple" ) m = MA( P, Periods );

if( Type == "Double Exponential" ) m = DEMA( P, Periods );

if( Type == "Tripple Exponential" ) m = TEMA( P, Periods );

if( Type == "Wilders" ) m = Wilders( P, Periods );

if( Type == "Weighted" ) m = WMA( P, Periods );


Plot( m, "Dis-EMA5", ParamColor("Color", ColorCycle), ParamStyle("Style",styleThick), 0, 0, Displacement );

_SECTION_END();

👉Tải tại đây

https://drive.google.com/file/d/1MHT9B5qx_wGazpZgU29VBehHgK40TyV-/view?usp=drive_link

Cách sử dụng AFL  cho Amibroker  

Tải xuống tệp Amibroker AFL. 

Bây giờ hãy sao chép tệp afl và dán vào vị trí cài Amibroker  

D:\A KY PC\Win\Amibroker\Formulas\VIP free

Nguồn thông tin Dòng tiền chứng khoán sưu tầm internet