Code Amibroker Indicators

tăng lợi nhuận cho Amibroker (AFL)

by admin January 12, 2019 6 min read 0 comments

Key Takeaways

  • Market conditions and their impact on trading decisions
  • Key levels and price action analysis
  • Risk management strategies for this setup

Ví dụ về hệ thống lợi nhuận từ Bill William
xuất phát từ Book Trading Chaos 2nd Edition.
Tín hiệu vào được sử dụng là Wiseman 2 và Wiseman 3
Thoát tín hiệu Wiseman 2
Tín hiệu Thoát Wiseman 3 là Cá sấu đỏ
Sử dụng Tham số Toggle có thể hiển thị và loại bỏ
tất cả các dòng và tín hiệu mua và bán

Ngoại trừ Friend Entry3 sử dụng dữ liệu RealTime,
Các tín hiệu vào và ra khác sử dụng dữ liệu EOD, đợi cho đến khi thị trường đóng cửa

Sử dụng khái niệm Hit-Hit
Mua và bán Wiseman2
Bán Wiseman3

_SECTION_BEGIN(“Price”);
Plot( C, “Close”, ParamColor(“Color”, colorBlack ), styleNoTitle | ParamStyle(“Style”) | GetPriceStyle() );
_N(Title = StrFormat(“P r o f i t u n i t y V-H : {{NAME}} – {{INTERVAL}} {{DATE}} O %g, H %g, L %g, C %g (%.1f%%) ” + ” {{VALUES}}”, O, H, L, C, SelectedValue( ROC( C, 1 )) ));
_SECTION_END();
_SECTION_BEGIN(“Fractal”);
UpFractal= ValueWhen(
(Ref(H,-2) > Ref(H, -4)) AND
(Ref(H,-2) > Ref(H, -3)) AND
(Ref(H,-2) > Ref(H, -1)) AND
(Ref(H,-2) > H), Ref(H,-2));
DownFractal= ValueWhen(
(Ref(L,-2) <= Ref(L, -4)) AND
(Ref(L,-2) <= Ref(L, -3)) AND
(Ref(L,-2) <= Ref(L, -1)) AND
(Ref(L,-2) <= L), Ref(L,-2));
// Menampilkan garis Fractal Up dan Fractal Down
PlotFractalUp=ParamToggle(“Plot Fractal Up ?”,”Tidak|Ya”,1);
if ( PlotFractalUp )
{
Plot(UpFractal, “UF”, ParamColor(“Up Fractal Color”,colorBlue),
ParamStyle(“Up Fractal Style”, styleThick|styleDashed));
}
PlotFractalDown=ParamToggle(“Plot Fractal Down ?”,”Tidak|Ya”,1);
if ( PlotFractalDown )
{
Plot(DownFractal, “DF”,ParamColor(“Down Fractal
Color”,colorRed), ParamStyle(“Down Fractal Style”, styleThick|styleDashed));
}
UF=UpFractal;
DF=DownFractal;
_SECTION_END();
_SECTION_BEGIN(“Alligator “);
// Menentukan Alligator
AlligatorBlue = Ref(Wilders(Avg,13),-8);
AlligatorRed = Ref(Wilders(Avg,8),-5);
AlligatorGreen = Ref(Wilders(Avg,5),-3);
// Mem-plot 3 garis Alligator
PlotAlligator=ParamToggle(“Plot Alligator ?”,”Tidak|Ya”,1);
if ( PlotAlligator )
{
Plot(AlligatorBlue, “Jaw”, colorBlue, styleLine | styleThick);
Plot(AlligatorRed, “Teeth”, colorRed, styleLine | styleThick);
Plot(AlligatorGreen, “Leeps”, colorGreen, styleLine | styleThick);
}
// Syarat Entry WS3 : Open > Alligator Merah
AlligatorEntry = O > AlligatorRed ;
_SECTION_END();
_SECTION_BEGIN(“Tick “);
/Aturan Tick Khusus untuk BEI/
Tick=IIf(C<=200,1, IIf(C>200 AND C<=500,5, IIf(C>500 AND C<=2000,10, IIf(C>2000 AND C<=5000,25, IIf(C>5000,50,0)))));
_SECTION_END();
// Fungsi menghitung
function BuyValCalc (input)
{ buyval=ValueWhen(input, H+tick);
return buyval; }
function BuyHitCalc (buyval)
{ (buyhit=buyval>=L AND buyval<=H AND C>=O) OR (L>=Ref(H,-1) AND O>buyval); // + gap up
buyhit=ExRem(buyhit,buyval != Ref(buyval,-1)); // remove excess signals
return buyhit; }
function SellValCalc (input)
{ sellval=ValueWhen(input,L-tick);
return sellval; }
function SellHitCalc (sellval)
{ (sellhit=sellval>=L AND sellval<=H) OR (H<=Ref(L,-1) AND O<sellval); // + gap down
sellhit=ExRem(sellhit,sellval != Ref(sellval,-1)); // remove excess signal
return sellhit; }
// Definisi Value
AvgPrice=(O+H+L+C)/4;
DV=AvgPriceV500;
DVMil = DV / 1000000000;
MADV20 = MA( DV, 20 );
MADV20Mil = MADV20 / 1000000000;
FValue = DVMil / MADV20Mil ;
// Pilih saham yg likuid ,yaitu Value > Rp. 1 Milyar,
// MA 20 (Val) > Rp. 1 Mil. , Value / MA20 > 1
Likuid = DVMil > 1.0 AND MADV20Mil > 1 AND FValue > 1 ;
// Menghitung AO
Tengah = (H+L)/2 ;
var1 = MA( Tengah , 34);
var2 = MA( Tengah,5);
diff = var2-var1;
// Menentukan UpBar dan DownBar
UpBar = diff > Ref(diff,-1);
DownBar = diff < Ref(diff,-1);
// Menentukan Super AO (WM2) Buy dan Sell –> Valid dan Hit
BuyAO = Ref(DownBar, -3) AND Ref(UpBar, -2) AND Ref(UpBar, -1) AND UpBar AND LIKUID;
BuyAOval = BuyValCalc(BuyAO);
BuyAOHit = BuyHitCalc(BuyAOval);
SellAO = Ref(UpBar, -3) AND Ref(DownBar, -2) AND Ref(DownBar, -1) AND DownBar;
SellAOVal = SellValCalc(SellAO);
SellAOHit = SellHitCalc(SellAOval);
BuyWM2 = BuyAO;
BuyWM2Val = ValueWhen(BuyAO,BuyAOval);
BuyWM2Hit = BuyAOhit;
SellWM2 = SellAO;
SellWM2Val = ValueWhen(SellAO,SellAOval);
SellWM2Hit=SellAOHit;
// Meentukan Sinyal Single / Multi Entry untuk WS2
PlotWS2SE=ParamToggle(“Single Entry WS2 ?”,”Tidak|Ya”,0);
if ( PlotWS2SE )
{
BuyWM2=ExRem(BuyWM2,SellWM2);
}
// Sinyal Single Entry untuk WM2
SellWM2=ExRem(SellWM2,BuyWM2);
// Menampilkan Sinyal Buy dan Sell WM2 –> Segitita kosong
PlotWM2=ParamToggle(“Plot WS2 ?”,”Tidak|Ya”,1);
if ( PlotWM2 )
{
PlotShapes( IIf(BuyAO,shapeSmallUpTriangle,0) ,colorBlue, 0, L,- 15);
PlotShapes(IIf(BuyWM2Hit,shapeDigit2,shapeNone),colorDarkBlue,0,L,-15);
PlotShapes( IIf(SellAO,shapeSmallDownTriangle,0) ,colorOrange, 0, H,-15);
PlotShapes(IIf(SellWM2Hit,shapeDigit2,shapeNone),colorOrange,0,H,15);
}
// Syarat Buy WS3
BuyWS3 = O < UF AND C > UF AND H>=(UF+Tick) AND Ref(H,-1)<=UF AND AlligatorEntry AND Likuid ;
BuyWS3Price = UF + Tick ;
// Syarat Sell WS3 C < AlligatorRed AlRed = AlligatorRed; //SellWS3 = C < AlRed ; //SellWS3 = Ref(H,-1) > Ref(AlRed,-1) AND C < AlRed AND H > AlRed ;
SellWS3 = Ref(H,-1) > Ref(AlRed,-1) AND C < AlRed AND ( Ref(C,-1) > AlRed AND ( Ref(C,-2) > AlRed) AND ( Ref(C,-3) > AlRed)) ;
SellWS3Price= AlRed;
SellAl = SellWS3 ;
SellAlVal = SellValCalc(SellAl);
SellAlHit = SellHitCalc(SellAlval);
SellWM3 = SellAl;
SellWM3Val = ValueWhen(SellAl,SellAlVal);
SellWM3Hit = SellAlHit ; //AND (SellWM3Val > SellAlVal);
// Meentukan Sinyal Single / Multi Entry untuk WS3
PlotWS3SE=ParamToggle(“Single Entry ?”,”Tidak|Ya”,0);
if ( PlotWS3SE )
{
BuyWS3=ExRem(BuyWS3,SellWS3);
}
// Sinyal Single Entry untuk WS3
SellWS3=ExRem(SellWS3,BuyWS3);
SellWM3Hit=ExRem(SellWM3Hit,BuyWS3);
// Menampilkan Sinyal Buy dan Sell WS3 –> Segitita
PlotWS3=ParamToggle(“Plot WS3 ?”,”Tidak|Ya”,1);
if ( PlotWS3 )
{
PlotShapes(IIf(BuyWS3,shapeSmallUpTriangle,Null), colorGreen, 0, L, -30);
PlotShapes(IIf(SellWS3,shapeSmallDownTriangle,Null), colorRed , 0, H, -30);
PlotShapes(IIf(SellWM3Hit,shapeDigit3,shapeNone),colorRed,0,H,30);
}
// Tittle untuk menampilkan Sinyal Valid dan Hit
_N(Title=Title+EncodeColor(colorDarkGreen)+WriteIf(BuyWM2,”\n\n”+”Buy WM2 = “+H,””)
+EncodeColor(colorDarkGreen)+WriteIf(BuyWM2Hit,”\n\n”+”Buy WM2 Hit = “+BuyWM2val,””));
_N(Title=Title+EncodeColor(colorRed)+WriteIf(SellAO,”\n\n”+”Sell WM2 = “+L,””)
+EncodeColor(colorRed)+WriteIf(SellWM2Hit,”\n\n”+”Sell WM2 Hit = “+SellWM2Val,””));
_N(Title=Title+EncodeColor(colorDarkGreen)+WriteIf(BuyWS3 ,”\n\n”+”Buy WM3 Hit = “+BuyWS3Price,””));
_N(Title=Title+EncodeColor(colorRed)+WriteIf(SellWM3,”\n\n”+”Sell WM3 = “+L,””)
+EncodeColor(colorRed)+WriteIf(SellWM3Hit,”\n\n”+”Sell WM3 Hit = “+SellWM3Val,””));

Trading Data Snapshot

Always verify current market conditions before executing any trade. Past performance does not guarantee future results.

A
admin
Trading analyst and market commentator with expertise in technical analysis, price action, and risk management. Dedicated to helping traders make informed decisions.

Leave a Reply