Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

KP SystemV.1 for Amibroker (AFL)
Anonymous
almost 12 years ago
Amibroker (AFL)

Rating:
3 / 5 (Votes 6)
Tags:
amibroker, advanced

This KP system is suitable for all timeframes.
Tick, Volume, Minutes, Daily, Weekly even Monthly…
First of all, make sure you have at least Amibroker 5.52!!

You can trade this system 2 ways.
1. You trade the Trend Bias or (is also BackGround)
2. With the AutoStop and the A900.

There are some helpfull visuals on this chart. Dynamic Support and Resistance and Pivots.
The code gives you acces to some more visuals.
You also need the kpami.dll. Download it from:
http://wisestocktrader.com/indicators/174-the-foundation-by-southwind-v-13-00-int

Found some instructional videos. Take at look at those to get you started:
http://www.youtube.com/watch?v=z1vSSOXHLjU
http://www.yrtrader.com/video/kwikpop/kwikpopvideo.html

Also picture of the M Range ribbon at the bottom of the chart:
http://archive.constantcontact.com/fs067/1102237833787/archive/1102657903532.html

Similar Indicators / Formulas

nikar in south breeze
Submitted by chweetmady almost 11 years ago
STOP-LOSS
Submitted by emonsyl over 14 years ago
Volume Analysis Studies
Submitted by johjoh over 14 years ago
Thiru-Optimum-Avg
Submitted by tmnkin over 11 years ago
TD Setup
Submitted by ferpa over 11 years ago
10 Day Moving Average System
Submitted by sonyhiren11 over 11 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
SetChartBkColor(ParamColor("Panel Color",colorLightGrey));
SetChartBkGradientFill(ParamColor("Upper Chart",colorLightGrey),ParamColor("Lower Chart",colorLightGrey));
dec=(Param("Decimals",2,0,7,1)/10)+1;
GraphXSpace=Param("GraphXSpace",20,-10,25,1);

BarTime1=LastValue(TimeNum() - Now(4));  
DataError=IIf(Now(4) > TimeNum(),True,False); 
TimeBase=IIf(Interval(1)>0,1,0); 
_N(StrBarTime=NumToStr(BarTime1,1.0,False)); 
BT_Length=StrLen(StrBarTime); 
_N(TimeLeft_= 
WriteIf(BT_Length==1,"0:0"+StrBarTime,WriteIf(BT_Length==2,"0:"+StrBarTime, 
WriteIf(BT_Length==3,StrLeft(StrBarTime,1)+":"+StrRight(StrBarTime,2), 
StrLeft(StrBarTime,2)+":"+StrRight(StrBarTime,2))))); 
TimeLeft=WriteIf(TimeBase==1,TimeLeft_,"N/A"); 
Title= EncodeColor(16)+ " High = "+ EncodeColor(27) + WriteVal(H,dec) +
EncodeColor(16)+ "   Low = "+ EncodeColor(32)+ WriteVal(L,dec) + 
EncodeColor(16) +"  TimeLeft = "+ EncodeColor(29) +TimeLeft  +
EncodeColor(16)+ "   Volume = "+ EncodeColor(18)+ WriteVal(V,1);
_SECTION_END();

_SECTION_BEGIN("TSKPScoreCardColors");
Ctmpl= E_TSKPCOLORTMPL(Open,High,Low,Close,Volume);
total=0;
total=total+ IIf(tskp_colortmplcnd0 > 0, 1,-1); 
total=total+ IIf(tskp_colortmplcnd1 > 0, 1,-1); 
total=total+ IIf(tskp_colortmplcnd2 > 0, 1,-1); 
total=total+ IIf(tskp_colortmplcnd3 > 0, 1,-1); 
total=total+ IIf(tskp_colortmplcnd4 > 0, 1,-1); 
total=total+ IIf(tskp_colortmplcnd5 > 0, 1,-1); 
total=total+ IIf(tskp_colortmplcnd6 > 0, 1,-1); 
total=total+ IIf(tskp_colortmplcnd7 > 0, 1,-1); 
total=total+ IIf(tskp_colortmplcnd8 > 0, 1,-1); 

