Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

Minetoo

Screaming Fast Moving Average

Recommended Posts

Here's a quick and dirty one I threw together per Hull's original formula. MC compiled it fine.

 

Watch your step with things like this, as it's really just a bandpass filter that's been scaled back up to price. These type of filters work great as long as you're in the middle of the passband, but as soon as you stray to one side you get some pretty vicious phase shifting going on.

 

I don't care for the input of this indicator, as it takes the low cutoff as input and calcs the high cutoff from that. Doesn't tell you anything about where the passband center is unless you calc it by hand yourself. (e.g ~11 for this default input of Len 15). Might be better to choose an arbitrary low cutoff, input your desired passband center, and calc the high cutoff from there.

 

Inputs:

Price(MedianPrice),

Len(15);

 

Vars:

FastLen(0),

FastMA(0),

SlowMA(0),

SmoothLen(0),

filter(0);

 

 

FastLen=Round((Len/2),0);

SmoothLen=Round(SquareRoot(Len),0);

FastMA=2*WAverage(Price,FastLen); // 2* scales oscillator back to price

SlowMA=WAverage(Price,Len);

filter=WAverage(FastMA-SlowMA,SmoothLen);

 

Plot1(filter,"avg");

Share this post


Link to post
Share on other sites

Here is a strategy that I programmed with the help of great individuals on the TS forums, Origional programming was found on TS forums and posted on this thread already.

 

This uses a color change of a smaller HMA and a larger HMA as a filter for direction, also, times are included so you can set start and end times for day trading.

 

Jim

 

inputs: price(Close), jthmaLength( 21), jthmaLength2(84),

startTime(0500), endTime(1600), EnterTradeEndTime(1600);

 

variables: Avg( 0 ), Avg2( 0 ), Avg2Up( false ),

Avg2Dn( false ),MP( 0 ),AvgUp( false ), AvgDn( false );

 

MP = MarketPosition;

Avg = jthma( price, jthmaLength ) ;

Avg2 = jthma( price, jthmaLength2 );

Avg2Up = Avg2 > Avg2[1];

Avg2Dn = Avg2 < Avg2[1];

AvgUp = Avg[2]> Avg[1] and Avg > Avg[1];

AvgDn = Avg[2]< Avg[1] and Avg < Avg[1];

 

{buy, sell short Criteria}

If Time > startTime and Time < EnterTradeEndTime then begin

 

if AvgUp and Avg2Up then

Buy ( "jup" ) next bar at market ;

 

if AvgDn and Avg2Dn then

sell short ( "jdn" ) next bar at market ;

end;

 

{sell, buy to cover Criteria}

If MP = 1 and AvgDn then sell next bar at market;

If MP = -1 and AvgUp then buy to cover next bar at market;

 

if time = endtime and MP > 0 then sell this bar on close;

if time = endtime and MP < 0 then buy to cover this bar on close;

+JTHMA STRATEGY+FILTER.ELD

Share this post


Link to post
Share on other sites

If you want to lead the price on most occasions, take the volume ratio and run it through the jthma(volumeratioavg,5) and then run that value through the same formula again. It is choppy on fast charts but works great by a bar or two on longer time frames.

 

Inputs: Volumelength( 14 ), SmoothVolRatio(5),fast(6);

 

variables:

TotalTicks( 0 ),

VolRatio( 0 ),

VolRatioAvg( 0 ),

obvpercent(0),

Price(0),

ColorLevel( 0 ) ;

 

 

 

if BarType <= 1 then { ie, if tick or minute bars }

begin

TotalTicks = UpTicks + DownTicks ;

if TotalTicks > 0 then

VolRatio = 100 * ( UpTicks - DownTicks ) / TotalTicks

else

VolRatio = 0 ;

end;

price=VolRatioAvg;

 

VolRatioAvg = jthma( VolRatio , Volumelength ) ;

 

Value1 = jtHMA(VolRatioAvg , SmoothVolRatio);

 

Value2 = jtHMA(price , fast);

 

Plot1(Value1 , "VolRatioAvg");

 

plot2(Value2 ,"Fast");

 

If you add colors at the crossing points there is no confusion.

Good luck

Share this post


Link to post
Share on other sites

Minetoo,

I'll do my best and hopes it works.

Here is a 10K shares chart. The bottom indicator is volume ratio run through the jthma formula in an prior post. I have it slowed down to lead the stochastic by one bar in many cases. If you look at the title of the VR it is XMA Volume Ratio. The stochastic is standard TS issue.

