PureBytes Links
Trading Reference Links
|
Thanks to everyone who has contributed code to compute the phase of
the moon, and to the discussion of whether the phase of the moon is
profitably predictive for common stock investing. I have done some
testing and find that the phase of the moon is Not a profitable predictor.
I used the code posted by OzFalcon (thanks), removed the extraneous
information, such as distance to the moon, and added code to compute
two values: the percentage close to close change for the day ahead
and the percentage of the phase of the moon relative to it being a new
moon. My in-sample test was performed on daily data using a period
from 1/1/1995 to 1/1/2005 -- ten years. Three indices were studied --
the Russell 3000, the S&P 500, and the S&P 600 small cap. The
individual backtest results from these AmiBroker runs were exported,
opened in Excel, and analyzed. It was relatively easy to identify
periods where the price change for the day ahead consistently rose for
some values of the phase of the moon, and fell for some other values.
The analysis was carried out using several different levels of
granularity for the phase of the moon -- from one percent "bins" to
twenty-five percent bins -- and several different levels of
profitability -- from cherry picking the highest long and highest
short returns to "always in". Code was added to the afl procedure
that bought and sold accordingly, initially holding exactly one day.
No deduction was made for commission or slippage.
To test the in-sample performance, I ran individual backtests against
the 500 stocks in the S&P 500 and the 100 stocks in the Nasdaq 100.
No surprise -- the results were spectacular. For example, using
granularity that picked the best twenty percent (about fifteen percent
long and six percent short), so the model is invested twenty percent
of the time and flat eighty percent of the time, the median RAR
statistic for the S&P 500 stocks was about 80%, and the median RAR
statistic for the Nasdaq 100 stocks was about 160%.
To test the validity of the model, I chose an out-of-sample period
from 1/1/2005 through 9/1/2006 -- twenty-one months -- and reran the
individual backtests. As expected, the system is invested about
twenty percent of the time. The median RAR statistic for the S&P 500
stocks was about -7% (minus seven percent), and the median RAR
statistic for the Nasdaq 100 stocks was about 0% (zero).
I tried several other combinations of granularity of phase (various
percentages, daily, always in, etc), strength of signal (strongest
only, average of the in-sample tests, etc), length of holding period
(one day, several day, stop and reverse, etc). The results were
almost always profitable for the in-sample period and Never profitable
for the out-of-sample period, even with zero deduction for slippage
and commission.
I may have missed something here, but I do not think so. I would be
happy to hear from forum members who have had success (either
profitable trading or profitable performance in out-of-sample tests)
using moon phase in their trading, and I will be happy to test and
report other reasonable suggestions for using moon phase as a trading
indicator.
Thanks for listening,
Howard
|