for(i=0; i < BarCount; i++ ) 
{
if( total[i] >= 5 )
Color[i]= colorBlue;
else if(total[i] <= -5 )
Color[i]=colorRed;
else
Color[i]=colorYellow;
} 
CO = Open;
CH = High;
CL = Low;
CC = Close;
PlotOHLC( CO,CH,CL,CC, "Price", color, styleCandle );//Plot Selected Ticker
_SECTION_END();

_SECTION_BEGIN("KP DynSupRes");
sw = E_TSKPSWINGLINE(High,Low,Close);
//tskp_sw, tskp_swmean,tskp_swupper,tskp_swlower
Plot(tskp_swmean,"Mean",ParamColor("MeanColor",colorBlack),ParamStyle("MeanStyle",styleThick) ); 
Plot(tskp_swupper,"Resistance",ParamColor("ResistanceColor",colorDarkRed),ParamStyle("ResistanceStyle",styleThick) ); 
Plot(tskp_swlower,"Support",ParamColor("SupportColor",colorDarkGreen),ParamStyle("SupportStyle",styleThick) ); 
_SECTION_END();

_SECTION_BEGIN("KP MeanSwingLine");
sw = E_TSKPSWINGLINE(High,Low,Close);
Plot(tskp_swmean,"Fat MeanSwing",ParamColor("FatColor",colorLightYellow),ParamStyle("FatStyle",styleLine),0,0,0,0,4); 
_SECTION_END();

_SECTION_BEGIN("KP TrendBias");
/* TSKPTrendBias with TSKPSEB */
Disp1=ParamToggle("Trend Bias","Show|Hide",1);
parmTBStyle = ParamStyle("Trend Bias Style", styleLine | styleThick, maskAll);
parmTBColor = ParamColor("Trend Bias Color", colorRed);
parmTBSlowStyle = ParamStyle("Trend Bias Slow Style", styleLine | styleThick, maskAll);
parmTBSlowColor = ParamColor("Trend Bias Slow Color", colorBlue);
dummy =  E_TSKPTRENDBIAS(High,Low,Close);
KPTB = tskp_sb;
KPTBSlow = tskp_tbxavg;
if(Disp1){
Plot(KPTB, "TB", parmTBColor, parmTBStyle); 
Plot(KPTBSlow, "TBSlow", parmTBSlowColor, parmTBSlowStyle); }
_SECTION_END();

_SECTION_BEGIN("KPAutoStop-KPA900 Trend");
Disp2=ParamToggle("KPAutoStop-KPA900 Trend","Show|Hide",0);
parmASStyle = ParamStyle("AutopStop Style", styleLine | styleThick, maskAll);
parmASColor = ParamColor("AutoStop Color", colorYellow);
parmPA900Style = ParamStyle("KP A900 Style", styleLine | styleThick, maskAll);
parmPA900Color = ParamColor("KP A900 Color", colorWhite);
if(Disp2){
Plot( E_TSKPAUTOSTOP(High,Low,Close) ,"KP AutoStop",parmASColor, parmASStyle);
Plot( E_TSKPA900(Close) , "KP A900", parmPA900Color, parmPA900Style);}
_SECTION_END();

_SECTION_BEGIN("KP Pivots");
Disp3=ParamToggle("KP Pivots","Show|Hide",1);
parmKPPivotHighColor = ParamColor("KP Pivot High",colorBlack);
parmKPPivotLowColor = ParamColor("KP Pivot Low",colorBlack);
CHiPr=0; CLoPr=9999999; blsLong=0;
PrevCOBar=0; NumBars=0; PrePP=0;
PrevLowVal=9999999; BuySig=0; blsShort=0;
PrevHiVal=0; blsNewCO=0; BarDif=0;