If someone comes up with a color plot for divergence, please let me know. I am short on time these days. ie: if c>c[1] and VR<VR[1] then plot1(1,"XMARatio",magenta).

I know the screen looks like Christmas but there is no confusion if the market is heading up or down. Green for up, red for down.

The horizontal lines I set at 25, 40,-25, and -40 because that is where the trend seems to change. The XMA is turned off for this indicator as there is not enough movement to fit all the XMA lines.

On the sim last week it was easy to grab 10 points by scalping in 4 hours on a day with minor movements.

I used the 400/800/1600 tick charts and plan to try the 2500/5000/10000 share charts next week. I stay away from the min charts because it can move 4 or more points on a single bar.

If you plug OBV into the formula it looks just like the Hull MA on the top bar chart though much smoother and can be used as a trend line.

I have found the best time to scalp is when the powers that be reset everything. On the faster charts you will see the XMA lines coming together to form close to a single line and everything seems to slow down. It takes them 20 to 30 min and if you watch a few days you will see the pattern.

If your wondering about a strategy? Don't ask yet as this indicator came up by a cut and paste error and I have not had time to work on it. After a year I have yet to find an indicator that will stand the test of live trading. If someone has a strategy that works and would like to post a hint, I would be much appreciated.

Good luck,

estate1997

TL Post.doc

Share this post


Link to post
Share on other sites

For fast charts try this to smooth things out with fast periods;

Value2 = jtHMA(c HullMALow );{Low Hull MA}

Value2 = jtHMA(Value2, HullMALow );{Low Hull MA}

 

If you plug fastk or just about any other indicator in for price you and get some interesting indications such as

 

Value2 = jtHMA(fastk fastkMA2 );

Value3= jtHMA(Value2, fastkMA3 );

Value4 = jtHMA(Value3 ffastkMA4 );

Value5 = jtHMA(Value4, fastkMA5 );

Share this post


Link to post
Share on other sites

Input: fastkMA2(2),fastkMA3(2),fastkMA4(2),fastkMA5(2):

Var:fasth(0);

ofastk=fastk;

Value2 = jtHMA(fastk fastkMA2 );

Value3= jtHMA(Value2, fastkMA3 );

Value4 = jtHMA(Value3 ffastkMA4 );

Value5 = jtHMA(Value4, fastkMA5 );

Plot1(Value2);

Plot2(Value3);

etc,

 

Be sure to use a value greater than 1 for the length or you'll get error codes.

Share this post


Link to post
Share on other sites

inputs:

PlotFastK (false),

PlotFastK1(false),

PlotFastK2(false),

PlotFastK3(true),

PlotFastK4(False),

DispayMidLines(True),

FastKHullFastest(2),FastKHull1(3),FastKHull2(3) ,FastKHull3(3),FastKHull4(3),FastDHull1(7),

PriceH( High),

PriceL( Low),

PriceC( Close),

StochLength( 2),

SmoothingLength1( 5), { used to slow FastK to FastD = SlowK }

SmoothingLength2( 5), { used to slow FastD to SlowD }

SmoothingType( 2), { pass in 1 for Original, 2 for Legacy }

ZeroLine( 0),

OverSold( 20),

Midline(50),

OverBought( 80),

TopLine(100),

BottomLine(-100),

UpColor(green),

DownColor(Red),

fast(3),

slow(3),

width(3);

 

 

variables:

oFastK( 0 ),

oFastD( 0 ),

oSlowK( 0 ),

oSlowD( 0 ),

slowK1(0),

slowD1(0),

FastKFastest(0),

FastK1(0),

FastK2(0),

FastK3(0),

FastK4(0),

FastD1(0),

FastD2(0);

 

Value3 = Stochastic( PriceH, PriceL, PriceC, StochLength, SmoothingLength1,

SmoothingLength2, SmoothingType, oFastK, oFastD, oSlowK, oSlowD ) ;

 

 

 

FastKFastest=jthma( oFastK ,FastKHullFastest );

FastK1= jthma( oFastK ,FastKHull1 ) ; {Yellow}

FastK2= jthma(FastK1 , FastKHull2 ) ; {Red Green}

FastK3=jthma(FastK2,FastKHull3 );

FastK4=jthma(FastK3,FastKHull4 );

 

 

If PlotFastK3=True then begin

plot13 (fastK3,"FastK3"); end; {Cyan}

