pluggin in amibroker

XRAY27

Well-Known Member
#1
Dear members please tell details regarding this two pluggins

KwikPop,v1.0.0 by Traders syndicate
Greatpig'sTrailing stop plug-in,v1.0.0 by great pig

xray27:thanx:
 

XRAY27

Well-Known Member
#2
no body is there to answer ????
 
#3
dear members please tell details regarding this two pluggins

kwikpop,v1.0.0 by traders syndicate
greatpig'strailing stop plug-in,v1.0.0 by great pig

xray27:thanx:
private message me ...i will send you download link...
 

KelvinHand

Well-Known Member
#4
Found some metastock for KwikPop.
Dont know any similarity with KwikPop,v1.0.0 by Traders syndicate

* KPSBarColor
Code:
FM:=MOV(C,3,E)-MOV(C,10,E);
SM:=MOV(C,4,E)-MOV(C,18,E);
HLTu:=FM>0 AND SM>0;
{ -this will paint the candles blue}
HLTd:=FM<0 AND SM<0;
{ -this will paint the candles red (set candle color to yellow, so you get yellow neutral bars)}
PLRosc:=MOV(TP(),4,S)-MOV(TP(),32,S);
PLRu:= CROSS(PLRosc,0);
{ - This plots the large black up arrows}
PLRd:= CROSS(0,PLRosc);
{ - This plots the large black down arrows}
WBP:=(HHV(HIGH,5)+LLV(LOW,5)+CLOSE)/3;
WV:=SUM(VOLUME,5);
VFORCE:= SUM(((TP()-REF(TP(),-1))/REF(TP(),-1))*VOLUME,13)/SUM(VOLUME,13);
VFORCEup:=IF(PLRu OR PLRd,0,VFORCE);
{ - if plr is true, we only want a large arrow on the bar}
VFORCEdn:=IF(PLRd OR PLRu,0,VFORCE);
{ - if plr is true, we only want a large arrow on the canlde}
FORCEu:=VFORCEup>0;
{ - plots a blue arrow on candles}
FORCEd:=VFORCEdn<0;
{ -plots a red arrow on candles}

{CROWD BIAS  }
N:=16;
POBC1:=(HHV(CLOSE,N)+LLV(CLOSE,N))/2;
POBC2:=(HHV(POBC1,N)+LLV(POBC1,N))/2;
POBC3:=(HHV(POBC2,N)+LLV(POBC2,N))/2;
POBC4:=(HHV(POBC3,N)+LLV(POBC3,N))/2;
POBC5:=(HHV(POBC4,N)+LLV(POBC4,N))/2;
POBC6:=(HHV(POBC5,N)+LLV(POBC5,N))/2;
POBC7:=(HHV(POBC6,N)+LLV(POBC6,N))/2;
POBC8:=(HHV(POBC7,N)+LLV(POBC7,N))/2;
POBC9:=(HHV(POBC8,N)+LLV(POBC8,N))/2;
POBC10:=(HHV(POBC9,N)+LLV(POBC9,N))/2;
AV:= (POBC1+POBC2+POBC3+POBC4+POBC5+POBC6+POBC7+POBC8+POBC9+POBC10)/10;
CBOsc:=100*((CLOSE-AV)/(HHV(CLOSE,10)-LLV(CLOSE,10)));

UpTrend:=CBOsc>0;
{ -plots the blue line and ribbon (use trend in vt)}
DownTrend:=CBOsc<0;
{ -plots the red line and ribbon (use trend in vt)}
Neutral:=CBOsc=0;
* BSPVolume
Code:
THL:=IF(HHV(HIGH,5)-LLV(LOW,5)=0,0.000001,HHV(HIGH,5)-LLV(LOW,5)); 5 period maximum range

STXV:=SUM(V,5);  5 period total volume

BSPV:=SUM(((C-REF(O,-4))/THL)*STXV,20)/SUM(STXV,20);  5 period true range/5 period max range *
5 period total volume i.e. 5 period true volume with direction; higher BSPVabs would indicate
strong price&volume corelation.  

BSPVU:=IF(BSPV>=0,1,null);
{ -This is a bianary osc. plot as histogram, this is the blue plot}
BSPVD:=IF(BSPV<=0,-1,null);
{ -This is a bianary osc. plotted as histogram, this is the red plot}
LN:=0;
* DynamicRS
Code:
WH:=HHV(HIGH,5);
WL:=LLV(LOW,5);
WBP:=(HHV(HIGH,5)+LLV(LOW,5)+CLOSE)/3;

RBAND:=VALUEWHEN(1,CROSS(MOV(WBP,25,S),WBP),
HHV(WH,25));


SBAND:=VALUEWHEN(1,CROSS(WBP,MOV(WBP,25,S)),
LLV(WL,25));

MSWNG:=(RBAND+SBAND)/2;
*FastSlow
Code:
dot:= mov(tp(),1,s);
{ white dots - typical price }

