Friday, October 11, 2024

AFL CODE-SETUP_GUPPY MULTIPLE MA


_SECTION_BEGIN("Candlestick");

UpClose = Close - Ref(Close,-1);

Color = IIf(UpClose > 0, ParamColor( "Up Bar", colorBlue ), ParamColor( "Down Bar", colorRed ));

PlotOHLC(Open,High,Low,Close,"", Color, styleCandle);

SetChartOptions(0,chartShowArrows|chartShowDates);

_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("MA3");

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

Periods = Param("Periods", 3, 2, 300, 1, 0 );

Plot( MA( P, Periods ), "MA3", ParamColor( "Color", colorLightBlue), ParamStyle("Style") ); 

_SECTION_END();


_SECTION_BEGIN("MA5");

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

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

Plot( MA( P, Periods ), "MA5", ParamColor( "Color", colorLightBlue ), ParamStyle("Style") ); 

_SECTION_END();


_SECTION_BEGIN("MA8");

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

Periods = Param("Periods", 8, 2, 300, 1, 0 );

Plot( MA( P, Periods ), "MA8", ParamColor( "Color", colorLightBlue ), ParamStyle("Style") ); 

_SECTION_END();


_SECTION_BEGIN("MA10");

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

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

Plot( MA( P, Periods ), "MA10", ParamColor( "Color", colorLightBlue ), ParamStyle("Style") ); 

_SECTION_END();


_SECTION_BEGIN("MA13");

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

Periods = Param("Periods", 13, 2, 300, 1, 0 );

Plot( MA( P, Periods ), "MA13", ParamColor( "Color", colorLightBlue ), ParamStyle("Style") ); 

_SECTION_END();


_SECTION_BEGIN("MA15");

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

Periods = Param("Periods", 15, 2, 300, 1, 0 );

Plot( MA( P, Periods ), "MA15", ParamColor( "Color", colorLightBlue ), ParamStyle("Style") ); 

_SECTION_END();


_SECTION_BEGIN("MA30");

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

Periods = Param("Periods", 30, 2, 300, 1, 0 );

Plot( MA( P, Periods ), "MA30", ParamColor( "Color", colorOrange ), ParamStyle("Style") ); 

_SECTION_END();


_SECTION_BEGIN("MA35");

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

Periods = Param("Periods", 35, 2, 300, 1, 0 );

Plot( MA( P, Periods ), "MA35", ParamColor( "Color", colorOrange ), ParamStyle("Style") ); 

_SECTION_END();


_SECTION_BEGIN("MA40");

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

Periods = Param("Periods", 40, 2, 300, 1, 0 );

Plot( MA( P, Periods ), "MA40", ParamColor( "Color", colorOrange ), ParamStyle("Style") ); 

_SECTION_END();


_SECTION_BEGIN("MA45");

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

Periods = Param("Periods", 45, 2, 300, 1, 0 );

Plot( MA( P, Periods ), "MA45", ParamColor( "Color", colorOrange ), ParamStyle("Style") ); 

_SECTION_END();


_SECTION_BEGIN("MA50");

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

Periods = Param("Periods", 50, 2, 300, 1, 0 );

Plot( MA( P, Periods ), "MA50", ParamColor( "Color", colorOrange ), ParamStyle("Style") ); 

_SECTION_END();


_SECTION_BEGIN("MA60");

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

Periods = Param("Periods", 60, 2, 300, 1, 0 );

Plot( MA( P, Periods ), "MA60", ParamColor( "Color", colorOrange ), ParamStyle("Style") ); 

_SECTION_END();

👉Tải tại đây

https://drive.google.com/file/d/1Y6E1pvczqIEmcAAMLhVR7yUITzdd5Bo3/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


1 comment: