| Trading Indicators Post your custom trading indicators. If you download, remember to click INSTALL. |
![]() | | Tweet | |
Fast BB MACD Details »» | |||||||||||||||||||||||||||
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
Screenshots Show Your Support
| |||||||||||||||||||||||||||
| Comments |
| | #10 | ||
![]() | Re: Fast BB MACD | ||
| |
|
| | #11 | ||
![]() | Re: Fast BB MACD Cheers. | ||
| |
|
| | #12 | ||
![]() | Re: Fast BB MACD Quote:
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.... | ||
| |
|
| | #13 | ||
![]() | Re: Fast BB MACD 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); | ||
| |
|
| The Following User Says Thank You to simterann22 For This Useful Post: | ||
Tams (07-06-2009) | ||
| | #14 | ||
![]() | Re: Fast BB MACD ![]() 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. | ||
| |
|
| The Following User Says Thank You to ajax358 For This Useful Post: | ||
simterann22 (07-07-2009) | ||
| | #15 | ||
![]() | Re: Fast BB MACD | ||
| |
|
![]() |
| Tags |
| bollinger band, macd |
| Thread Tools | |
| 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 |