[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there really another way



PureBytes Links

Trading Reference Links

At 9:10 PM -0400 7/5/98, Cab Vinton wrote:
>Bob Fulks wrote:
>
>> when I design a trading system, I fall back to more fundamental
>> statistical properties of the price patterns. And they do not
>> have to be very complex. And they can easily be programmed in
>> TradeStation.
>
>Which "fundamental statistical properties" did you have in mind?
>
>And if you're in an expansive mood, how do you use them?


I don't know how to explain it in a short message without pictures but will
try.

I first stare at a price waveform and try to find some characteristic that
I think might be tradeable (repeatable). I then develop a way to isolate
that characteristic on historical data. After the fact it is usually pretty
easy. I then gather statistics on the characteristic to see if it is
statistically significant. If it is, I then try to design a system to find
it in real time - as it is happening. This last step is obviously the most
difficult and can only be approximated.

A simple example might make this clearer. Assume we want to trade the S&P
cash index and think that the daily chart has short term tops and bottoms
about every 10 days. (It tends to)

We can create a "ShowMe" that will plot points on the highs and lows using
the SwingHigh and SwingLow functions in TradeStation. A quick look shows
points about every 10 days so it looks pretty good. We can then arrange a
print statement to print to a file the dates of all the local highs and
lows and export the dates into Excel. We can then create histograms and use
all the various statistical tools in Excel to see how repeatable this
characteristic is.

It looks reasonably repeatable so now we need to try to find this
characteristic in real time. In this case we are looking for a periodic
component that occurs around every 10 days. So we would like to isolate
this component from the other information in the price pattern to see if we
can generate trading signals from it. We design a filter that passes data
with a period in the range of perhaps 5 to 15 bars. I usually use
combinations of various moving averages for this. (A moving average is a
filter that can be used to remove periodic components with fewer than some
number of bars.)

You can then create an indicator to plot the resulting filtered signal to
compare it with the original price signal. It should be a lot smoother and
have the trend removed so that it oscillates around the zero line. Many
common oscillators such as MACD have a similar structure and use similar
moving average filters. Ideally, the tops and bottoms of our resulting
signal will occur at or near the same bars as the tops and bottoms of the
ShowMe we created above. We can test this with correlation functions and
adjust the characteristic of the filters so that we get good correlation of
tops and bottoms.

Now we need to generate signals near the tops and bottoms of our trading
signal. Simple things such as:

  if Sig > Sig[1] then buy
  if Sig < Sig[1] then sell

work pretty well but lag a little. Let's use this in our example.

Now we probably get too many unprofitable trades. For example, we probably
want to trade only with the trend (when the trend is up, we want to go long
and flat, when the trend is down, we want to go short and flat, and when
the trend is flat, we may want to go both long and short). So we need a way
to determine the trend. (There are lots of ways to do this, none perfect.)
So we then use a trend signal to filter out trades. Assuming a Trend
function that returns values: up = 1, down = -1, and no trend = 0

  if Trend >= 0 and Sig > Sig[1] then Buy;
  if Trend <= 0 and Sig < Sig[1] then Sell;
  if Sig > Sig[1] then ExitShort;
  if Sig < Sig[1] then ExitLong;

This is better. But maybe we still get too many losing trades. So we decide
to try entering only when the price is heading in the right direction:

  if Trend >= 0 and Sig > Sig[1] then Buy  next bar at H + BOffset stop;
  if Trend <= 0 and Sig < Sig[1] then Sell next bar at L - SOffset stop;
  if Sig > Sig[1] then ExitShort;
  if Sig < Sig[1] then ExitShort;

where BOffset and SOffset are parameters we can optimize.

We then look at a lot of trades and see if they look OK. If not we may try
to find some other systematic reason to filter out more poor trades.

We then look at a plot of the equity curve vs. time to see if it moves
smoothly up and to the right. This indicates a system with consistent
performance and a high Sharpe Ratio. I jagged equity curve indicates
inconsistent performance, likely due to chance.

Hopefully his simple example will illustrate the idea. We start with what
we think is some repeatable characteristic of the price (or volume, etc.)
data. We test it statistically to see if it is repeatable. We then try to
isolate it from the noise and have it generate a trading signal. Then we
try to filter out trading signals that are unprofitable using various
logical criteria, testing at each step to see if we are making improvements.

To me, this process is a lot more logical than something like:

  if ADX(Len1) > 30 and RSI(Close, 23) < 20 and MACD(Close, 9, 23) > 20....
then Buy...

I would never be able to figure out what something like that is going to do.

Bob Fulks