TTM Squeeze for MT4

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

TTM Squeeze for MT4

Postby logicgate » Mon Jul 15, 2019 1:35 pm

Hi there dear friend Apprentice.

Can you please code this indicator for MT4? Using this formula:

Bollinger Bands AND Keltner Channel define the market
conditions, i.e. when BB is narrower than KC then we have
a market squeeze. When BB break Outside the KC then trade
in the direction of the smoothed Momentum(12).
Formula:
// John Carter's TTM Squeeze Indicator
// Description: Bollinger Bands AND Keltner Channel define the market
// conditions, i.e. when BB is narrower than KC then we have
// a market squeeze. When BB break Outside the KC then trade
// in the direction of the smoothed Momentum(12).
//
// Parameters:
// * chanPeriod - Bollinger Bands AND Keltner Channel length
// * bolBandStdDev - width of the Bollinger Bands
// * keltStdDev - width of the Keltner Bands
// * momPeriod - # of bars for Momentum indicator
// * momEMA - EMA of the Momentum indicator
//
//
// Source : John Carter, www.TradeTheMarkets.com
// Interpretation : Kris Tokarzewski, Johannesburg, 15-Dec-2006
// AmiBroker Conversion: Levent Pancuk, 22 Feb-2008
_SECTION_BEGIN("TTM Squeeze");
function Momentum( array, period )
{
return array - Ref( array, -period );
}
chanPeriod = Param("Channel Period", 20);
bolBandStdDev = Param("Bollinger Band StdDev",2);
keltStdDev = Param("Keltner Band StdDev",1.5);
momPeriod = Param("Momemtum Period", 12 );
momEMA = Param("Momentum EMA Period", 5);
highBBChl = BBandTop( C, chanPeriod, bolBandStdDev);
lowBBChl = BBandBot( C, chanPeriod, bolBandStdDev);
centerLine = MA( C, chanPeriod );
highKeltn = centerLine + keltStdDev * ATR(chanPeriod);
lowKeltn = centerLine - keltStdDev * ATR(chanPeriod);
momHist = EMA(Momentum(C, momPeriod),momEMA);
BBUp = IIf(highBBChl > highKeltn AND momHist > 0, momHist, 0);
BBDo = IIf(lowBBChl < lowKeltn AND momHist < 0, momHist, 0);
BBMid = IIf(BBUp == 0 AND BBDo == 0, momHist, 0);
Buy = BBUp;
Sell = BBDo;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Plot(BBUp, "TTM Squeeze - Momentum Up", colorBlue,styleHistogram |
styleThick);
Plot(BBDo, "Momentum Down", colorOrange, styleHistogram | styleThick);
Plot(BBMid, "Momentum Mid", IIf(BBMid > 0, colorLightBlue, colorBrown),
styleHistogram | styleThick);
PlotShapes( shapeSmallCircle*Buy, colorGreen,0, 0, 0);
PlotShapes( shapeSmallCircle*Sell, colorRed,0, 0, 0);
_SECTION_END();
logicgate
FXCodeBase: Aspirant (Junior)
 
Posts: 680
Joined: Tue Dec 11, 2018 7:54 am

Re: TTM Squeeze for MT4

Postby Apprentice » Thu Jul 18, 2019 4:57 am

Your request is added to the development list under Id Number 4789
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Re: TTM Squeeze for MT4

Postby logicgate » Thu Jul 18, 2019 10:37 am

Apprentice wrote:I think it is already coded:
viewtopic.php?f=38&t=59084&p=88510&hilit=TTMS.mq4#p88510



Hi there my dear friend Apprentice, but I don't think it is the same code. The colors are different.Can you use the code I pasted here to code a new one?

Can you adjust the code so the dots are red when there is a squeeze, and green when it is time to buy or sell? Also, the histogram is supposed to be of different colors, like in this pic attached.
Attachments
2019-07-18-104058_1280x800_scrot.png
2019-07-18-104129_1280x800_scrot.png
logicgate
FXCodeBase: Aspirant (Junior)
 
Posts: 680
Joined: Tue Dec 11, 2018 7:54 am



Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Bing [Bot] and 15 guests