Showing posts with label AFL CODE-HỆ THỐNG MUA BÁN HÀNG NGÀY. Show all posts
Showing posts with label AFL CODE-HỆ THỐNG MUA BÁN HÀNG NGÀY. Show all posts

Thursday, October 10, 2024

AFL CODE-HỆ THỐNG MUA BÁN HÀNG NGÀY


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

 

SD = StochD(8, 3, 3);

MH = MACD(8, 21) - Signal(8, 21, 5);

trendup = IIf(MH > 0 OR (MH > 0 AND MH > Ref(MH, -1)) AND RSI(3) >50 AND SD < 80 AND SD > Ref(SD, -1) AND ValueWhen(C,O<C), colorBlue, colorWhite);

trendcolor = IIf(MH < 0 OR (MH < 0 AND MH < Ref(MH, -1)) AND RSI(3) <50 AND SD > 20 AND SD < Ref(SD, -1) AND ValueWhen(C,O>C), colorRed, trendup);

Plot( C, "Close", trendcolor, styleCandle | styleThick );

 

_SECTION_END();

 



prevt4=AMA2(C,1,0);

dt4=IIf(C>Ref(Max(Max(H,Ref(H,-3)),Max(Ref(H,-1),Ref(H,-2))),-1),Min(Min(L,Ref(L,-3)),Min(Ref(L,-1),Ref(L,-2))),

IIf(C<Ref(Min(Min(L,Ref(L,-3)),Min(Ref(L,-1),Ref(L,-2))),-1),Max(Max(H,Ref(H,-3)),Max(Ref(H,-1),Ref(H,-2))),PREVT4));

at4=Cross(Close,dt4);

bt4=Cross(dt4,Close);

state=IIf(BarsSince(at4)<BarsSince(bt4),1,0);

Buy=state>Ref(state,-1);

Sell=state<Ref(state,-1);

Noaction=state==Ref(state,-1);

col=IIf(state == 1 ,51,IIf(state ==0,4,1));



shape = Buy * shapeUpArrow + Sell * shapeDownArrow;

PlotShapes( shape, IIf( Buy, colorGreen, colorRed ),0, IIf( Buy, Low, High ) );


 

dist = 0.8*ATR(1); //0.8

dist1 = 1.8*ATR(1); //1.2

for( i = 0; i < BarCount; i++ ) 

 if( Buy[i] ) 

 {

  PlotText( "Buy:" + L[ i ], i, L[ i ]-dist[i], colorLime);

  //PlotText( "Buy:" + L[ i ] + "\nTgt: " + (a1[i]*1.005) + "\nSL: " + (tsl[i]*0.9975), i, L[ i ]-dist[i], colorLime);

 }

 if( Sell[i] )

 {

  PlotText( "Sell:" + H[ i ] , i, H[ i ]+dist1[i], colorBlack); 

  //PlotText( "Sell:" + H[ i ] + "\nT: " + (a1[i]*0.995) + "\nSL: " + (tsl[i]*1.0025), i, H[ i ]+dist1[i], colorBlack); 

 }

}

Plot(EMA( C, 13 ),"EMA13",colorred,styleLine);

Plot(EMA( C, 26 ),"EMA26",colorOrange,styleLine);


// THONG TIN LIEN HE

_SECTION_BEGIN("Hien thi thong tin");

GfxSelectFont("Tahoma", 10, 700); 

GfxSetBkMode(1);

GfxSetTextColor(colorBlue);

GfxSetTextAlign(6);

GfxTextOut("FIALDA MUA BAN NHANH", Status("pxwidth")/2, 28);

GraphXSpace=10;

_SECTION_END();

👉Tải tại đây

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