If PlotFastK4=True then begin

plot14 (fastK4,"FastK4"); end;

If PlotFastK=true then begin

plot10 (oFastK,"FastK "); end; {Cyan}

 

If PlotFastK1=True then begin

Plot11( FastK1 , "FastK1" ) ;end; {yellow}

 

If PlotFastK2=True then begin

Plot12 ( FastK2 , "FastK2" ) ; end;

Plot2(ZeroLine, "Zero Line") ;

If DispayMidLines=True then begin

Plot3( OverBought, "OverBot" ) ;

Plot4( OverSold, "OverSld" ) ;

Plot5(Midline,"Midline");end;

plot6(TopLine,"100 Line ");

plot7(BottomLine,"BottomLine");

 

if ( FastK1 < FastK1[1] ) then

plot11[1](Plot11[1],"FastK1", yellow);

if ( FastK1 > FastK1[1]) then

plot11[1](Plot11[1],"FastK1", yellow);

 

 

 

 

 

if ( FastK1 > FastD1) then

SetPlotColor(12, magenta)

else if (FastK1 < FastD1) then

SetPlotColor(12, magenta);

if ( FastK1 > FastK1[1]) then

plot12[1](Plot12[1],"FastK2", magenta);

 

 

 

 

 

 

 

if (FastK1 > FastD1 ) then {Zero Line}

SetPlotColor(2, Green)

else if (FastK1 < FastD1 ) then

SetPlotColor(2, Red);

If FastK1 crosses over FastD1 then

plot2[1](Plot2[1],"Zero Line", green);

If FastK1 crosses under FastK4 and FastK1>OverBought then

plot2[1](Plot2[1],"Zero Line", magenta);

 

 

if (FastK1 > FastD1 ) then {100 Line}

SetPlotColor(6,darkGreen)

else if (FastK1 < FastD1 ) then

SetPlotColor(6,darkRed);

If FastK1 crosses over FastD1 and FastK1<OverSold then

plot6[1](Plot6[1],"100 Line ", yellow);

If FastK1 crosses under FastK4 and FastK1>OverBought then

plot6[1](Plot6[1],"100 Line ", magenta);

 

If DispayMidLines=True then begin

 

if (FastK1 > FastD1 ) then {80 Line}

SetPlotColor(3, darkGreen)

else if (FastK1 < FastD1 ) then

SetPlotColor(3, darkRed);

If FastK1 crosses over FastD1 and FastK1<OverSold then

plot3[1](Plot3[1],"OverBot", yellow);

If FastK1 crosses under FastK4 and FastK1>OverBought then

plot3[1](Plot3[1],"OverBot", magenta);

 

 

if (FastK1 > FastD1 ) then {20 Line}

SetPlotColor(4, darkGreen)

else if (FastK1 < FastD1 ) then

SetPlotColor(4, darkRed);

If FastK1 crosses over FastD1 and FastK1<OverSold then

plot4[1](Plot4[1],"OverSld", yellow);

If FastK1 crosses under FastK4 and FastK1>OverBought then

plot4[1](Plot4[1],"OverSld", magenta);

 

if (FastK1 > FastD1 ) then {Mid Line}

SetPlotColor(5, darkGreen)

else if (FastK1 < FastD1 ) then

SetPlotColor(5, darkRed);

If FastK1 crosses over FastD1 and FastK1<OverSold then

plot5[1](Plot5[1],"Midline", yellow);

If FastK1 crosses under FastK4 and FastK1>OverBought then

plot5[1](Plot5[1],"Midline", magenta);

end;

if (FastK1 > FastD1 ) then {Mid Line}

SetPlotColor(7, darkGreen)

else if (FastK1 < FastD1 ) then

SetPlotColor(7, darkRed);

If FastK1 crosses over FastD1 and FastK1<OverSold then

plot7[1](Plot7[1],"BottomLine", yellow);

If FastK1 crosses under FastK4 and FastK1>OverBought then

plot7[1](Plot7[1],"BottomLine", magenta);

Share this post


Link to post
Share on other sites

This compiles and runs in Multicharts; didn't test it in TS but I don't anticipate any issues; screenshots attached for settings.

 

RANGER

 

////MACD BASED ON JTHMA CREDIT TO THE ORIGINAL AUTHOR.

 

 

 

{jtHMA - Hull Moving Average Indicator}

{Author: Atavachron}

{May 2005}

 

