Welcome to the Traders Laboratory Forums.
Trading Indicators Post your custom trading indicators. If you download, remember to click INSTALL.

Reply
Fast BB MACD Details »»
Fast BB MACD
Platform: , by simterann22 simterann22 is offline
Developer Last Online: Jan 2012 Show Printable Version Email this Page

Platform: Tradestation Rating:
Released: 06-30-2009 Last Update: Never Installs: 5
 
No support by the author.

Here is a fast MACD using a Hull Moving Average and a Fractal Moving Average. The FastMACD dots change color when they breach outside their Bollinger Bands (which you can't see).

I have taken from other coder's work, so full credit goes to them. I have simply added the faster MAs and incorporated the BBs. This indicator came about just by experimenting. So try an idea out......you never know

It seems to pick the highs and lows nicely. I have coded it with a standard MACD so I can see divergences. You are quite welcome to add or remove anything and post it if you think it has merit.

The indicator also has a gapless code added which will take into account opening gaps on intraday charts. I use this with Blu-Ray's Paintbars (Similar to the Heikin Ashi), Double Stochastics and The Gapless Squeeze (here):

http://www.traderslaboratory.com/for...html#post68059


Here is the code:

Code:
{**************FMA Function******************}
//  generates very smooth and responsive moving average
// 	copyright 2008 John McCormick
//	feel free to copy and use this code royalty free 
//  as long as you don't remove the above acknowledgement
//		

Inputs: 
	Price(numericseries), 
	Length(numericsimple);

Vars:
	j(0),
	workinglen(maxlist(1,absvalue(Length))),
	peak(workinglen/3),
	tot(0),
	divisor(0);

Array:
val[100](0);

if workinglen>100 then workinglen=100;  //  use larger array to handle lengths over 100


tot=0;
divisor=0;
for j=1 to floor(workinglen+1) begin
	if j<=peak then val[j]=j/peak
	else val[j]=(workinglen+1-j)/(workinglen+1-peak);
	tot=tot+price[j-1]*val[j];
	divisor=divisor+val[j];
end;
if divisor<>0 then FMA_smooth=tot/divisor;
Code:
{jtHMA - Hull Moving Average Function}
{Author: Atavachron}
{May 2005}		
	
Inputs: price(NumericSeries), length(NumericSimple);
Vars: halvedLength(0), sqrRootLength(0);

{
 Original equation is:
 ---------------------
 waverage(2*waverage(close,period/2)-waverage(close,period), SquareRoot(Period)
 Implementation below is more efficient with lengthy Weighted Moving Averages.
 In addition, the length needs to be converted to an integer value after it is halved and
 its square root is obtained in order for this to work with Weighted Moving Averaging
}

if ((ceiling(length / 2) - (length / 2))  <= 0.5) then
	halvedLength = ceiling(length / 2)
else
	halvedLength = floor(length / 2);

if ((ceiling(SquareRoot(length)) - SquareRoot(length))  <= 0.5) then
	sqrRootLength = ceiling(SquareRoot(length))
else
	sqrRootLength = floor(SquareRoot(length));

Value1 = 2 * WAverage(price, halvedLength);
Value2 = WAverage(price, length);
Value3 = WAverage((Value1 - Value2), sqrRootLength);

jtHMA = Value3;
Code:
{***************FastMACD Function**********************

inputs: 
	Price( numericseries ), 
	FastLength( numericsimple ), { this input assumed to be a constant >= 1 }
	SlowLength( numericsimple ) ; { this input assumed to be a constant >= 1 }

MACD_HMA_FMA = jthma( Price, FastLength ) - FMA_smooth( Price, SlowLength ) ;


{ ** Copyright (c) 2001 - 2009 tradestation Technologies, Inc. All rights reserved. ** 
  ** tradestation reserves the right to modify or overwrite this analysis technique 
     with each release. ** }
Code:
{******************FastMACD Indicator*************}

inputs:
	
price(close),
fastlength (12),
slowlength (26),
signal (9),
BBstDv(1),	
DirColor(True),
BBColorUp(White),
BBColorDn(Magenta),
ZeroColor(DarkCyan);

	
VARS:
	BB_Macd(0),
	MyMACD(0),
	Avg(0),
	SDev(0),
	Alert_Msg(" "),
	Upper_Band(0),
	Lower_Band(0),
	BBColor(0),      
    Cross_Up(False),
	Cross_Dn(False);  

// gapless day transitions - John McCormick May 2008
	
Vars:
	RelO(0),		// Relative Open
	RelH(0),		// Relative High
	RelL(0),		// Relative low
	RelC(0),		// Relative Close
	gap(0),			// the opening gap (modified by the gap coefficient)
	GapCoef(1.0),	// Gap Coefficient
	Accum(0);		// The sum of all the daily gaps

if currentsession(0)<>currentsession(0)[1] or date<>date[1] then 
  begin
	gap=GapCoef*(O-C[1]);
	Accum=Accum+gap;   
  end;

if BarType<=1 then  //Valid only for Tick or Intraday	 
	
	begin

		RelO	=	O-Accum;
		RelC	=	C-Accum;
		RelH	=	H-Accum;
		RelL	=	L-Accum;

		end

		else begin

		RelO	=	O;
		RelC	=	C;
		RelH	=	H;
		RelL	=	L;
	
	end;

// Gapless - end

Var: GL_Price(0);

GL_price = RelC;
If Price=open then GL_price = RelO;
If Price=high then GL_price = RelH;
If Price=low then GL_price = RelL;



BB_Macd = FMA_smooth(MACD_HMA_FMA(GL_price, FastLength, SlowLength),3)*0.5 ;//added xaverage to smooth 'bumps'
MyMACD = MACD( GL_price, FastLength, SlowLength )*1.5 ;
//Avg  = FMA_smooth( BB_Macd, Signal);
Avg = XAverage( MyMACD,Signal ) ;
SDev = StandardDev( BB_Macd, Signal, 1);

Upper_Band = ( Avg + BBStDv * SDev );
Lower_Band = ( Avg - BBStDv * SDev );

//******************************************************//
//     Sub-Graph plot logic.                            //
//******************************************************//
	
if DirColor=True then
	
begin
	

	
   If BB_Macd > BB_Macd[1] then BBColor = BBColorUp else BBColor = BBColorDn;

   If Cross_Up = False then if BB_Macd > Upper_Band then begin
      Cross_Up = True;  
      Cross_Dn = False;  
      BBColor = Cyan;	
	  If CheckAlert then Alert( "BB cross up " + Alert_Msg );
      end;   
 
   If Cross_Dn = False then if BB_Macd < Lower_Band then begin
      Cross_Up = False;  
      Cross_Dn = True;  
      BBColor = Yellow;
	  If CheckAlert then Alert( "BB cross down " + Alert_Msg );
      end;

 
    Plot1( BB_Macd, "BBMACD" ,BBColor );
	Plot2(Avg, "Signal",Cyan); 
 
   	Plot4( 0, "Zero_Line", ZeroColor );
 	Plot3(MyMACD, "MACD", green,2);
    end
else
	setplotcolor(1,green);

Download Now

File Type: eld @SK_FAST_MACDBB.ELD (10.3 KB, 187 views)

Screenshots

Fast BB MACD-fast-macdbb.jpg  

Show Your Support

  • If you like to thanks you by the author -> Click Thanks to the Author
  • This modification may not be copied, reproduced or published elsewhere without the author's permission.
The Following 7 Users Say Thank You to simterann22 For This Useful Post:
aaa (07-05-2009), addvalue (12-27-2009), berrob (10-24-2011), RickAce (07-17-2009), shrike (07-01-2009), soulman (07-01-2009), Tams (06-30-2009)

Comments
Old 07-02-2009, 12:47 PM   #10

Join Date: Jun 2009
Location: Seattle
Posts: 63
Ignore this user

Thanks: 8
Thanked 18 Times in 16 Posts

Re: Fast BB MACD

thx....great indicator....good work mate....
ajax358 is offline  
Reply With Quote
Old 07-03-2009, 06:39 AM   #11

simterann22's Avatar

Join Date: May 2009
Location: Sydney
Posts: 64
Ignore this user

Thanks: 42
Thanked 51 Times in 20 Posts

Re: Fast BB MACD

Ajax358, I'm glad you've found a good use for it. How are you using the indicator? I'm curious to know since you mentioned scalping the crosses. What sort of timeframe? Would you mind sharing?

Cheers.
simterann22 is offline  
Reply With Quote
Old 07-06-2009, 01:44 AM   #12

Join Date: Jun 2009
Location: Seattle
Posts: 63
Ignore this user

Thanks: 8
Thanked 18 Times in 16 Posts

Re: Fast BB MACD

Quote:
Originally Posted by simterann22 »
Ajax358, I'm glad you've found a good use for it. How are you using the indicator? I'm curious to know since you mentioned scalping the crosses. What sort of timeframe? Would you mind sharing?

Cheers.
How using?...using it in my existing MACD/Stoch window....found that the std settings of this indicator was completely equal to my own MACD indicator that I had gotten as fast in the turns as i could over 3 years & use it day for emini day trades (my MACD input=8,21,13)....I wait for the MACD to cross the MACD avg, then wait for the MACD to cross the zl. Sometimes will go in earlier if my Stoch has lead the MACD in a certain look, as it leads the macd in every real turn, as have found out over time. I use the "Fast BB MACD", by blocking out as a dot/black all the lines except, except the "BBMACD" line of 'dots', as the color change shows & verifies the MACD cross the MACD Avg great!!!!....the others are blacked out because I already have the MACD/MACD Avg in that level #1, & don't need this ta's lines then, but use the 'dots'. The lines are the same as my MACD input results, so you/anyone could use this indicator & know ya have the very fastest in the turns...great job on this indicator!!!.....I know, I have tested every input value there is in these number areas, & these are the fastest, mine & yours, imo.

The time frame is a 166tk NQ & ES....used to use a 89 & 144tk, but found the 116 tk is not only mid way between the two, so maintains the fibanacci ratios, but is smoother than the 89tk & quicker than the 144tk in the turns. So use it as my trade chart & use a 305tk ES &NQ as my anchor charts (305 tk is midway betweee the 377 & 233tk, so maintains again the Fib ratio, & is quicker than the 377tk, but smoother than the 233tk; all my inputs are Fib's numbers in my system).

Hope that helps....give it a look & backtest & see what ya think....
ajax358 is offline  
Reply With Quote
Old 07-06-2009, 02:08 AM   #13

simterann22's Avatar

Join Date: May 2009
Location: Sydney
Posts: 64
Ignore this user

Thanks: 42
Thanked 51 Times in 20 Posts

Re: Fast BB MACD

Thanks Ajax358, I like to hear what other traders are doing. Yeah....similar to my setup but I hadn't quite found my 'perfect' timeframe for the ES etc. yet. Thanks for sharing your setup.

Check out the DoubleStoch below. See what you think. It's actually a 'Quadruple Double Stochastic"! I simply made a new indicator with 4 together...it sure beats having to mount 4 each time I want to plot them. I've commented out one of the plots so I really only use 3 at this stage. Here is the text version as well:

Code:
[LegacyColorValue = true]; 

{_DStoc: Double Stochastic Function}

Inputs: 
DStLen(NumericSimple)
;

Vars:   
Num(0),
Denom(0),
Ratio(0),
PctK(0),
DNum(0),
DDenom(0),
DRatio(0),
DPctK(0);

Vars:
	RelO(0),		// Relative Open
	RelH(0),		// Relative High
	RelL(0),		// Relative low
	RelC(0),		// Relative Close
	gap(0),			// the opening gap (modified by the gap coefficient)
	GapCoef(1.0),	// Gap Coefficient
	Accum(0);		// The sum of all the daily gaps

if currentsession(0)<>currentsession(0)[1] or date<>date[1] then 
  begin
	gap=GapCoef*(O-C[1]);
	Accum=Accum+gap;   
  end;

if BarType<=1 then  //Valid only for Tick or Intraday	 
	
	begin

		RelO	=	O-Accum;
		RelC	=	C-Accum;
		RelH	=	H-Accum;
		RelL	=	L-Accum;

		end

		else begin

		RelO	=	O;
		RelC	=	C;
		RelH	=	H;
		RelL	=	L;
	
	end;

// Gapless - end


{Stoc}
Num=RelC-_Lst(RelL,DStLen);
Denom=_Hst(RelH,DStLen)-_Lst(RelL,DStLen);
Ratio=IFF(Denom>0,(Num/Denom)*100,Ratio[1]);
PctK=IFF(CurrentBar=1,Ratio,PctK[1]+(.5*(Ratio-PctK[1])));

{DStoc}
DNum=PctK-_Lst(PctK,DStLen);
DDenom=_Hst(PctK,DStLen)-_Lst(PctK,DStLen);
DRatio=IFF(DDenom>0,(DNum/DDenom)*100,DRatio[1]);
DPctK=IFF(CurrentBar=1,DRatio,DPctK[1]+(.5*(DRatio-DPctK[1])));

_DStocGL=DPctK;
Code:
{_Lst: Calculates Lowest Values}
{Copyright 1998 Walter Bressert} 

Inputs: 
Price(NumericSeries),Length(NumericSimple);

Vars:   
X(0),
Lo(0)
;

Lo=999999;
For X=0 to Length-1 begin
  If Price[X] < Lo then Lo = Price[X];
End;

_Lst=Lo;
Code:
[LegacyColorValue = true]; 

{_Hst: Calculates Highest Values}
{Copyright 1998 Walter Bressert} 

Inputs: Price(NumericSeries),Length(NumericSimple);

Vars:   X(0),Hi(-999999);

Hi=-999999;
For X=0 to Length-1 begin
  If Price[X]>Hi then Hi=Price[X];
End;

_Hst=Hi;
Code:
inputs: Test( truefalsesimple ), TrueVal( numericsimple ), FalseVal( numericsimple ) ;

if Test then
	IFF = TrueVal 
else 
	IFF = FalseVal ;


{ ** Copyright (c) 2001 - 2009 tradestation Technologies, Inc. All rights reserved. ** 
  ** tradestation reserves the right to modify or overwrite this analysis technique 
     with each release. ** }
Code:
[LegacyColorValue = true]; 

{
Double Stochastic 
Plots function _DstocGL}

Inputs: //Len1(17), 
		Len2(28), Len3(42), Len4(85);


//value1 = _DstocGL(Len1);
value2 = _DstocGL(Len2);
value3 = _DstocGL(Len3);
value4 = _DstocGL(Len4);


//plot1 (value1, "Stoch1",red,default,1);
plot2 (value2, "Stoch2",green,default,1);
plot3 (value3, "Stoch3",magenta,default,1);
plot4 (value4, "Stoch4",white,default,2);
plot5 (80, "OB",blue,default,1);
Plot6 (20, "OS",blue,default,1);
Enjoy.....
Attached Files
File Type: eld DBL STOCH.ELD (6.9 KB, 75 views)
simterann22 is offline  
Reply With Quote
The Following User Says Thank You to simterann22 For This Useful Post:
Tams (07-06-2009)
Old 07-07-2009, 01:48 AM   #14

Join Date: Jun 2009
Location: Seattle
Posts: 63
Ignore this user

Thanks: 8
Thanked 18 Times in 16 Posts

Re: Fast BB MACD

YW....& thx for the Dbl Stoch.....will look at it now. I use my Stoch (13,8,8,1,30,70) 'in' my first level w/ the MACD, as in real/true moves, it ALWAYS leads the MACD in the move, & the across the the MACD crosses & zl. WIll see how this one looks in the setup....thx again....

Just loaed & backtested it....looks great, the lines cross well in the turns...is near equal to my MACD/Stoch lines cross, in fact almost exactly equal, means great indicator...thx...

Last edited by ajax358; 07-07-2009 at 02:25 AM.
ajax358 is offline  
Reply With Quote
The Following User Says Thank You to ajax358 For This Useful Post:
simterann22 (07-07-2009)
Old 07-07-2009, 05:48 PM   #15

simterann22's Avatar

Join Date: May 2009
Location: Sydney
Posts: 64
Ignore this user

Thanks: 42
Thanked 51 Times in 20 Posts

Re: Fast BB MACD

As per member's request here is the PDF of a thread discussing how to use the Dbl Stoch:
Attached Files
File Type: pdf TS FORUM- USING DBL TRIPLE STOCH -.pdf (10.98 MB, 105 views)
simterann22 is offline  
Reply With Quote
Old 07-08-2009, 01:47 AM   #16

Join Date: Jun 2009
Location: Seattle
Posts: 63
Ignore this user

Thanks: 8
Thanked 18 Times in 16 Posts

Re: Fast BB MACD

Quote:
Originally Posted by simterann22 »
As per member's request here is the PDF of a thread discussing how to use the Dbl Stoch:
thx....will read it in a bit....

ajax
ajax358 is offline  
Reply With Quote

Reply

Tags
bollinger band, macd

Thread Tools
Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAST BUCKS: How Porsche Made Billions taq Trading Videos 3 07-03-2011 03:13 AM
Screaming Fast Moving Average Minetoo Trading Indicators 47 04-10-2011 12:46 PM
Poker & Fast Intra-Session Trading UrmaBlume Technical Analysis 18 02-04-2009 02:01 AM
Is Ninja/Zen Fast Enough for EMini Futures Trading Khepfere Futures Trading Laboratory 15 11-23-2008 09:37 AM
Reg NMS - Fast Fills on NYSE? The Bear Stock Trading Laboratory 0 03-10-2007 06:39 PM

All times are GMT -4. The time now is 10:57 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.