KPA900Val = E_TSKPA900(Close);
KPAutoStopVal = E_TSKPAUTOSTOP(High,Low,Close);
// -- Create 0-initialized arrays the size of barcount
aHPivs= H - H; aLPivs= L - L;
aHiVal= H - H; aLoVal= L - L;

Ctmpl= E_TSKPCOLORTMPL(Open,High,Low,Close,Volume);
sctotal= 0;
sctotal= sctotal+ IIf(tskp_colortmplcnd0 > 0, 1, -1); 
sctotal= sctotal+ IIf(tskp_colortmplcnd1 > 0, 1, -1); 
sctotal= sctotal+ IIf(tskp_colortmplcnd2 > 0, 1, -1); 
sctotal= sctotal+ IIf(tskp_colortmplcnd3 > 0, 1, -1); 
sctotal= sctotal+ IIf(tskp_colortmplcnd4 > 0, 1, -1); 
sctotal= sctotal+ IIf(tskp_colortmplcnd5 > 0, 1, -1); 
sctotal= sctotal+ IIf(tskp_colortmplcnd6 > 0, 1, -1); 
sctotal= sctotal+ IIf(tskp_colortmplcnd7 > 0, 1, -1); 
sctotal= sctotal+ IIf(tskp_colortmplcnd8 > 0, 1, -1); 

for (curBar=0; curBar < BarCount-1; curBar++)
{
if ( curBar == 0 )
{
CHiPr=High[curBar];
CHiBar=curBar;
CLoPr=Low[curBar];
CLoBar=curBar;
blsLong=0; blsShort=0;
blsNewCO=0; PrePP=0;
PrevCOBar=0;
PrevHiVal=High[curBar];
PrevLowVal=Low[curBar];
BuySig=0; SellSig=0; blsLL=0;
}
if (High[CurBar] >= CHiPr) {
CHiPr = High[CurBar];
ChiBar = CurBar;
}
if (Low[CurBar] <= CLoPr) {
CLoPr = Low[CurBar];
CLoBar = CurBar;
}
if ( (KPA900Val[curBar] >= KPAutoStopVal[curbar]) AND (PrePP != -1) AND (blsLong != 1) ){
BarDif = CurBar - PrevCOBar;
if (BarDif >= NumBars) {
blsLong=1; blsShort=0;
blsNewCO=1; PrevCOBar = CurBar;}
}
if ( (KPA900Val[curBar] <= KPAutoStopVal[curbar]) AND (PrePP != 1) AND (blsShort != 1) ){
BarDif = CurBar - PrevCOBar;
if (BarDif >= NumBars) {
blsLong=0; blsShort=1;
blsNewCO=1; PrevCOBar=CurBar;}
}
if ( (blsNewCO == 1) AND (sctotal[CurBar] >= 5) AND (blsLong == 1) ) {
LVal = CurBar - CLoBar;
for (j= CLoBar-1; j <= CLoBar+1; j++)
{
if (j >=0) {
aLPivs[j] = 1;
aLoVal[j] = CLoPr;}
}
PrePP=-1;
blsNewCO=0;
CHiPr=High[CurBar];
CHiBar=CurBar;
CLoPr=Low[Curbar];
CLoBar=CurBar;
} 
else if ((blsNewCO == 1) AND (sctotal[CurBar] <= -5) AND (blsShort == 1) ) {
HVal = CurBar - CHiBar;
for (j= CHiBar-1; j <= CHiBar+1; j++)
{		
if (j >=0) {
aHPivs[j] = 1;
aHiVal[j] = CHiPr;}
}
PrePP=1;
blsNewCO=0;
CHiPr=High[CurBar];
CHiBar=CurBar;
CLoPr=Low[Curbar];
CLoBar=CurBar;} 
}
if(Disp3){
PlotShapes(
IIf(aHPivs == 1,shapeSmallCircle,shapeNone),parmKPPivotHighColor,0,aHiVal+0.05,Offset=10);
PlotShapes(
IIf(aLPivs == 1,shapeSmallCircle,shapeNone),parmKPPivotLowColor,0,aLoVal-0.05,Offset=-10);}
_SECTION_END();