FST:=REF((WILDERS(TP(),5)),-3);
{ white line - shifted 3 periods forward }
SLW:=REF((WILDERS(TP(),13)),-8);
{ yellow line - shifted 8 periods forward }
*KPArrows
Code:
FM:=MOV(C,3,E)-MOV(C,10,E);
SM:=MOV(C,4,E)-MOV(C,18,E);
HLTu:=FM>0 AND SM>0;
{ -this will paint the candles blue}
HLTd:=FM<0 AND SM<0;
{ -this will paint the candles red (set candle color to yellow, so you get yellow neutral bars)}
PLRosc:=MOV(TP(),4,S)-MOV(TP(),32,S);
PLRu:= CROSS(PLRosc,0);
{ - This plots the large black up arrows}
PLRd:= CROSS(0,PLRosc);
{ - This plots the large black down arrows}
WBP:=(HHV(HIGH,5)+LLV(LOW,5)+CLOSE)/3;
VFORCE:= SUM(((TP()-REF(TP(),-1))/REF(TP(),-1))*VOLUME,13)/SUM(VOLUME,13);
VFORCEup:=IF(PLRu OR PLRd,0,VFORCE);
{ - if plr is true, we only want a large arrow on the bar}
VFORCEdn:=IF(PLRd OR PLRu,0,VFORCE);
{ - if plr is true, we only want a large arrow on the canlde}
FORCEu:=VFORCEup>0;
{ - plots a blue arrow on candles}
FORCEd:=VFORCEdn<0;
{ -plots a red arrow on candles}
*KPVForce
Code:
WBP:=(HHV(HIGH,5)+LLV(LOW,5)+CLOSE)/3;
VFORCE:= SUM(((TP()-REF(TP(),-1))/REF(TP(),-1))*VOLUME,13)/SUM(VOLUME,13);
VFORCEup:=IF(PLRu OR PLRd,0,VFORCE);
{ - if plr is true, we only want a large arrow on the bar}
VFORCEdn:=IF(PLRd OR PLRu,0,VFORCE);
{ - if plr is true, we only want a large arrow on the canlde}
FORCEu:=VFORCEup>0;
{ - plots a blue arrow on candles}
FORCEd:=VFORCEdn<0;
{ -plots a red arrow on candles}
*KPVRatio
Code:
THL:=IF(HHV(HIGH,5)-LLV(LOW,5)=0,0.000001,HHV(HIGH,5)-LLV(LOW,5));

VM:=SUM(VOLUME,5);

VIX:=SUM(((((2*C)-HHV(HIGH,5))-LLV(LOW,5)))/(THL)*VM,13)/SUM(VM,13);

VIXu:=IF(VIX>0 AND VIX>0.1300,VIX,null);
{- This gives the blue histo bars that are above .1300}
VIXd:=IF(VIX<0 AND VIX<-0.1300,VIX,null);
{- This gives the red histo bars that are below -.1300}
VIXnu:=IF(VIX>0 AND VIX <0.1300,VIX,null);
{- neutral yellow histo bars (up)}
VIXnd:=IF(VIX<0 AND VIX> -0.1300,VIX,null);
{-neutral yellow histo bars (down)}
TRu:=VIXu;
TRd:=VIXd;
LN:=0;
* Volumomentum
Code:
L1:=(SUM(TP()*VOLUME,12)/SUM(VOLUME,12))-(SUM(TP()*VOLUME,26))/SUM(VOLUME,26);

WBP:=(HHV(HIGH,5)+LLV(LOW,5)+CLOSE)/3;
WV:=SUM(VOLUME,5);

L2:=(SUM(WBP*WV,12)/SUM(WV,12))-(SUM(WBP*WV,26))/SUM(WV,26);

NBP:=(HHV(HIGH,20)+LLV(LOW,20)+CLOSE)/3;
MV:=SUM(VOLUME,20);

L3:=(SUM(NBP*MV,12)/SUM(MV,12))-(SUM(NBP*MV,26))/SUM(MV,26);

VM:=(L1+(L2*2)+(L3*3))/6;

VMU:=IF(VM>0,VM,null);
{ - this will be the blue histo bars}
VMD:=IF(VM<0,VM,null);
{ - this will be the red histo bars}
CC:=MOV(VM,19,E);
CCS:=REF(CC,-2);
{ -Plots the white moving ave, shifted forward 2 periods as a histogram}
LN:=0;
* William%R36
Code:
WH:=HHV(HIGH,5);
WL:=LLV(LOW,5);

WRD:=(( HHV( WH,36 )-c ) /( HHV(WH,36 ) - LLV( WL,36) ) ) *- 100,

WDo:=WRD+50;

