Skip to main content

KPL with RSI for Amibroker (AFL)

pdkg_gal almost 16 years ago Amibroker (AFL)

  • Rating:
    2 / 5 (Votes 4)
  • Tags:
    trading system, amibroker, exploration

THIS INDICATOR IS COMBINATION FAMOUS KPL INDICATOR AND RSI.

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("KPL RSI");
SetChartOptions(0,chartShowArrows | chartShowDates);
no=Param( "Swing", 7, 1, 55 );

res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
tsl=IIf(avn==1,Ref(sup,-1),Ref(res,-1));

Plot(tsl, _DEFAULT_NAME(), colorRed, styleLine);

ADXpval = IIf(MA(RSI(14),5) > Ref(MA(RSI(14),5),-1) AND Ref(MA(RSI(14),5),-1) > Ref(MA(RSI(14),5),-2) AND Ref(MA(RSI(14),5),-2) > Ref(MA(RSI(14),5),-3),1,0);
ADXmval = IIf(MA(RSI(14),5) < Ref(MA(RSI(14),5),-1) AND Ref(MA(RSI(14),5),-1) < Ref(MA(RSI(14),5),-2) AND Ref(MA(RSI(14),5),-2) < Ref(MA(RSI(14),5),-3),1,0);

barcolor = IIf(ADXpval==1,colorGreen, IIf(ADXmval==1,colorRed,colorBlack));

Plot( C, "Close", barcolor, styleNoTitle | ParamStyle("Style") | GetPriceStyle());

Buy=Cross(C,tsl) AND ADXpval=1 AND RSI(14)<60;
Sell=Cross(tsl,C) AND ADXmval=1 AND RSI(14)>40;

shape=Buy*shapeUpArrow + Sell*shapeDownArrow;
PlotShapes(shape,IIf(Buy,colorGreen,colorRed),0,IIf(Buy,Low,High));
_SECTION_END();

1 comments

1. persee
almost 16 years ago

There is an error

replace

Buy=Cross(C,tsl) AND ADXpval=1 AND RSI<60;
Sell=Cross(tsl,C) AND ADXmval=1 AND RSI>40;

by

Buy=Cross(C,tsl) AND ADXpval==1 AND RSI<60;
Sell=Cross(tsl,C) AND ADXmval==1 AND RSI>40;

Leave Comment

Please login here to leave a comment.