_SECTION_BEGIN("KP MoMo's");
/**********************************************************************************************************
This is a  Price Study that displays a DOT based on the folowing:
For a long signal:
    ScoreCardColor is Blue
    KPMedium > Moving Average of KPMedium
    KPFast2 > 0
    KPFast3 > 0
    KPTriggerLine > KPStopLine
    
For a short signal:
    ScoreCardColor is Red
    KPMedium < Moving Average of KPMedium
    KPFast2 < 0
    KPFast3 < 0
    KPTriggerLine < KPStopLine

This signal will reassert itself i.e., display again if one of more of the conditions that trigger go away
and then return to the trigger state.

Note:  This indicator is calculated at the completion of a price bar.  This is different than 
some indicators where the values are calculated/updated upon the arrival
of every tick.  
************************************************************************************************************/

Disp4=ParamToggle("KP MoMo's","Show|Hide",0);
parmMoUpColor = ParamColor("MoUpColor", colorAqua);
parmMoDnColor = ParamColor("MoDnColor", colorRed);
blsLong = 0;
KPStopLine = E_TSKPSTOPLINE(High,Low,Close);
// tskp_upsell, tskp_triggerline, tskp_triggerlinevma
sw = E_TSKPUPSELL(Open,High,Low,Close,Volume);
KPTriggerLine = tskp_triggerline;
KPFast3Val = IIf((E_TSKPFAST3(Open,High,Low,Close,Volume)> 0),1, -1);
//tskp_fast2val1, tskp_fast2val2
dummy = E_TSKPFAST2(Open,High,Low,Close,Volume);
KPFast2Val = IIf ((tskp_fast2val1 > 0),1,-1); 

// tskp_mediumma,tskp_mediumup,tskp_mediumdown
dummy = E_TSKPMEDIUM(Close);
KPMediumUP = tskp_mediumup;
KPMediumDwn = tskp_mediumdown;
KPMediumMA = tskp_mediumma;

for (curBar=5; curBar < BarCount-1; curBar++)
{
if( (blsLong == -1) OR (blsLong == 0))
{
if ((sctotal[CurBar]  >= 5) AND (KPMediumUP[CurBar]  > KPMediumMA[CurBar] ) AND (KPFast3Val[CurBar]  == 1) AND 
(KPFast2Val[CurBar]  == 1) AND (KPTriggerLine[CurBar]  >= KPStopLine[CurBar] ))
{
blsLong = 1;
aLPivs[CurBar] = 1;
aLoVal[CurBar] = Low[CurBar];}
}
if( (blsLong == 1) OR (blsLong == 0))
{
if ((sctotal[CurBar]  <= -5) AND (KPMediumDwn[CurBar]  < KPMediumMA[CurBar] ) AND (KPFast3Val[CurBar]  == -1) AND 
(KPFast2Val[CurBar]  == -1) AND (KPTriggerLine[CurBar]  <= KPStopLine[CurBar] ))
{
blsLong = -1;
aHPivs[Curbar] = 1;
aHiVal[Curbar] = High[Curbar];}
}
if ((blsLong == 1) AND ((sctotal[CurBar]  < 5) OR (KPMediumUP[CurBar]  < KPMediumMA[CurBar] )  OR  
(KPFast2Val[CurBar]  < 1)  OR  (KPFast3Val[CurBar]  < 1) OR (KPTriggerLine[CurBar]  < KPStopLine[CurBar] )) )
{
blsLong= 0;
}
if ((blsLong == -1) AND ((sctotal[CurBar]  > -5)  OR  (KPMediumDwn[CurBar] > KPMediumMA[CurBar] )  OR  
(KPFast2Val[CurBar]  > -1)  OR (KPFast3Val[CurBar]  > -1)  OR 
(KPTriggerLine[CurBar]  > KPStopLine[CurBar] )) )
{
blsLong = 0;}}
if(Disp4){
PlotShapes(
IIf(aHPivs == 1,shapeDownArrow,shapeNone),parmMoDnColor,0,aHiVal+0.00,Offset=-30);
PlotShapes(
IIf(aLPivs == 1,shapeUpArrow,shapeNone),parmMoUpColor,0,aLoVal-0.00,Offset=-30);}
_SECTION_END();