WU:=IF(WDo>0,WDo,0);
{-this wil give you the william's when it is above zero and it is plotted blue}
WD:=IF(WDo<0,WDo,0);
{- this will give you the william's when it is below zero and it is plotted red}
LN:=0;
*VRatio
Code:
THL:=IF(HHV(HIGH,5)-LLV(LOW,5)=0,0.000001,HHV(HIGH,5)-LLV(LOW,5));

VM:=SUM(VOLUME,5);

VIX:=SUM(((((2*C)-HHV(HIGH,5))-LLV(LOW,5)))/(THL)*VM,13)/SUM(VM,13);

VIXu:=IF(VIX>0 AND VIX>0.1300,VIX,null);
{- This gives the blue histo bars that are above .1300}
VIXd:=IF(VIX<0 AND VIX<-0.1300,VIX,null);
{- This gives the red histo bars that are below -.1300}
VIXnu:=IF(VIX>0 AND VIX <0.1300,VIX,null);
{- neutral yellow histo bars (up)}
VIXnd:=IF(VIX<0 AND VIX> -0.1300,VIX,null);
{-neutral yellow histo bars (down)}
TRu:=VIXu;
TRd:=VIXd;
LN:=0;
 
Last edited:

KelvinHand

Well-Known Member
#5
Here integrated the following:
- KP Score Card Colors
- KP E Bands
- Pivot High Pivot Low
- KP AutoStop

shown on KPIndicators.pdf

script from wisestocktrader.com

plugin needed - kpami.dll

Code:
_SECTION_BEGIN("KP Score Card Colors");
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 E Bands");
// user parameters
Periods = Param("Standard Error", 80, 1, 200, 1);
Smooth = Param("Smooth",14,2,100,1);
parmMBColor = ParamColor("Color MB",colorPlum);
parmMBStyle = ParamStyle("Style MB", style=styleDashed | styleNoLabel, Mask=maskAll );
parmUBColor = ParamColor("Color UB",colorDarkRed);
parmUBStyle = ParamStyle("Style UB", style=styleLine | styleNoLabel, Mask=maskAll );
parmLBColor = ParamColor("Color LB",colorDarkRed);
parmLBStyle = ParamStyle("Style LB", style=styleLine | styleNoLabel, Mask=maskAll );
ParmCloud = ParamToggle("Cloud", "No|Yes", 0);
parmCloudColor = ParamColor("Cloud Color", ColorRGB( 40,40,40) );
ParmField = ParamField("Field", -1);
parmTT = ParamToggle("Plot Tone/Trend", "No|Yes", 0);
parmToneColorUp = ParamColor("Tone Color Up", ColorRGB(167, 224, 243) );
parmToneColorDn = ParamColor("Tone Color Dn", ColorRGB(255, 192, 203) );
parmTrendColorUp = ParamColor("Trend Color Up", ColorRGB(167, 224, 243) );
parmTrendColorDn = ParamColor("Trend Color Dn", ColorRGB(255, 192, 203) );
RibbonSize = Param("Ribbon Size", 1 , 0.5, 10, 0.5);
SetBarsRequired(700, -1);
// calculations
LRCurve = LinearReg( ParmField, periods );
MALRCurve = MA(LRCurve, Smooth);
SEValue = StdErr( ParmField, periods );
SErrorAvg = MA(SEValue, Smooth);
 
LowerBand = MALRCurve - SErrorAvg ;
UpperBand = MALRCurve + SErrorAvg ;
 
Plot( MALRCurve , "MidBand", parmMBColor , parmMBStyle);
Plot( UpperBand , "UpperBand",parmUBColor ,parmUBStyle );
Plot( LowerBand , "LowerBand", parmLBColor , parmLBStyle);
//paint inside the bands
if(parmCloud == 1)
{
PlotOHLC( UpperBand, UpperBand, LowerBand, LowerBand, "Band", parmCloudColor, styleCloud | styleNoLabel);
}

//paint tone and trend

if(parmTT == 1)
{
PlotOHLC( UpperBand, UpperBand, LowerBand, LowerBand, "Band", IIf(Low > UpperBand, parmTrendColorUp, IIf(High < LowerBand, parmTrendColorDn, parmCloudColor)) , styleCloud | styleNoLabel);
Plot( RibbonSize, "Tone", IIf(Close > MALRCurve, parmToneColorUp, parmToneColorDn) , styleArea | styleNoLabel | styleOwnScale , 0, 10);
}


_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("Pivot High Pivot Low");


//user parameters
parmPlotScoreCard = ParamToggle("Plot KPScoreCard", "No|Yes", 1);
parmPlotA900AutoStop = ParamToggle("Plot A900/AutoStop", "No|Yes", 0);
parmA900Color = ParamColor("A900 Color", colorWhite);
parmA900Style = ParamStyle("A900 Style", styleLine, maskAll);
parmAutoStopColor = ParamColor("AutoStop Color", colorYellow);
parmAutoStopStyle = ParamStyle("AutoStop Style", styleLine, maskAll);
parmPPTextColor = ParamColor("PP Text color", colorBlack);
parmPPTrndColorUp = ParamColor("PP Trend Up color", ColorRGB(167,224,243) );
parmPPTrndColorDn = ParamColor("PP Trend Dwn color", ColorRGB(255,192,203) );
parmPPTextOffSet = Param("PP OffSet", 0.60, 0.40, 1.5, 0.1);
parmTickMultipler = Param("M/W tick allowance", 1, 0, 10, 1);
parmA900AutoStopX = ParamToggle("Plot A900/AutoStop Cross", "No|Yes");
parmA900AutoStopColorX = ParamColor("A900/AutoStop Cross Color", colorBlack);
ParmSCThreshold = Param("ScoreCard Threshold", 3, 1, 9, 1);
parmVoice = ParamToggle("Voice 123 Setups", "No|Yes", 0);
parmAlert = ParamToggle("Alert 123 Setups", "No|Yes", 0);
parmPivotPop = ParamToggle("PivotPop", "No|Yes", 1);
parmBarCancel = Param("Bar Cancel", 7, 1, 20, 1);
parmWaterLevelColor = ParamColor("WalterLevel Color", ColorRGB(127,255,212));
parmWaterLevelStyle = ParamStyle("WaterLevel Style", styleLine, maskAll);
parmBBPeriod = Param("Bollinger Band Period", 10, 2, 30, 1);
parmBBSD = Param("bollinger Band SD", 0.8, 0.2, 3.0);
ParmPlotPPIndicators = ParamToggle("Plot Pivot Pop indicators", "No|Yes", 0);
parmBBColor = ParamColor("BBands Color", colorBlack);
parmBBStyle = ParamStyle("BBands Style", styleLine, maskAll);

ParmDebug = ParamToggle("Debug", "No|Yes", 0);

// constants
_N(PaneName = Name() + Interval(2)+ _SECTION_NAME());
_N(NewBarName = "NewBar" + PaneName);

//functions
function NewBarP()
{
PrevDT = StaticVarGet( NewBarName);
DT = LastValue(DateTime());
StaticVarSet( NewBarName,DT);
return DT != PrevDT;
}
function MRoundP(Number, Multiple )
{
if(Multiple == 0 )
{

xMultiple = 0.01; }
else
{
xMultiple = Multiple;
}
Divided = Number / xMultiple;
intDivided = int(Divided);
intDivided = intDivided + round(Divided - intDivided);
return intDivided * xMultiple;
}

//miscellaneous setups
ObjAB = CreateObject("Broker.Application");
ticker = objAB.Stocks(Name() );
if(ticker.TickSize == 0)
{
TickValue = 0.01; //set TickValue to a penney
}
else
{
TickValue = ticker.TickSize; // use Tick Size for this symbol
}
NewBarSignal = NewBarP();
// KP Indicators
KPA900 = E_TSKPA900(Close);
KPAutoStop = E_TSKPAUTOSTOP(High,Low,Close);
Ctmpl = E_TSKPCOLORTMPL(Open,High,Low,Close,Volume); //ScoreCard
KPScoreCard = 0;
KPScoreCard = KPScoreCard + IIf(tskp_colortmplcnd0 > 0, 1, -1);
KPScoreCard = KPScoreCard + IIf(tskp_colortmplcnd1 > 0, 1, -1);
KPScoreCard = KPScoreCard + IIf(tskp_colortmplcnd2 > 0, 1, -1);
KPScoreCard = KPScoreCard + IIf(tskp_colortmplcnd3 > 0, 1, -1);
KPScoreCard = KPScoreCard + IIf(tskp_colortmplcnd4 > 0, 1, -1);
KPScoreCard = KPScoreCard + IIf(tskp_colortmplcnd5 > 0, 1, -1);
KPScoreCard = KPScoreCard + IIf(tskp_colortmplcnd6 > 0, 1, -1);
KPScoreCard = KPScoreCard + IIf(tskp_colortmplcnd7 > 0, 1, -1);
KPScoreCard = KPScoreCard + IIf(tskp_colortmplcnd8 > 0, 1, -1);

if(parmDebug == 1)
{
printf("a900: %0.6f% \nAutoStop: %0.6f%\nScoreCard: %0.0f%\n", KPA900, KPAutoStop, KPScoreCard);
}
if(parmPlotScoreCard == 1)
{
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g% (%0.4f%) {{VALUES}}", O, H, L, C, SelectedValue( C - Ref(C, -1)) ));
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.2f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
}
Color = IIf(KPScoreCard >= parmSCThreshold, colorBlue, IIf(KPScoreCard <= -parmSCThreshold, colorRed, colorYellow) );
Plot( C, "Close", Color , styleNoTitle | ParamStyle("OHLC Style",styleBar | styleThick) | GetPriceStyle() );
}
//user want A900/AutoStop plotted
if(parmPlotA900AutoStop == 1)
{
Plot(KPA900, "A900", parmA900Color, parmA900Style);
Plot(KPAutoStop, "AutoStop", parmAutoStopColor, parmAutoStopStyle);
}
// find A900/AutoStop cross over/under with ScoreCard confirmation.
XOUp = (KPA900 > KPAutoStop) AND (KPScoreCard >= parmSCThreshold); // New Pivot Low
XODn = (KPA900 < KPAutoStop) AND (KPScoreCard <= -parmSCThreshold); // New Pivot High
if(parmDebug == 1)
{
printf(WriteIf(XOUp, "before= XOUp: True", "before= XOUp: False") + WriteIf(XODn, " XODn: True\n", " XODn: False\n") );
}
//remove duplicate signals
XOUp = ExRem(XOUp, XODn);
XODn = ExRem(XODn, XOUp);

if(parmDebug == 1)
{
printf(WriteIf(XOUp, "after= XOUp: True", "after= XOUp: False") + WriteIf(XODn, " XODn: True\n", " XODn: False\n") );
}
//find the current Pivot Points - PL and PH
//remember XOUp = 1 means a PL and XODn =1 means a PH
PLBars = IIf(XOUp, LowestSinceBars(XODn, L ,1), 0); //find the bar that produced the Lowest Low
PHBars = IIf(XODn, HighestSinceBars(XOUp, H, 1),0); //find the bar that produced the Highest High
//PLPrice = IIf(XOUp, Ref(L, -PLBars), 0);
//PHPrice = IIf(XODn, Ref(H, -PHBars),0);
PLPrice = Ref(L, -PLBars);
PHPrice = Ref(H, -PHBars);

//keep track of the previous Pivot Points
PrevPLBars = Ref(BarsSince(XOUp), -1) +1;
PrevPHBars = Ref(BarsSince(XODn), -1) +1;
PrevPLPrice = Ref(PLPrice, -prevPLBars);
PrevPHPrice = Ref(PHPrice, -PrevPHBars );
PivotsCloseEnough = TickValue * parmTickMultipler;
PLDifference = MroundP(PLPrice - PRevPLPrice, ticker.TickSize);
PHDifference = MroundP(PHPrice - PrevPHPrice, ticker.TickSize);
PPTrend = IIf(XOUp AND (PLDifference > PivotsCloseEnough) AND PrevPHPrice > PrevPLPrice AND PRevPHPrice > PLPrice, 1,
IIf(XOUp AND (PLDifference < - PivotsCloseEnough) AND PRevPHPrice > PrevPLPrice AND PrevPHPrice > PLPrice, -1,
IIf(XODn AND (PHDifference > PivotsCloseEnough) AND PrevPLPrice < PrevPHprice AND PrevPLPrice < PHPrice, 1,
IIf(XODn AND (PHDifference < -PivotsCloseEnough) AND PrevPLPrice < PrevPHPrice AND PrevPLPrice < PHPrice, -1,
IIf(XOUp AND (abs(PLDifference) <= PivotsCloseEnough) AND PrevPHPrice > PrevPLPrice AND PRevPHPrice > PLPrice, 2,
IIf(XODn AND (abs(PHDifference) <= PivotsCloseEnough) AND PrevPLPrice < PrevPHPrice AND PrevPLPrice < PHPrice, -2, 0)))) ));
if(ParmDebug)
{
printf("Current PH Bar: %g% /Price: %g%\n", PHBars, PHPrice);
printf("Current PL Bar: %g% /Price: %g%\n", PLBars, PLPrice);
printf("Previous PH Bar: %g% /Price: %g%\n", PrevPHBars, PrevPHPrice);
printf("Previous PL Bar: %g% /Price: %g%\n", PrevPLBars, PrevPLPrice) ;
printf("PP Trend: %g%\n", PPTrend);
printf("PHPrice - PrevPHPrice: %g%\nPLPrice - PrevPLPrice: %g%\nPivotsCloseEnough: %g%", PHDifference, PLDifference, PivotsCloseEnough);
}
//PLot pivots as text
dist = parmPPTextOffSet * ATR(10);
//for( i = 0; i < BarCount -1; i++)
for( i = 0; i < BarCount ; i++)
{
if(XOUp[i ] == 1 AND abs(PPTrend[i]) != 2) //cross up -plot the Pivot Low
{
PlotText("PL", i - PLBars[i], PLPrice[i] - dist[i] , parmPPTextColor, IIf(PPTrend[i] == 1, parmPPTrndColorUp, IIf(PPTrend[i] == -1, parmPPTrndColorDn, colorYellow) ));
}
if(XODn[i ] == 1 AND abs(PPTrend[i]) != 2) //cross down - plot the pivot high
{
PlotText("PH", i - PHBars[i], PHPrice[i] + dist[i], parmPPTextColor, IIf(PPTrend[i] == 1, parmPPTrndColorUp, IIf(PPTrend[i] == -1, parmPPTrndColorDn, colorYellow) ));
}
if(XOUp[i ] == 1 AND (PPTrend[i]) == 2) // the Pivot Low is a W Bottom
{
PlotText("PW", i - PLBars[i], PLPrice[i] - dist[i] , parmPPTextColor, colorYellow) ;
}
if(XODn[i ] == 1 AND PPTrend[i] == -2) //cross down - pivot high is a M Top
{
PlotText("PM", i - PHBars[i], PHPrice[i] + dist[i], parmPPTextColor, colorYellow) ;
}
} //end For
_SECTION_END();
 
Last edited:

KelvinHand

Well-Known Member
#6
Indicator - KPSnapBack

Code:
_SECTION_BEGIN("KPSnapBack");

LenDPO = 8;

Len1=8;
Len2=16;
Len3=3;

sw = E_TSKPUPSELL(Open,High,Low,Close,Volume);
KPTriggerLine = tskp_triggerline;
Detrend = KPTriggerLine - MA(KPTriggerLine, LenDPO);	//Detrend KPTriggerLine
Detrend1 = EMA(Detrend, Len1);
Detrend2 = EMA(Detrend, Len2);
KPSnapBack = EMA(Detrend, Len3);

Color = IIf(KPSnapBack > Detrend2, colorBlue, 
        IIf(KPSnapBack < Detrend2, colorRed, colorGrey40));
 
Plot(WMA( KPSnapBack , 6), "Smoothed", colorWhite);

Plot (KPSnapBack, "KPSnapBack", Color, styleHistogram|styleThick);
Plot(0, "", colorDarkGrey);
_SECTION_END();
 
Last edited:

KelvinHand

Well-Known Member
#7
Indicator - KPFast2
Code:
_SECTION_BEGIN("KPFast2");
SetChartBkColor(ParamColor("Panel Color",colorBlack));
SetChartBkGradientFill(ParamColor("Upper Chart",colorBlack),ParamColor("Lower Chart",colorBlack));

//tskp_fast2val1, tskp_fast2val2
dummy=E_TSKPFAST2(Open,High,Low,Close,Volume);
Plot(tskp_fast2val1,"Fast2_1",ParamColor("ColorUp",colorBlue),ParamStyle("Style",style=styleHistogram|styleThick,maskDefault));
Plot(tskp_fast2val2,"Fast_2",ParamColor("ColorDown",colorRed),ParamStyle("Style",style=styleHistogram|styleThick,maskDefault));
Plot(0,"0",ParamColor("Zero Line",colorGrey50),styleLine);
_SECTION_END()
 

KelvinHand

Well-Known Member
#8
Indicator - KPVS

This indicator required OpenInt (eg. Futures ), otherwise only positive volume will display
color shown only Blue and Yellow. Hope someone show the future chart of this KPVS.

I hope this is correct
Code:
_SECTION_BEGIN("KPVS");
SetChartBkColor(ParamColor("Panel Color",colorBlack));
SetChartBkGradientFill(ParamColor("Upper Chart",colorBlack),ParamColor("Lower Chart",colorBlack));

VRLength=10;
VRMALength=12;
VSLength=10;

Var5 = Sum( Volume  -  OpenInt , VRLength);
Var6 = MA(Var5, VRMALength);
Var7 = Sum( Volume  -  OpenInt , VSLength);

Color = IIf( (Var7<0 AND Var7> Var6) OR (Var7<Var6 AND Var7> 0),  colorYellow,
			  IIf(Var7 > Var6,  colorBlue,
				 IIf(Var7 < Var6,  colorRed, colorYellow)));

Plot(Var7, "VS", color, styleHistogram|styleThick);
Plot(WMA(Var7, 6), "VS2", colorWhite);

_SECTION_END();
 

KelvinHand

Well-Known Member
#9
Here integrated the following:
- KP Score Card Colors
- KP E Bands
- Pivot High Pivot Low
- KP AutoStop

shown on KPIndicators.pdf

script from wisestocktrader.com

plugin needed - kpami.dll
There exist a problem when CreateObject("Broker.Application") is used. Resulted new added script will always crash.
Amibroker had a internal variable called TickSize that can be use.
So the following code replace the ticker.ticksize to ticksize in Post #5.

Code:
_SECTION_BEGIN("Pivot High Pivot Low");

//user parameters
parmPlotScoreCard = ParamToggle("KPScoreCard PaintBar", "No|Yes", 1);
parmPlotA900AutoStop = ParamToggle("Show AutoStop", "No|Yes", 1);

//parmA900Color = ParamColor("A900 Color", colorWhite);
//parmA900Style = ParamStyle("A900 Style", styleLine, maskAll);

parmAutoStopColor = ParamColor("AutoStop Color", colorAqua);
parmAutoStopStyle = ParamStyle("AutoStop Style", styleThick, maskAll);

parmPPTextColor = ParamColor("PP Text color", colorBlack);
parmPPTrndColorUp = ParamColor("PP Trend Up color", ColorRGB(167,224,243) );
parmPPTrndColorDn = ParamColor("PP Trend Dwn color", ColorRGB(255,192,203) );
parmPPTextOffSet = Param("PP OffSet", 0.60, 0.40, 1.5, 0.1);

parmTickMultipler = Param("M/W tick allowance", 1, 0, 10, 1);
//parmA900AutoStopX = ParamToggle("Plot A900/AutoStop Cross", "No|Yes");
//parmA900AutoStopColorX = ParamColor("A900/AutoStop Cross Color", colorBlack);
ParmSCThreshold = Param("ScoreCard Threshold", 3, 1, 9, 1);

// constants
_N(PaneName = Name() + Interval(2)+ _SECTION_NAME());
_N(NewBarName = "NewBar" + PaneName);

//functions
function NewBarP()
{
PrevDT = StaticVarGet( NewBarName);
DT = LastValue(DateTime());
StaticVarSet( NewBarName,DT);
return DT != PrevDT;
}
function MRoundP(Number, Multiple )
{
if(Multiple == 0 )
{

xMultiple = 0.01; }
else
{
xMultiple = Multiple;
}
Divided = Number / xMultiple;
intDivided = int(Divided);
intDivided = intDivided + round(Divided - intDivided);
return intDivided * xMultiple;
}

if(TickSize == 0)
  TickValue = 0.01; //set TickValue to a penney
else
  TickValue = TickSize; // use Tick Size for this symbol

NewBarSignal = NewBarP();

// KP Indicators
KPA900 = E_TSKPA900(Close);
KPAutoStop = E_TSKPAUTOSTOP(High,Low,Close);
Ctmpl = E_TSKPCOLORTMPL(Open,High,Low,Close,Volume); //ScoreCard
KPScoreCard = 0;
KPScoreCard +=IIf(tskp_colortmplcnd0 > 0, 1, -1);
KPScoreCard +=IIf(tskp_colortmplcnd1 > 0, 1, -1);
KPScoreCard +=IIf(tskp_colortmplcnd2 > 0, 1, -1);
KPScoreCard +=IIf(tskp_colortmplcnd3 > 0, 1, -1);
KPScoreCard +=IIf(tskp_colortmplcnd4 > 0, 1, -1);
KPScoreCard +=IIf(tskp_colortmplcnd5 > 0, 1, -1);
KPScoreCard +=IIf(tskp_colortmplcnd6 > 0, 1, -1);
KPScoreCard +=IIf(tskp_colortmplcnd7 > 0, 1, -1);
KPScoreCard +=IIf(tskp_colortmplcnd8 > 0, 1, -1);

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g% (%0.4f%) {{VALUES}}", O, H, L, C, SelectedValue( C - Ref(C, -1)) ));
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.2f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
}