{

Inputs:

-------

price: the time series being smoothed, usually Close, High, etc,

but could be RSI(Close, 25) for example.

length: the length of the MA, pretty meaningless in the normal sense

of moving averages, as this quantity is heavily modified

in the code. You need to experiment, do not just use a setting

of 20 because that is what works for you with Simple Moving Averages.

zeroLine: if you are using this in an indicator pane, you might

want to display a centre line of some sort, ths allows

one to set its value

zeroVisible: boolean variable, determines whether the centre line

(zeroLine) is plotted.

upColour: If you wish to differentiate upward movements by colour coding.

downColour: If you wish to differentiate downward movements by colour coding.

colourDeltaBar: Set this to 1 if you wish the colour change to be effective on

the actual bar where the direction change occurred.

Set this to 0 for default behaviour. All other values

are pretty meaningless.

}

 

Inputs:

FastLength( 12 ),

SlowLength( 26 ),

MACDLength( 9 ),

price(Close),

length(21);

 

Variables:

_MACD(0),

_MACD_Avg(0),

_MACD_Delta(0);

 

Value1 = jtHMA(price, length);

 

_MACD = MACD( Value1, FastLength, SlowLength ) ;

_MACD_Avg = XAverage( _MACD, MACDLength ) ;

_MACD_Delta = _MACD - _MACD_Avg;

 

Plot1( _MACD, "MACD" ) ;

Plot2( _MACD_Avg , "MACDAvg" ) ;

Plot3( _MACD_Delta, "MACDDiff" ) ;

Plot4( 0, "ZeroLine" ) ;

JTHMA_MACD001.thumb.jpg.96958afaaf5c48b937ea2b6a229406de.jpg

JTHMA_MACD002.thumb.jpg.2667402c8995406cbea20a7015438680.jpg

JTHMA_MACD000.thumb.jpg.c5fed2cd8093e11d1e118c158bf8cf99.jpg

Share this post


Link to post
Share on other sites

Hi Minetoo

 

I downloaded the indicator and review it against what I pasted together, note:

 

a) The other indicator doesn't really make sense to me. The MACD is jagged because the input for the MACD is Price. Price is jagged; the MACD is jagged.

 

b) In the version posted by me, I smooth Price and use it as an input to the MACD. Take my version; the version that you provided in the link and a Std MACD and compare the three.

 

c) The signal for the MACD is typically a crossover of the two moving averages or Zero line. The other indicator takes the difference of the MACD and the Smoothed MACD and creates a signal. Not sure what that does but create a little more noise in an already noisy signal.

 

That's my conclusion. Happy Trading and Thanks!

Share this post


Link to post
Share on other sites
I saw your Screaming Fast Moving Average screen shot. Can you help me to get this?. I have HMA on my chart but yours is more perfect and get early signals than me.

 

Please help me.

 

When you post a question, be sure to directed it to the person you are looking for a response from. I want no part of assume.

Share this post


Link to post
Share on other sites
inputs:

PlotFastK (false),

PlotFastK1(false),

PlotFastK2(false),

PlotFastK3(true),

PlotFastK4(False),

DispayMidLines(True),

FastKHullFastest(2),FastKHull1(3),FastKHull2(3) ,FastKHull3(3),FastKHull4(3),FastDHull1(7),

PriceH( High),

PriceL( Low),

PriceC( Close),

StochLength( 2),

SmoothingLength1( 5), { used to slow FastK to FastD = SlowK }

SmoothingLength2( 5), { used to slow FastD to SlowD }

SmoothingType( 2), { pass in 1 for Original, 2 for Legacy }

ZeroLine( 0),

OverSold( 20),

Midline(50),

OverBought( 80),

TopLine(100),

BottomLine(-100),

UpColor(green),

DownColor(Red),

fast(3),

slow(3),

width(3);

 

 

variables:

oFastK( 0 ),

oFastD( 0 ),

oSlowK( 0 ),

oSlowD( 0 ),

slowK1(0),

slowD1(0),

FastKFastest(0),

FastK1(0),

FastK2(0),

FastK3(0),

FastK4(0),

FastD1(0),

FastD2(0);

 

Value3 = Stochastic( PriceH, PriceL, PriceC, StochLength, SmoothingLength1,

SmoothingLength2, SmoothingType, oFastK, oFastD, oSlowK, oSlowD ) ;

 

 

 

FastKFastest=jthma( oFastK ,FastKHullFastest );