_SECTION_BEGIN("KP PowerPops");
Disp5=ParamToggle("KP PowerPops","Show|Hide",0);
parmPPHighColor = ParamColor("PPHighColor", colorYellow);
parmPPLowColor = ParamColor("PPLowColor", colorYellow);
blsLong = 0;

KP115Val = E_TSKP115SPLIT(High,Low,Close);
KP104Val = E_TSKP104(High,Low,Close); 
dummy = E_TSKPMEDIUM(Close);
KPMediumUpVal = tskp_mediumup;
KPMediumDnVal = tskp_mediumdown;
UpperBand = BBandTop(Close,20,1);
LowerBand = BBandBot(Close,20,1);
swVal = E_TSKPSWINGLINE(High,Low,Close);
MeanSwingLnVal = tskp_swmean;

for (curBar=5; curBar < BarCount-1; curBar++)
{
if (blsLong != 1) {
if( (sctotal[curBar] >= 5) AND (KPMediumUpVal[curBar] > 1.75) AND (Close[curBar] > UpperBand[curBar]) 	
AND (Close[curBar] > KP115Val[curBar]) AND (Close[curBar] > KP104Val[curBar]) 
AND (High[curBar] > High[curBar-3]) AND (Close[curBar] > Close[curBar-3]) 
AND (Close[CurBar] > MeanSwingLnVal[CurBar] ) ){
blsLong = 1;
aLPivs[curBar] =1;
aLoVal[curBar] = Low[curBar];}
}
else if (blsLong != -1) {
if( (sctotal[curBar] <= -5) AND (KPMediumDnVal[curBar] < -1.75) AND (Close[curBar] < LowerBand[curBar]) 	
AND (Close[curBar] < KP115Val[curBar]) AND (Close[curBar] < KP104Val[curBar]) 
AND (Low[curBar] < Low[curBar-3]) AND (Close[curBar] < Close[curBar-3])
AND (Close[curBar] < MeanSwingLnVal[curBar] ) ){
blsLong = -1;
aHPivs[curBar] =1;
aHiVal[curBar] = High[curBar];}}}
if(Disp5){
PlotShapes(
IIf(aHPivs == 1,shapeDownArrow,shapeNone),parmPPHighColor,0,aHiVal+0.00, Offset = -35);
PlotShapes(
IIf(aLPivs == 1,shapeUpArrow,shapeNone),parmPPLowColor,0,aLoVal-0.00, Offset = -35);}
_SECTION_END();

_SECTION_BEGIN("KP Combo");
Disp6=ParamToggle("KP Combo","Show|Hide",0);
Combo = E_TSKPCOMBO(Open,High,Low,Close,Volume);
if(Disp6){
PlotShapes(
IIf( Combo>0, shapeUpArrow, 
IIf(combo<0,shapeDownArrow,shapeNone)), 
IIf(combo>0,colorBlue,colorRed),0,IIf( Combo>0, Low, High ) ); }
_SECTION_END();

_SECTION_BEGIN("KP New UpDown");
Disp7=ParamToggle("KP NewUpDown","Show|Hide",0);
NewUpDown = E_TSKPNEWUPDOWN(Open,High,Low,Close,Volume);
if(Disp7){
PlotShapes( 
IIf( NewUpDown >0, shapeUpArrow, IIf(NewUpDown <0, shapeDownArrow,shapeNone)), 
IIf(NewUpDown >0,colorBlue,colorRed),0,IIf( NewUpDown >0, Low, High ) ); }
_SECTION_END();