if(parmPlotScoreCard == 1)
{
Color = IIf(KPScoreCard >= parmSCThreshold, colorBlue, IIf(KPScoreCard <= -parmSCThreshold, colorRed, colorYellow) );
}
else
{
Color = IIf(C>O, colorBlue, IIf(C<O, colorRed, colorGrey40) );
}

Plot( C, "Close", Color , styleNoTitle | ParamStyle("OHLC Style",styleBar | styleThick) | GetPriceStyle() );

//user want A900/AutoStop plotted
if(parmPlotA900AutoStop == 1)
{
//Plot(KPA900, "A900", parmA900Color, parmA900Style);
Plot(KPAutoStop, "AutoStop", parmAutoStopColor, parmAutoStopStyle);
}
// find A900/AutoStop cross over/under with ScoreCard confirmation.
XOUp = (KPA900 > KPAutoStop) AND (KPScoreCard >= parmSCThreshold); // New Pivot Low
XODn = (KPA900 < KPAutoStop) AND (KPScoreCard <= -parmSCThreshold); // New Pivot High
//remove duplicate signals
XOUp = ExRem(XOUp, XODn);
XODn = ExRem(XODn, XOUp);

//find the current Pivot Points - PL and PH
//remember XOUp = 1 means a PL and XODn =1 means a PH
PLBars = IIf(XOUp, LowestSinceBars(XODn, L ,1), 0); //find the bar that produced the Lowest Low
PHBars = IIf(XODn, HighestSinceBars(XOUp, H, 1),0); //find the bar that produced the Highest High
//PLPrice = IIf(XOUp, Ref(L, -PLBars), 0);
//PHPrice = IIf(XODn, Ref(H, -PHBars),0);
PLPrice = Ref(L, -PLBars);
PHPrice = Ref(H, -PHBars);

