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 TTM Squeeze for Amibroker (AFL)
buchacek
almost 12 years ago
Amibroker (AFL)

Rating:
2 / 5 (Votes 5)
Tags:
amibroker, kwikpop

This formula is for KwikPOP users.
This is an original formula posted by ‘kaiji’ some three years ago. I just improved positions of the buy/sell signals and added KwikPOP up/down background colors and KP M Range to improve the performance of the oscillator. This indicator works extremely well with KwikPOP main chart on 60 min timeframe for @ES futures. It can be used for 15 min or 3500 and 7500 Volume charts but the best is 60 min because when Squeeze develops on 60 min @ES it really means something already.
Combine oscillator with background colors and KP M Range for earlier entry ( before the signal triangles appear).
If you don’t have kpami.dll plugin then you can delete KP Trend Bias Background and KP M Range from the formula and use it as it is.
Again-shapeHollowSmallDownTriangle means shapeDownTriangle in my Amibroker software. So if you get small hollow triangle from the formula in your software then change it to shapeDownTriangle.
Note: All credits go to ‘kaiji’ for posting this excellent indicator and ‘ceurami’ for KwikPOP indicators.
I just combined them together for easier trading.
If the TTM Squeeze indicator is new to you go to youtube and there are many videos how to use it.
It can be used in two ways :
1) squeeze (as in videos) Squeeze is the RED color DOTS on the Alert Line.(BB inside KB), Aqua dots ( no squeeze) means BB outside KB, then trade the histogram either up or down.
2) buying or getting ready on the change from RED histogram to YELLOW histogram.
Momentum changes from red to yellow already and almost in 90 % of all time it will result in a buy signal latter on . This is especially true if there is no squeeze and the Alert line is in Aqua color. ( you can change the color to green if you want). Buying the yellow histogram is good for even lesser timeframes or 3500 and 7500 Volume chart on @ES.
Generally, wait for the squeeze to develop on 60 min timeframe,then trade the histogram either way. On lesser timeframes you can trade the yellow histogram already and especially if you have a signal on KP Medium Indicator, KP Fast2 Indicator is BLUE and the KP M Range is turning from RED to WHITE . Then double your position when the background color turns BLUE, KP M Range turns BLUE and the blue triangle appears on the histogram. The opposite is for the shorting – it goes from purple to red colors etc… But purple means we are still in a positive territory so caution must be exercised here.The best way to short is from the RED histogram down – on 7500 Volume chart or 60 min timeframe on @ES futures.
Position of the Arrows (not triangles) can be done by changing the value of ‘myma’ moving average. You can tune it by the timeframe you trade but value of 10 seems to work well. They are not buying arrows but show the relation between the histogram and its moving average. But on 3500 or 7500 Volume charts on @ES they could be the buy arrows ( yellow ones). In an uptrend if histogram goes from blue to purple and then if there is the Squeeze – add more contracts on the first blue bar for one more push.
Note:KP Fast2 Indicator is added in this formula too and you can enable it on 3500,7500 volume charts on @ES or lesser timeframes – up to 5 min charts(2min and 3min is great). Don’t do it from 10 to 60 min charts and up.ShapeDigit1 signal signifies the first Blue or the first Red bar on KP Fast2 Indicator and it is the first positive signal in trading the Yellow Histogram or the first negative signal to trade the Purple Histogram. The lines can be even made invisible and leave only the ShapeDigit1 signals there(especially on higher timeframes) with offset= 0. With this you’ll get four Indicators measuring different things in one formula and save the space on your monitor. All of this makes it far easier to trade TTM Squeeze Indicator.

Similar Indicators / Formulas

KP Medium With buy/sell signals
Submitted by buchacek almost 12 years ago
KPBB htrsystem
Submitted by jaipal7786 almost 12 years ago
Kwik*Pop - KPSnapBack
Submitted by kelvinhand over 11 years ago
PIVOT HIGH-LOW AFL
Submitted by anandnst almost 12 years ago
KP Trigger Cloud
Submitted by buchacek almost 12 years ago
bad tick clean
Submitted by pious243 over 11 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("The Squeeze");
SetChartBkColor(ParamColor("Panel Color",colorLightGrey));
SetChartBkGradientFill(ParamColor("Upper Chart",colorLightGrey),ParamColor("Lower Chart",colorLightGrey));

