This is read-only version of AFL library entry. Ability to add user formulas
and comment is only available from members-only area.
Details:
Formula name:
Hull Moving Average
Author/Uploader:
avi b a -
Date/Time added:
2007-01-01 14:21:41
Origin:
Keywords:
Level:
basic
Flags:
indicator
DISCLAIMER: Most formulas present in AFL on-line library are submitted
by the users and are provided here on an "as is" and "as available" basis.
AmiBroker.com
makes no representations or warranties of any kind to the contents or the operation
of material presented here. We do not maintain nor provide technical support
for 3rd party formulas. Description:
The Hull Moving Average solves the age old dilemma of making a moving average more responsive to current price activity whilst maintaining curve smoothness.
Formula:
/***************************************/
/* Hull Moving Average version 1.0 */
/* by Avi b a */
/* The Hull Moving Average solves the age
old dilemma of making a moving average more
responsive to current price activity whilst maintaining curve smoothness...
read more at- http://www.ensignsoftware.com/tips/tradingtips72.htm */
/***************************************/
SetChartBkColor(16);
Period = Param("Period",26,1,100,1);
Hull = WMA( 2*WMA(C,int(Period/2))- WMA(C,Period),int(sqrt(Period)));
Plot(C,"close",6,128);
for( i = 1 ; i < BarCount-2; i++ )
{
if (hull[i] <hull[i-1] && hull[i] <hull[i+1])
Lpml[i]=1;
else
Lpml[i] =0;
if (hull[i] >hull[i-1] && hull[i] >hull[i+1])
Lpmh[i]=1;
else
Lpmh[i] =0;
}
GR =ExRem(LpmH,Lpmh);
RD =ExRem(Lpml,Lpml);
PlotShapes(IIf(GR!=0,shapeSmallCircle,shapeNone),colorRed,0,hull,0);
PlotShapes(IIf(RD!=0,shapeSmallCircle,shapeNone),colorGreen,0,hull,0);
Plot(Hull,"Hull "+Period+" days",2,1);
Comments:
franklin fug.schroeder [at] t-online.de 2007-01-01 16:19:24
Hey,
great job!
How can I change the color for the MA and background.
Thank you for your help.
avi b a avi111a [at] yahoo.com 2007-01-02 13:47:32
hi
take the following code , and cahange
the parameters suite you (right click, parameters):
/***************************************/
/* Hull Moving Average version 1.1 */
/* by Avi b a */
/* The Hull Moving Average solves the age
old dilemma of making a moving average more
responsive to current price activity whilst maintaining curve smoothness...
*/
/***************************************/
bc = Param("background color",16,1,55,1);
use_your_color=IIf(ParamList("use_your_color?","no|yes")=="yes",1,0);
SetChartBkColor(bc);
Period = Param("Period",26,1,100,1);
Hull = WMA( 2*WMA(C,int(Period/2))- WMA(C,Period),int(sqrt(Period)));
pc[0]=0;
for( i = 1 ; i < BarCount-2; i++ )
{
pc[i] = pc[i-1];
if (hull[i] <hull[i-1] && hull[i] <hull[i+1])
{Lpml[i]=1;pc[i]=5;}
else
Lpml[i]=0;
if (hull[i] >hull[i-1] && hull[i] >hull[i+1])
{Lpmh[i]=1;pc[i]=4;}
else
Lpmh[i]=0;
}
Hard to imagine why the author spent any time on this. Buy and sell signals can only appear after minimum of 2 days worth of future data, so that every trade signal looking backwards is a fantasy. And as for responsiveness to current (today) conditions, which the author claims is a benefit of the code, there are no signals possible until at least 2 days into the future. This is about as misleading and fantastic as every other system/indicator posted on this website that use the Zig, Trough, or Peak formulas. Shame on the author for posting something so useless and deceptive.
avi b a
2007-01-07 06:42:18
1) the indictor don't gives buy or sell signals!!!
and it was not written any place in this code.
any one who understands moving avarges, knows
you don't use them that way.
2)the points are for trend marking, yes, you'll have to wait 2 days for such signal to occur, but this how i use it, and the purpose of this indicator is to cath trends.
3) the only one who should be ashme and waste is time is the poor one calling himself "mamspoker"
which looks like love deprived.
the only reason i publish indicator in this site is love, and the same as i use them.
the fanstasy is in someone else head...
mamspoker is quite right in saying, "This is about as misleading and fantastic as every other system/indicator posted on this website that use the Zig, Trough, or Peak formulas." Maybe he should not have put the poster (paster) to shame. I am sure "avi b a" and many others do not know that Technical Analysis is IDENTIFICATION and not forecasting.
Graham gkavanagh [at] e-wire.net.au 2007-01-26 15:20:50
Here is non-future looking part of code written to be in past. It just pushes the dots 1 bar forward
Lpml = Ref(Hull,-1) < Ref(Hull,-2) AND Ref(Hull,-1) < Hull;
Lpmh = Ref(Hull,-1) > Ref(Hull,-2) AND Ref(Hull,-1) > Hull;
are you guys able to produce the Hull exponential MMA's - I would like to see on my chart the short term (3,5,7,9,11,13)and long term (21,24,27,30,33,38)MMA's.
are you guys able to produce the Hull exponential MMA's - I would like to see on my chart the short term (3,5,7,9,11,13)and long term (21,24,27,30,33,38)MMA's.
I wish I were able to write the code myself.
Thanks for any help
Tony Spica tonyspica-at-juno.com 2008-08-16 16:03:22
I finally figured out how to do Hull MMA's:
_SECTION_BEGIN("Hull Moving Average");
/***************************************/
/* Hull Moving Average version 1.0 */
/* by Avi b a */
/* The Hull Moving Average solves the age
old dilemma of making a moving average more
responsive to current price activity whilst maintaining curve smoothness...
read more at-(Had to omit this link in order to post)/***************************************/
SetChartBkColor(16);
Period = Param("Period",3,1,100,1);
Hull= WMA( 2*WMA(C,int(3/2))- WMA(C,3),int(sqrt(Period)));
Period = Param("Period",5,1,100,1);
Hull5 = WMA( 2*WMA(C,int(5/2))-WMA(C,5),int(sqrt(Period)));
Period = Param("Period",7,1,100,1);
Hull7 = WMA( 2*WMA(C,int(7/2))- WMA(C,7),int(sqrt(Period)));
Period = Param("Period",9,1,100,1);
Hull9 = WMA( 2*WMA(C,int(9/2))- WMA(C,9),int(sqrt(Period)));
Period = Param("Period",11,1,100,1);
Hull11 = WMA( 2*WMA(C,int(11/2))- WMA(C,11),int(sqrt(Period)));
Period = Param("Period",13,1,100,1);
Hull13 = WMA( 2*WMA(C,int(13/2))- WMA(C,13),int(sqrt(Period)));
Period = Param("Period",21,1,100,1);
Hull21 = WMA( 2*WMA(C,int(21/2))- WMA(C,21),int(sqrt(Period)));
Period = Param("Period",24,1,100,1);
Hull24= WMA( 2*WMA(C,int(24/2))- WMA(C,24),int(sqrt(Period)));
Period = Param("Period",27,1,100,1);
Hull27 = WMA( 2*WMA(C,int(27/2))- WMA(C,27),int(sqrt(Period)));
Period = Param("Period",30,1,100,1);
Hull30 = WMA( 2*WMA(C,int(30/2))- WMA(C,30),int(sqrt(Period)));
Period = Param("Period",33,1,100,1);
Hull33 = WMA( 2*WMA(C,int(33/2))- WMA(C,33),int(sqrt(Period)));
Period = Param("Period",38,1,100,1);
Hull38 = WMA( 2*WMA(C,int(38/2))- WMA(C,38),int(sqrt(Period)));
for( i = 1 ; i < BarCount-2; i++ )
{
if (hull[i] <hull[i-1] && hull[i] <hull[i+1])
Lpml[i]=1;
else
Lpml[i] =0;