tomm1111 202 posts msg #71641 - Ignore tomm1111 modified |
2/22/2009 4:18:06 AM
Here is a 8, 21 period hull moving average crossover. Go long when diff crosses above 0 and short when it crosses below. Below is an excerpt from Alan Hull's web page. The creator of the hull moving average.
"The Hull Moving Average solves the age old dilemma of making a moving average more responsive to current price activity whilst maintaining curve smoothness. In fact the HMA almost eliminates lag altogether and manages to improve smoothing at the same time."
|
chetron 2,817 posts msg #71642 - Ignore chetron modified |
2/22/2009 10:20:13 AM
SORRY TOMM, BUT THE ERROR VERSION RESULTS LOOK BETTER TO ME.
|
tomm1111 202 posts msg #71644 - Ignore tomm1111 modified |
2/22/2009 1:15:09 PM
I found an error in the code. I corrected it. Up too late last night. :o)
|
tomm1111 202 posts msg #71646 - Ignore tomm1111 |
2/22/2009 1:51:04 PM
I agree. I will see what else I can come up with.
|
tomm1111 202 posts msg #71647 - Ignore tomm1111 modified |
2/22/2009 1:59:56 PM
Here is another one. A 5, 14 period hull moving average crossover. It is quicker to react than the 8, 21 day crossover.
|
tomm1111 202 posts msg #71649 - Ignore tomm1111 modified |
2/22/2009 2:43:30 PM
One more. This is a ema(3), 14 period hull moving average.
|
tomm1111 202 posts msg #71656 - Ignore tomm1111 modified |
2/23/2009 12:12:41 AM
Last one. I changed the hull moving average period to 5 and used a wma(2) of itself for the signal. This is about as smooth as it's going to get.
(Basically, what this shows is trade in the direction of the 5 period hull. Can be used as confirmation to exit trades.)
|
tomm1111 202 posts msg #71657 - Ignore tomm1111 |
2/23/2009 12:43:54 AM
I found the following excerpt from Alan Hull himself on a forum (stockmeetingplace.com).
HMA Construction...
The HMA is not that closely related to linear regression - the square root of the sum of the squares, etc. It is designed along geometric lines to remove lag without having to shorten the period and compromise smoothing. Hence, when compared to a line of linear regression of the same period, the HMA has superior smoothing.
HMA Application...
Because the HMA was designed to remove lag, don't use it to generate crossover trading signals. Instead you trade the turning points of the HMA...as it turns up - buy and as it turns down - sell. I actually prefer to use 2 separate HMAs with different periods - one for entry and one for exit. Tune the periods by backtesting on each financial instrument you wish to trade, ie. curve fit it in each case. Apply it to daily or weekly charts...it really doesn't matter which timeframe you use it over.
Enjoy,
Alan Hull
|
chetron 2,817 posts msg #71661 - Ignore chetron |
2/23/2009 6:48:31 AM
well that explains why my previous edit was triggering on the turn around, as opposed to the crossover. thanx tomm.
|
chetron 2,817 posts msg #71662 - Ignore chetron modified |
2/23/2009 6:59:01 AM
ALSO TOMM, BE CAREFUL OF USING "S1" OR EVEN "R1" AS A CUSTOM VARIABLE, BECAUSE THESE ARE RESERVED FOR PIVIOT POINTS. I USUALLY THROW ON A "V" BEFORE MY VARIABLES TO MAKE SURE I DON'T GET SAND BAGGED.
I HAVEN'T SEEN ANY MATH ISSUES, BUT IF YOU ASK SF TO DRAW YOUR "S2", IT DRAWS THE PIVOT, AS OPPOSED TO CHANGE THE VARIABLE TO VS2, IT DRAWS YOUR "MATH".
ADD S2 AND R2 TO THE LIST
HTH
|