_SECTION_BEGIN("KP M Range");
mp=0.5*(High + Low);
tightstop=E_TSKPTIGHTSTOP(High,Low,Close);
stopline=E_TSKPSTOPLINE(High,Low,Close);
Color=colorWhite;
for( i = 0; i < BarCount; i++ ) 
{ 
if( mp[i] > stopline[i] && mp[i] > tightstop[i]  )
Color[i] = colorBlue;
else if(  mp[i] < stopline[i] && mp[i] < tightstop[i])
Color[i] = colorRed;
else
Color[i] = colorWhite;
} 
Plot(0,"MRange0",Color,styleOwnScale|styleArea|styleNoLabel,-0.5, 100 );
Plot(1,"MRange1",Color,styleOwnScale|styleArea|styleNoLabel,-0.5, 100 );
_SECTION_END();

_SECTION_BEGIN("KP TrendBias BackGround");
//Plot Tone
parmToneColorUp=ParamColor("Tone Color Up", colorLightBlue );
parmToneColorDn=ParamColor("Tone Color Dn", colorTan);
RibbonSize=Param("Ribbon Size",10,0.5,10,0.5);
Plot( RibbonSize,"Tone",IIf(KPTB > KPTBSlow,parmToneColorUp,parmToneColorDn),styleOwnScale|styleArea|styleNoLabel,0,10);
_SECTION_END();

9 comments

1. SIRISHA

Hello,

There is an error in the formula in swing line, and it is saying too many arguments.

//Plot(tskp_swmean,“Fat MeanSwing”,ParamColor(“FatColor”,colorLightYellow),ParamStyle(“FatStyle”,styleLine),0,0,0,0,4);

I have also posted the error line, kindly check and post a solution.

Regards, Siri

2. kv_maligi

Hellow,

This is Kwikpop system ( all the codes combined together in bits & pieces). Thanks for sharing. It will be helpful for lots of traders.

If you have buy sell logic, please add/suggest here

SIRISHA,Its working fine after removing last zero in the line mentioned by you.

Viswanath

3. SIRISHA

Hi Vishwanath,

Thanks for the solution you have posted. I would appreciate if you can let me know the procedure for downloading DLL. I have downloaded the file from the link he has provided, but I feel it is some other file.

Regards,
Siri

4. Anonymous

As a wrote SIRISHA, you’ll need at least 5.52! To have no errors…
You have to download this file: http://www.mediafire.com/?znmwud2jdwt
In this file you’ll find the kpami.dll. Put this file in you plugin directory.
Then it should work properly ;-)

Regards,

Ceurami

5. Anonymous

Hi kv_maligi, this is a discretionary trading system. Did you take a look at the intstructional videos that I inserted?
Those videos are gonna get you started for the beginning. Otherwise surf the internet on this item. There are lot of videos and documents you can find on this subject. Hope it helps!

Regards,

Ceurami

6. buchacek

It doesn’t work.
Ctmpl= E_TSKPCOLORTMPL(Open,High,Low,Close,Volume); shows error.
I have 5.9 version and downloaded file but still it shows errors….

7. yo3bl

It works.

I have 5.2 version .
modify line 63 …..
Plot(tskp_swmean,“Fat MeanSwing”,ParamColor(“FatColor”,colorLightYellow),ParamStyle(“FatStyle”,styleLine),0,0,4);

thank you .
Lilian

8. Anonymous

Hi buchacek, you didn’t read the intructions closely enough ;-)
You’ll need the kpami.dll file otherwise it won’t work….

Regards,

Ceurami

9. kv_maligi

Hellow Ceurami,

M Range ribbon is superb & thanks for sharing.

Viswanath

Leave Comment

Please login here to leave a comment.

Back