//keep track of the previous Pivot Points
PrevPLBars = Ref(BarsSince(XOUp), -1) +1;
PrevPHBars = Ref(BarsSince(XODn), -1) +1;
PrevPLPrice = Ref(PLPrice, -prevPLBars);
PrevPHPrice = Ref(PHPrice, -PrevPHBars );
PivotsCloseEnough = TickValue * parmTickMultipler;
PLDifference = MroundP(PLPrice - PRevPLPrice, TickSize);
PHDifference = MroundP(PHPrice - PrevPHPrice, TickSize);
PPTrend = IIf(XOUp AND (PLDifference > PivotsCloseEnough) AND PrevPHPrice > PrevPLPrice AND PRevPHPrice > PLPrice, 1,
IIf(XOUp AND (PLDifference < - PivotsCloseEnough) AND PRevPHPrice > PrevPLPrice AND PrevPHPrice > PLPrice, -1,
IIf(XODn AND (PHDifference > PivotsCloseEnough) AND PrevPLPrice < PrevPHprice AND PrevPLPrice < PHPrice, 1,
IIf(XODn AND (PHDifference < -PivotsCloseEnough) AND PrevPLPrice < PrevPHPrice AND PrevPLPrice < PHPrice, -1,
IIf(XOUp AND (abs(PLDifference) <= PivotsCloseEnough) AND PrevPHPrice > PrevPLPrice AND PRevPHPrice > PLPrice, 2,
IIf(XODn AND (abs(PHDifference) <= PivotsCloseEnough) AND PrevPLPrice < PrevPHPrice AND PrevPLPrice < PHPrice, -2, 0)))) ));

