Thursday, October 10, 2024

AFL CODE-HỆ THỐNG LƯỚI SÓNG CÙNG CÁ MẬP

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


_SECTION_BEGIN("TenkanSen");

TS=(HHV(High,9)+LLV(Low,9))/2;

Plot(TS,"TenkanSen",ParamColor("Color",colorCycle) ,ParamStyle("Style"));

_SECTION_END();


_SECTION_BEGIN("KijunSen");

KJ=(HHV(High,26)+LLV(Low,26))/2;

Plot(KJ,"KijunSen",ParamColor("Color",colorCycle), ParamStyle("Style"));

_SECTION_END();


_SECTION_BEGIN("ChikouSpan");

PlotOHLC(0,Close,Close,Close,"ChikouSpan",ParamColor("Color",colorCycle),ParamStyle("Style"),Null,Null,-26);

_SECTION_END();



_SECTION_BEGIN("Cloud");

SpanA=(TS+KJ)/2;

SpanB=(HHV(High,52)+LLV(Low,52))/2;

PlotOHLC(0,SpanA,SpanB,SpanB,"Cloud",IIf(SpanA>SpanB,ParamColor("Color Up",colorLime),ParamColor("Color  Down",colorLightOrange)),styleCloud+styleNoTitle+styleNoLabel,Null,Null,26);

_SECTION_END();




_SECTION_BEGIN("Mua ban luot song ");



mua =   

C >= Ref(H,-1)

AND C >= Ref(H,-2)

AND C >= Ref(H,-3)

AND C >= Ref(H,-4);


ban = 

C <= Ref(L,-1)

AND C <= Ref(L,-2)

AND C <= Ref(L,-3) 

AND C <= Ref(L,-4) 

AND C <= Ref(L,-5) 

AND C <= Ref(L,-6) 

AND C <= Ref(L,-7)

AND C <= Ref(L,-8) ;

 

Buy42 = ExRem(mua, ban);

Sell8 = ExRem(ban, mua);


 


PlotShapes( IIf( Buy42 , shapeUpArrow + shapeDigit1 , shapeNone ), colorBrightGreen, 0, L, Offset =50 );

PlotShapes( IIf( Buy42 , shapeUpArrow , shapeNone ), colorBrightGreen, 0, L, Offset =-35 );


PlotShapes( IIf( Sell8 , shapeDownArrow + shapeDigit2 , shapeNone ), colorRed, 0, H , Offset=50 );

PlotShapes( IIf( Sell8 , shapeDownArrow , shapeNone ), colorRed, 0, H , Offset=-35 );



 

_SECTION_END();



// THONG TIN LIEN HE

_SECTION_BEGIN("Hien thi thong tin");

GfxSelectFont("Tahoma", 10, 700); 

GfxSetBkMode(1);

GfxSetTextColor(colorBlue);

GfxSetTextAlign(6);

GfxTextOut("FIALDA HE THONG LUOT SONG CUNG CA MAP", Status("pxwidth")/2, 28);

GraphXSpace=10;

_SECTION_END();

_SECTION_BEGIN("Mark Minervini");


MA5 = MA (C,5);

MA10 = MA (C,10);

MA20 = MA (C,20);

MA50 = MA (C,50);

MA150 = MA (C, 150);

MA200 = MA (C,200);

DK1 = MA150 > MA200;

DK2 = MA50 > MA150;

DK4 = DK1 AND DK2;

DK5 = Cross (C, MA50);

DK6 = Cross (C, MA10);

DK7 = Cross (C, MA5);

DK8 = DK5 OR DK6 OR DK7;

GTGD = C*V;

DK9 = GTGD>5000000;

VolMA50 = 1.1*MA(V, 20);

DK10 = V > VolMA50 AND V>200000 ;

Buy23= DK4 AND DK8 AND DK9 AND DK10;//buy3

PlotShapes(shapeUpArrow*BUY23,ParamColor("UpArrow",colorBlue),0,L,-40); 

_SECTION_END();

👉Tải tại đây

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