FastK1= jthma( oFastK ,FastKHull1 ) ; {Yellow}

FastK2= jthma(FastK1 , FastKHull2 ) ; {Red Green}

FastK3=jthma(FastK2,FastKHull3 );

FastK4=jthma(FastK3,FastKHull4 );

 

 

If PlotFastK3=True then begin

plot13 (fastK3,"FastK3"); end; {Cyan}

If PlotFastK4=True then begin

plot14 (fastK4,"FastK4"); end;

If PlotFastK=true then begin

plot10 (oFastK,"FastK "); end; {Cyan}

 

If PlotFastK1=True then begin

Plot11( FastK1 , "FastK1" ) ;end; {yellow}

 

If PlotFastK2=True then begin

Plot12 ( FastK2 , "FastK2" ) ; end;

Plot2(ZeroLine, "Zero Line") ;

If DispayMidLines=True then begin

Plot3( OverBought, "OverBot" ) ;

Plot4( OverSold, "OverSld" ) ;

Plot5(Midline,"Midline");end;

plot6(TopLine,"100 Line ");

plot7(BottomLine,"BottomLine");

 

if ( FastK1 < FastK1[1] ) then

plot11[1](Plot11[1],"FastK1", yellow);

if ( FastK1 > FastK1[1]) then

plot11[1](Plot11[1],"FastK1", yellow);

 

 

 

 

 

if ( FastK1 > FastD1) then

SetPlotColor(12, magenta)

else if (FastK1 < FastD1) then

SetPlotColor(12, magenta);

if ( FastK1 > FastK1[1]) then

plot12[1](Plot12[1],"FastK2", magenta);

 

 

 

 

 

 

 

if (FastK1 > FastD1 ) then {Zero Line}

SetPlotColor(2, Green)

else if (FastK1 < FastD1 ) then

SetPlotColor(2, Red);

If FastK1 crosses over FastD1 then

plot2[1](Plot2[1],"Zero Line", green);

If FastK1 crosses under FastK4 and FastK1>OverBought then

plot2[1](Plot2[1],"Zero Line", magenta);

 

 

if (FastK1 > FastD1 ) then {100 Line}

SetPlotColor(6,darkGreen)

else if (FastK1 < FastD1 ) then

SetPlotColor(6,darkRed);

If FastK1 crosses over FastD1 and FastK1<OverSold then

plot6[1](Plot6[1],"100 Line ", yellow);

If FastK1 crosses under FastK4 and FastK1>OverBought then

plot6[1](Plot6[1],"100 Line ", magenta);

 

If DispayMidLines=True then begin

 

if (FastK1 > FastD1 ) then {80 Line}

SetPlotColor(3, darkGreen)

else if (FastK1 < FastD1 ) then

SetPlotColor(3, darkRed);

If FastK1 crosses over FastD1 and FastK1<OverSold then

plot3[1](Plot3[1],"OverBot", yellow);

If FastK1 crosses under FastK4 and FastK1>OverBought then

plot3[1](Plot3[1],"OverBot", magenta);

 

 

if (FastK1 > FastD1 ) then {20 Line}

SetPlotColor(4, darkGreen)

else if (FastK1 < FastD1 ) then

SetPlotColor(4, darkRed);

If FastK1 crosses over FastD1 and FastK1<OverSold then

plot4[1](Plot4[1],"OverSld", yellow);

If FastK1 crosses under FastK4 and FastK1>OverBought then

plot4[1](Plot4[1],"OverSld", magenta);

 

if (FastK1 > FastD1 ) then {Mid Line}

SetPlotColor(5, darkGreen)

else if (FastK1 < FastD1 ) then

SetPlotColor(5, darkRed);

If FastK1 crosses over FastD1 and FastK1<OverSold then

plot5[1](Plot5[1],"Midline", yellow);

If FastK1 crosses under FastK4 and FastK1>OverBought then

plot5[1](Plot5[1],"Midline", magenta);

end;

if (FastK1 > FastD1 ) then {Mid Line}

SetPlotColor(7, darkGreen)

else if (FastK1 < FastD1 ) then

SetPlotColor(7, darkRed);

If FastK1 crosses over FastD1 and FastK1<OverSold then

plot7[1](Plot7[1],"BottomLine", yellow);

If FastK1 crosses under FastK4 and FastK1>OverBought then

plot7[1](Plot7[1],"BottomLine", magenta);

 

Does anyone have the ELD for this indicator, or is it available for NT, thanks

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.