SetChartOptions( 0, chartShowDates|chartWrapTitle );
Price = Close;
Length = Param("ATR Length",20,2,100,1); // { Length for Average True Range (ATR)}
Lenght1 = Param("SD Length",20,2,100,1); // { Std. Deviation (SD) Calcs }
nK = Param("Channel ATRs",1.4,0.1,2,0.1); //{ Keltner Channel ATRs from Average }
nBB = Param("BB Std Devs",2,0.1,3,0.1); // { Bollinger Band Std. Devs. from Average }
AlertLine = Param("AlertLine",1,0,3,1); //{ BBS_Index level at which to issue alerts }
NormalColor = 4; //{ Normal color for BBS_Ind }
AlertlColor = 10;// Color for BBS_Ind below alert line }
LHMult = Nz(PointValue/TickSize);
//{-- Calculate BB Squeeze Indicator ----------------------}
AvgTrueRange = ATR(Length);
SDev = StDev(Price, Length);
Denom = nK*AvgTrueRange;
BBS_Ind = Nz((nBB * SDev) /Denom);
SetPlotColor = IIf( BBS_Ind < Alertline, NormalColor, AlertlColor);
BBcrossDown = Cross(AlertLine,BBS_Ind);
BBcrossUp = Cross(BBS_Ind,AlertLine);
Plot(0, "BBS_Ind", SetPlotColor, styleDots|styleThick | styleNoRescale |styleNoLabel );
//{-- Plot delta of price from Donchian mid line ----------}
value2 = LinearReg( price-((HHV(H, Lenght1)+LLV(L, Lenght1))/2+ MA(C,Lenght1))/2, Lenght1);
color = IIf( value2 > 0, IIf( value2 > Ref(value2,-1), colorBlue, 12), IIf( value2 < 0, IIf( value2 < Ref(value2,-1), ParamColor("UpColor",colorRed ), colorYellow ), colorYellow ));
myma=WMA(Value2,10);
//Plot(value2*LHMult, "NickmNxtMove", color, styleBar | styleThick|styleOwnScale );
Plot(value2,"BB Squeeze",color, styleArea | styleThick);
PlotShapes( IIf( Cross(Value2, 0), shapeHollowSmallDownTriangle+ shapePositionAbove, shapeNone ), 29,0,Offset=0 );
PlotShapes( IIf( Cross(0, Value2), shapeUpTriangle+ shapePositionAbove, shapeNone ), 32,0,Offset=0);
PlotShapes(IIf(Cross(myma,value2),shapeuparrow+ shapePositionAbove, shapeNone ), 12,0,Offset=myma);
PlotShapes(IIf(Cross(Value2 ,myma),shapedownarrow+ shapePositionAbove, shapeNone ),7 ,0,Offset=myma,-10);
//Plot(myma,"",5,styleLine|styleThick);
//{-- Issue Alert when the Squeeze is On ------------------}
"ALERT";
//Write alerts to Interpretation window
//Ticker = Name();
//WriteIf(BBcrossDown,Ticker + " " + "BB Squeeze Alert" ,WriteIf(BBcrossUp,Ticker + " " + "BB Squeeze Is Over",""));
//Write alerts to Alert Output window
//AlertIf(BBcrossDown,"","BB Squeeze Alert",0);
//AlertIf(BBcrossUp,"","BB Squeeze Is Over",0);
//Sound alerts
//AlertIf( BBcrossDown, "SOUND C:\\Windows\\Media\\RINGIN.WAV", "Audio alert", 2 );
//AlertIf( BBcrossUp, "SOUND C:\\Windows\\Media\\RINGIN.WAV", "Audio alert", 2 );
//Write text to screen
//ytext = 0.01;
/*
or(i=1;i<BarCount;i++)
{
If(BBcrossDown[i])
{

PlotText("ON",i,-ytext[i],colorWhite);
}

if(BBcrossUp[i])

{

PlotText("OFF",i,ytext[i],colorWhite);

}

}

*/

//PlotShapes(shapeUpArrow*BBcrossDown,colorWhite,0,0);
//PlotShapes(shapeDownArrow*BBcrossup,colorWhite,0,0);
_SECTION_END();

/*_SECTION_BEGIN("KP Fast 2");
//SetChartBkColor(ParamColor("Panel Color",colorLightGrey));
//SetChartBkGradientFill(ParamColor("Upper Chart",colorLightGrey),ParamColor("Lower Chart",colorLightGrey));
//tskp_fast2val1, tskp_fast2val2
dummy=E_TSKPFAST2(Open,High,Low,Close,Volume);
Plot(tskp_fast2val1,"Fast2_1",ParamColor("ColorUp",colorBlue),styleLine|styleThick); 
Plot( tskp_fast2val2,"Fast2_2",ParamColor("ColorDown",colorRed),styleLine|styleThick); 
PlotShapes(IIf(Cross(tskp_fast2val1,0),shapeDigit1+ shapePositionAbove, shapeNone ), 29,0,Offset=tskp_fast2val1,-12 ); 
PlotShapes(IIf(Cross(0,tskp_fast2val2),shapeDigit1+ shapePositionAbove, shapeNone ), 4,0,Offset=tskp_fast2val2,12 );
//Plot(0,"",ParamColor("Zero Line",colorGrey50),styleLine|styleNoLabel);
//Title =FullName();
_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,"",Color,styleOwnScale|styleArea|styleNoLabel,0, 90 );
Plot(7,"",Color,styleOwnScale|styleArea|styleNoLabel,0, 90 );
_SECTION_END();


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



5 comments

1. buchacek

The stated 3500 volume chart on @ES should be 3350 volume chart.

2. anup82

tightstop=E_TSKPTIGHTSTOP(High,Low,Close); ( ERROR CAN U SOLVE PLZ

3. buchacek

anup82 – there are no errors in this formula.
You have to have an appropriate plugin. Go to Pivot High/Low formula just below this one for an instruction where to get it.
Otherwise you can use this one also but you would have to delete KwikPOP indicators but they are of a great benefit in here.
Note: if anybody uses this indicator and doesn’t like the lines of KP Fast2 Indicator just input |stylenoline after the styleline and use only digit shapes. Offset them to 0 if you like but change the blue color to bright green.

4. buchacek

rob hoot- my e-mail is: milosbuchacek@yahoo.com
regards

5. pk55

Works very good with Amibroker 6.00.2

Leave Comment

Please login here to leave a comment.

Back