//PLot pivots as text
dist = parmPPTextOffSet * ATR(10);
//for( i = 0; i < BarCount -1; i++)
for( i = 0; i < BarCount ; i++)
{
if(XOUp[i ] == 1 AND abs(PPTrend[i]) != 2) //cross up -plot the Pivot Low
{
PlotText("PL", i - PLBars[i], PLPrice[i] - dist[i] , parmPPTextColor, IIf(PPTrend[i] == 1, parmPPTrndColorUp, IIf(PPTrend[i] == -1, parmPPTrndColorDn, colorYellow) ));
}
if(XODn[i ] == 1 AND abs(PPTrend[i]) != 2) //cross down - plot the pivot high
{
PlotText("PH", i - PHBars[i], PHPrice[i] + dist[i], parmPPTextColor, IIf(PPTrend[i] == 1, parmPPTrndColorUp, IIf(PPTrend[i] == -1, parmPPTrndColorDn, colorYellow) ));
}
if(XOUp[i ] == 1 AND (PPTrend[i]) == 2) // the Pivot Low is a W Bottom
{
PlotText("PW", i - PLBars[i], PLPrice[i] - dist[i] , parmPPTextColor, colorYellow) ;
}
if(XODn[i ] == 1 AND PPTrend[i] == -2) //cross down - pivot high is a M Top
{
PlotText("PM", i - PHBars[i], PHPrice[i] + dist[i], parmPPTextColor, colorYellow) ;
}
} //end For
_SECTION_END();

