Showing posts with label AFL CODE-HỆ THỐNG LƯỚT SÓNG T. Show all posts
Showing posts with label AFL CODE-HỆ THỐNG LƯỚT SÓNG T. Show all posts

Thursday, October 10, 2024

AFL CODE-HỆ THỐNG LƯỚT SÓNG T

_SECTION_BEGIN("  ---");

VAR2=(High+Low+(Close)*(2))/(4);

B = ((EMA((VAR2-LLV(VAR2,15))/(HHV(Low,15)-LLV(VAR2,15)),2))*(38));

//Plot(b, "", 4, 1+4);

bot1 = ((((-1))*(EMA((VAR2-LLV(VAR2,15))/(HHV(Low,15)-LLV(VAR2,15)),2))+0.01)*(38));

//Plot(bot1, "", 4, 1+4);

VAR22=((Close-LLV(Low,10))/(HHV(High,10)-LLV(Low,10)))*(100);

VAR33=EMA(VAR22,10);

VAR44=EMA(VAR33,10);

VAR55=(3)*(VAR33)-(2)*(VAR44);

VAR66=EMA(VAR55,5);

BridgeT = (EMA(VAR66,1));

//Plot(bridget, "", IIf(bridget > Ref(bridget,-1),colorCustom12,colorBlue), 1+4);

//Plot(-bridget, "", IIf(bridget > Ref(bridget,-1),colorCustom12,colorBlue), 1+4);


trend = (5)*(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5))-

(3)*(EMA(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5),3))-

EMA(EMA(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5),3),2);

Buy1 = Cross(trend,5);

//PlotShapes( IIf( Buy1, shapeSmallSquare, shapeNone ), colorGreen, layer = 0, yposition = 0, offset = 3 ); 

//PlotShapes( IIf( Buy1, shapeSmallSquare, shapeNone ),colorGreen, layer = 0, yposition = 0, offset = -4 ); 


VARA1=((Close>=Ref(Close,-1)) AND (Ref(Close,-1)>=Ref(Close,-2)) AND (Ref(Close,-1)<=Ref(Close,-3)) 

AND (Ref(Close,-2)<=Ref(Close,-3)) AND ((Ref(Close,-4)>Ref(Close,-2)) OR (Ref(Close,-4)<=Ref(Close,-2)) 

AND (Ref(Close,-5)>=Ref(Close,-3))) OR (Close>=Ref(Close,-1)) AND (Ref(Close,-1)<=Ref(Close,-2)) 

AND (Close>=Ref(Close,-2)) AND ((Ref(Close,-3)>Ref(Close,-1)) OR (Ref(Close,-3)<=Ref(Close,-1)) 

AND (Ref(Close,-4)>=Ref(Close,-2))));



VARA2=LLV(Low,5);

VARA3=HHV(High,5);

VARA4=EMA(((Close-VARA2)/(VARA3-VARA2))*(100),4);

VARA5=EMA((0.66699999)*(Ref(VARA4,-1))+(0.333)*(VARA4),2);

VARA6=(VARA5<24) AND (Open<MA(Close,20));


Buy2 =IIf(VARA1 AND (VARA6),30,0);

//Plot(Buy2, "", 8,2+4);

//Plot(-Buy2, "", 8,2+4);


//_N(Title = StrFormat("\\  | {{VALUES}}")+EncodeColor(colorBrightGreen)+WriteIf(Buy2==30,"BuySignal-A","" )+EncodeColor(colorBrightGreen)+WriteIf(Buy1==1," | BuySignal-B",""));



_SECTION_END();



//==========================================

Length = 14;

Price = EMA(Close, Length);

 

// Keltner 

kLength = Length;

kN = 1.5;

kATR = ATR(kLength);

kUpper = Price + kN * kATR;

kLower = Price - kN * kATR;

 

// Bollinger

bbLength = Length;

bbN = 2;

bbStDevValues = StDev(Close, bbLength);

bbUpper = Price + bbN * bbStDevValues;

bbLower = Price - bbN * bbStDevValues;

 

IsBBSqueeze = bbUpper <= kUpper AND bbLower >= kLower;


Proportion = (kUpper - kLower) / (bbUpper - bbLower);

BBBreakout = Cross(1,Proportion); 

Periods = Param("BBPeriods", 14, 2, 300, 1 );

Width = Param("Width", 2, 0, 10, 0.05 );

Color = ParamColor("Color", colorCycle );

Style = ParamStyle("Style");

bbtop=BBandTop( C, Periods, Width );

bbbot=BBandBot( C, Periods, Width );

Plot(bbtop, "", Color, Style ); 

Plot(bbbot , "", Color, Style );


sqeezcolor=ColorRGB(194,220,218);


PlotOHLC( bbtop,bbtop, bbbot,bbbot, "",IIf(IsBBSqueeze,colorYellow,colorWhite), styleCloud|styleNoRescale,  Null, Null, Null, -1 );

Plot(Close,"Close",colorGreen,styleCandle); 


Filter = BBBreakout;


AddColumn(BBBreakout, "BB Breakout", 1, colorWhite, IIf(BBBreakout==1, colorRed, colorWhite));

//set default sorting to Date/time in descending order in results window

SetSortColumns(-2);


_SECTION_BEGIN("do thi");

SetChartOptions(0,chartShowArrows|chartShowDates);

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", Open, High, Low, Close, SelectedValue( ROC( C, 1 ) ) ));

Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 

_SECTION_END();



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

//Periods = Param("Periods", 20, 2, 300, 1 );

//Width = Param("Width", 2, 0, 10, 0.05 );

//Color = ParamColor("Color", colorCycle );

//Style = ParamStyle("Style");

//Plot( BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), Color, Style ); 

//Plot( BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), Color, Style ); 


_SECTION_BEGIN("Luot song T+");


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)

OR ( HHV(C,3)>1.1*C) ;

 

Buy = ExRem(mua, ban) AND BridgeT < 50;

Sell = ExRem(ban, mua)   AND BridgeT > 50 ;

Cover=Buy;

Short=Sell;

Cover=ExRem(Cover,Short);

Short=ExRem(Short,Cover);

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

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


PlotShapes( IIf( Sell , shapeDownArrow + shapeDigit1 , shapeNone ), colorRed, 0, H , Offset=50 );

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

 

 

Buy_STO =  (StochD(14,3,3) < 50) ;

 

//Sell_STO = Cross (StochD(14,3,3), StochK(14 , 3)) AND (StochD(14,3, 3) > 50) AND (StochK(14,3) > 50);

Sell_STO = (StochD(14,3,3) > 50);


buy22 = Cross (eMA(C,5),eMA(C,20));

Sell22 = Cross(eMA(C,20),eMA(C,5));

PlotShapes(IIf(buy22, shapeStar, shapeNone),colorBrightGreen,0,L); 

PlotShapes(IIf(sell22, shapeStar, shapeNone),colorBlack,0,H);


V20 = MA(V,20);

V_to = v20 * 1.3;

buy1 = Cross (C, BBandTop(C,20,2)) AND V> v_to  ;

sell1 =Cross (BBandBot(C,20,2),C) AND V> v_to  ;

//PlotShapes(IIf(Buy1, shapeUpTriangle, shapeNone),colorGreen, 0,L, Offset=- 35 ); 

//PlotShapes(IIf(Sell1, shapeDownTriangle, shapeNone),colorRed, 0,H, Offset=- 30 ); 

_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 T+", Status("pxwidth")/2, 28);

GraphXSpace=10;

_SECTION_END();

👉Tải tại đây

https://drive.google.com/file/d/13lQxYc_E-WytUUj0vDCnvUFx5W-eyTFK/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