Thursday, October 10, 2024

AFL CODE-HỆ THỐNG ICHIMOKU THEO THỜI GIAN


_SECTION_BEGIN(" ");

GfxSetBkMode(1);

X=250;

Y=20;

Font=10;

GfxSelectFont("Impact",Font*1.2, 300);GfxSetTextColor(colorAqua);GfxTextOut

 

(" ",x,y);


ValueY = LowestVisibleValue(L);

_SECTION_BEGIN("Ichimuko Time Series Reserver");

function DrawSeriesReserver( start, series, Color )

{

x = BarsSince( start );

result = 0;

for( i = 0; ( bar = StrToNum( StrExtract( series, i ) ) ) != 0; i++ )

{

result += x == (52-bar);

ValueX = SelectedValue(BarIndex()+1-51)+(52-bar);

PlotText("-"+bar,valueX,ValueY ,Color );


}

Plot( result, "", Color, styleHistogram|styleOwnScale|styleNoLabel|styleDashed , 0, 1 );

}

IchiSeries = "9,26,52";

bi = BarIndex();

start = bi == SelectedValue( bi - 52 );

DrawSeriesReserver( start, IchiSeries, ParamColor( "Line", colorLightGrey)  );

_SECTION_END();


_SECTION_BEGIN("Ichimuko Time Series");

function DrawSeries( start, series, Color )

{

x = BarsSince( start );

result = 0;

for( i = 0; ( bar = StrToNum( StrExtract( series, i ) ) ) != 0; i++ )

{

result += x == bar;

ValueX = SelectedValue(BarIndex()+1)+bar;

PlotText(""+bar,ValueX,ValueY,Color );

}

Plot( result, "", Color, styleHistogram|styleOwnScale|styleNoLabel|styleDashed , 0,1 );

}

IchiSeries = "9,13,17,26,33,42,52,83,97";

bi = BarIndex();

start = bi == SelectedValue( bi-0);

DrawSeries( start, IchiSeries, ParamColor( "Line", colorBlue)  );

_SECTION_END();



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


// THONG TIN LIEN HE

_SECTION_BEGIN("Hien thi thong tin");

GfxSelectFont("Tahoma", 10, 700); 

GfxSetBkMode(1);

GfxSetTextColor(colorBlue);

GfxSetTextAlign(6);

GfxTextOut("FIALDA XU HUONG VNINDEX", Status("pxwidth")/2, 28);

GraphXSpace=10;

_SECTION_END();

👉Tải tại đây

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