_SECTION_BEGIN("KP E Bands");
// user parameters
Periods = Param("Standard Error", 30, 1, 200, 1);
Smooth = Param("Smooth",20,2,100,1);
parmMBColor = ParamColor("Color MB",colorPlum);
parmMBStyle = ParamStyle("Style MB", style=styleDashed | styleNoLabel, Mask=maskAll );
parmUBColor = ParamColor("Color UB",colorDarkRed);
parmUBStyle = ParamStyle("Style UB", style=styleLine | styleNoLabel, Mask=maskAll );
parmLBColor = ParamColor("Color LB",colorDarkRed);
parmLBStyle = ParamStyle("Style LB", style=styleLine | styleNoLabel, Mask=maskAll );
ParmCloud = ParamToggle("Cloud", "No|Yes", 1);
parmCloudColor = ParamColor("Cloud Color", ColorRGB( 40,40,40) );
ParmField = ParamField("Field", -1);
parmTT = ParamToggle("Plot Tone/Trend", "No|Yes", 0);
parmToneColorUp = ParamColor("Tone Color Up", ColorRGB(167, 224, 243) );
parmToneColorDn = ParamColor("Tone Color Dn", ColorRGB(255, 192, 203) );
parmTrendColorUp = ParamColor("Trend Color Up", ColorRGB(167, 224, 243) );
parmTrendColorDn = ParamColor("Trend Color Dn", ColorRGB(255, 192, 203) );
RibbonSize = Param("Ribbon Size", 1 , 0.5, 10, 0.5);
SetBarsRequired(700, -1);
// calculations
LRCurve = LinearReg( ParmField, periods );
MALRCurve = MA(LRCurve, Smooth);
SEValue = StdErr( ParmField, periods );
SErrorAvg = MA(SEValue, Smooth);
 
LowerBand = MALRCurve - SErrorAvg ;
UpperBand = MALRCurve + SErrorAvg ;
 
Plot( MALRCurve , "MidBand", parmMBColor , parmMBStyle);
Plot( UpperBand , "UpperBand",parmUBColor ,parmUBStyle );
Plot( LowerBand , "LowerBand", parmLBColor , parmLBStyle);
//paint inside the bands
if(parmCloud == 1)
{
PlotOHLC( UpperBand, UpperBand, LowerBand, LowerBand, "Band", parmCloudColor, styleCloud | styleNoLabel);
}

//paint tone and trend

if(parmTT == 1)
{
PlotOHLC( UpperBand, UpperBand, LowerBand, LowerBand, "Band", IIf(Low > UpperBand, parmTrendColorUp, IIf(High < LowerBand, parmTrendColorDn, parmCloudColor)) , styleCloud | styleNoLabel);
Plot( RibbonSize, "Tone", IIf(Close > MALRCurve, parmToneColorUp, parmToneColorDn) , styleArea | styleNoLabel | styleOwnScale , 0, 10);
}


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

Similar threads

Intraday Higher Leverage

Save up to 90% in brokerage and get higher leverage for intraday trades.

Name:Phone:
Email:City:
State:
Are you a day trader?