PureBytes Links
Trading Reference Links
|
All,
Several people have asked me to explain the rationale behind my
MetaStock Profit System tests. I thought that would be a good idea if
I could remember why I did them the way I did <G>. I decided to start
with my latest, the DI, S/C test which I'll copy below.
A few weeks ago, Tom suggested that I look at the Demand Index
(DI) which he had found to be a good leading indicator. The Demand
Index developed by James Sibbet is built into MS6.5. It combines
price and volume in such a way that it is often a leading indicator of
price change. The calculations are complex requiring 21 columns in a
spreadsheet to calculate and I haven't the slightest idea what they
are <G>. However, with my engineering background, that doesn't bother
me as long as it works. I plotted DI as a histogram and looked at it
with several of the stocks in my database and it did look promising,
being bearish when negative, bullish when positive, and the crossovers
looking like good buy sell points.
That suggests a simple MetaStock test with CROSS(DI(),0) being
the buy and CROSS(0,DI()) being the sell. That did work well on some
of my stocks, but a simple crossover system gives lots of whipsaws and
false signals. I wanted to reduce the false signals and the first
thing I always try for that is to smooth the data so I used Tema
smoothing. That would make the buy signal CROSS(Tema(DI(),21),0) and
that does work better.
Another technique that helps is to vary the smoothing periods
until you find one that fits the natural cycle of the chart. So the
next step was to optimize the smoothing period. The danger here is
not to over optimize until you curve fit the chart which gives
tremendous back test results, but has doubtful predictive
capabilities. I normally choose Fibonacci numbers for optimizing and
I wanted to optimize from a short period to a mid term period using
the 8, 13, 21, 34, 55 Fibonacci numbers. You can't do that in MS6.5
because you have to set a min, max, and step. I compromised with a
min of 8, max of 60, and step of 13 which gave me 8, 21, 34, 47, and
60. So using those opt numbers, the new buy signal became
CROSS(Tema(DI(),opt1),0) . The sell signal is
CROSS(0,Tema(DI(),opt1)). Remember, all we are doing is buying when
the indicator crosses zero from the bottom and selling when it crosses
from the top, but we are smoothing the indicator over an optimized
period.
The next step is to further reduce whipsaws. This is done by
looking at the charts and selecting a number above zero for the buy
and a number below zero for the sell that looks like it will reduce
the number of false signals without significantly reducing the profit
on good signals. My eyeballs said that the buy number was +5 and the
sell number was -13. Again, I tend to use Fibonacci numbers, but you
might want to experiment with others. In general, the further you go
above/below zero, the fewer false signals you get at the cost of
giving up profit on good signals.
The next step is to further reduce false signals by confirming
the signal with one or more indicators before issuing the signal.
This is normally a good technique that can enhance the overall
performance by reducing false signals at the cost of occasionally
passing up good signals. I chose Tema(S/C) and Mov(C,21,VAR) for my
confirming signals. Essentially, I want them to both be rising for a
buy signal and both to be falling for a sell signal. I test this with
the Highest High Value and Lowest Low Value tests. In general if the
High in the last 13 days occurred in the last 5 days one can say that
the indicator is rising. Conversely, if the Low in the last 13 days
occurred in the last 5 days, one can say that the indicator is
falling. The problem here is that all three signals will seldom exist
on the same day. To solve this problem we set a flag when the first
signal occurs and say that if the other two both occur on any given
day within the next 13 days a signal will be issued. This is done
with the Alert function. That essentially completes our basic
buy/sell philosophy and the enter Long and enter Short signals are
issued from the formulas below.
The final step is to see if we want to get out of an open Long
position before a Sell is issued and vice-versa. The answer to this
is usually yes since you want a lot of conditions in your favor before
entering a position, but want to get out as soon as the critical
condition turns against you. The trick is to determine the critical
condition. Since this is a DI test, it makes sense that DI should be
the trigger. I use Tema(DI(),OPT1) <-5 to close the long and
Tema(DI(),opt1)>5 to close the Short position. You can change the
results by playing with these numbers.
That's it. The actual test is copied below. You can use this
test philosophy for any indicator that is bullish when positive and
bearish when negative and is normally plotted as a histogram. Yell if
you have any questions.
Jim
MetaStock for Windows System Tester
======================================================================
=
02_DI, S/C (Vol Required)
SIGNAL FORMULAS
---------------
Enter Long:
Alert(Cross(Tema(DI(),opt1),5),13) AND
HHV(Tema(10000*LinRegSlope(C,34)/C,34),5) =
HHV(Tema(10000*LinRegSlope(C,34)/C,34),13) AND
HHV(Mov(C,21,VAR),5) = HHV(Mov(C,21,VAR),13)
Close Long:
Tema(DI(),opt1) < -5
Enter Short:
Alert(Cross(-13,Tema(DI(),opt1)),13) AND
LLV(Tema(10000*LinRegSlope(C,34)/C,34),5) =
LLV(Tema(10000*LinRegSlope(C,34)/C,34),13) AND
LLV(Mov(C,21,VAR),5) = LLV(Mov(C,21,VAR),13)
Close Short:
Tema(DI(),opt1) > 5
OPTIMIZATION VARIABLES
----------------------
OPT1: Min = 8.00 Max = 60.00 Step = 13.00
STOPS ALL OFF
----------------------------------------------------------------------
-
|