Header ads

Viết code amibroker tốt nhất

AFL Amibroker Signal T+3 Buy Sell | Code Amibroker tín hiệu mua bán T+3

Code Amibroker tín hiệu mua bán T+3

Đây là hệ thống T3, được tính toán bởi một hàm đặc biệt được thiết lập sẵn trên bộ code này. Hàm tính toán không nằm trên phần mềm Amibroker. Hiển thị tín hiệu mua bán rất chính xác và cực kỳ tuyệt vời cho nhà đầu tư giao dịch cổ  phiếu theo hướng phân tích kỹ thuật. Bạn nên sử dụng công cụ T+3 nâng cao này sẽ có độ chính xác tốt hơn.

Sử dụng

Rất đơn giản, xuất hiện tín hiệu (mũi tên đi lên) là ta mua vào và ngược lại.
Code Amibroker tín hiệu mua bán T3

Code AFL Amibroker.

Đặc biệt bộ code này có tích hợp thêm tính năng quét truy tìm cổ phiếu nữa đấy.

//==============================================================
// Signal Buy Sell
//  Production by: Trading Plus
// Date: 16/10/2012
//     Contact: tradingplus.dt@gmail.com
// Version: 5.2.1.1
// Website: https://tradeplus007.blogspot.com
//==============================================================
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle);
_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 )) ));
TypeShow = ParamList("Show Type","Line|Candle|Bar",1);
if(TypeShow == "Line")
{
typeshow = styleLine;
}
else if(TypeShow == "Candle")
{
typeshow = styleCandle;
}
else
{
typeshow = styleBar;
}

ST3 = Param("T3",0.618,0,1,0.001);
_SECTION_END();
function T3(price,periods) //AMA-based
{
s = ST3;//0.618;
periods = 2/(periods+1);
e1=AMA(price,periods);
e2=AMA(e1,Periods);
e3=AMA(e2,Periods);
e4=AMA(e3,Periods);
e5=AMA(e4,Periods);
e6=AMA(e5,Periods);
c1=-s*s*s;
c2=3*s*s+3*s*s*s;
c3=-6*s*s-3*s-3*s*s*s;
c4=1+3*s+s*s*s+3*s*s;
Ti3=c1*e6+c2*e5+c3*e4+c4*e3;
return ti3;
}
//Ribbon
uptrend=PDI()>MDI()AND Signal()<MACD();
downtrend=MDI()>PDI()AND Signal()>MACD();
Plot( 2, "",IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );

Plot(T3(C,3),"T3",colorTan,styleThick);
Plot(T3(C,5),"T5",colorLime);

BuyAlert = Cross (T3(C,3), T3(C,5));
SellAlert = Cross (T3(C,5), T3(C,3));
_SECTION_BEGIN("Name");
GfxSetOverlayMode(1);
GfxSelectFont("Tahoma", Status("pxheight")/6 );
GfxSetTextAlign( 6 );// center alignment
//GfxSetTextColor( ColorRGB( 200, 200, 200 ) );
//GfxSetTextColor( ColorHSB( 42, 42, 42 ) );
GfxSetTextColor(colorGrey50);
GfxSetBkMode(0); // transparent
GfxTextOut("Trading Plus", Status("pxwidth")/2, Status("pxheight")/12 );
GfxSelectFont("Tahoma", Status("pxheight")/12 );
GfxTextOut( "TPs", Status("pxwidth")/2, Status("pxheight")/3 );
GfxSelectFont("Tahoma", Status("pxheight")/36 );
GfxTextOut( "https://tradeplus007.blogspot.com", Status("pxwidth")/2, Status("pxheight")/2 );
_SECTION_END();
Buy = Cover = BuyAlert & (Signal()<MACD()||(Ref(Signal(),-1) > Ref(MACD(),-1))) & C > T3(C,20);
Sell = Short = SellAlert & (Signal()>MACD()||(Ref(Signal(),-1) < Ref(MACD(),-1))) & C < T3(C,20);

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell, Buy);

GraphXSpace = 5;
dist = 0.70*ATR(7);
shape = Buy * shapeHollowUpArrow + Sell * shapeHollowDownArrow;
PlotShapes( shape, IIf( Buy ,colorGreen, colorRed ),0, IIf( Buy , Low-2*dist, High+2*dist ) );
for( i = 0; i < BarCount; i++ )
{
if( Buy[i] ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist[i], colorGreen );
if( Sell[i] ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist[i], colorRed );
}

colorchar = IIf(T3(C,3) > T3(C,5),colorBrightGreen,IIf(T3(C,3) < T3(C,5),colorRed,colorWhite));
Plot(C,"",colorchar,typeshow + styleNoLabel);

Filter = Buy OR Sell & Volume > 50000;
AddColumn(Buy, "Buy", 1);
AddColumn(Sell, "Sell", 1);
AddColumn(V, "Volume", 1);
AddColumn(C, "Close", 1.2);

Cung cấp bởi Trading Plus

Post a Comment

0 Comments