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

A pretty good oscillator for trend strength measurement


  • To: omega-list@xxxxxxxxxx
  • Subject: A pretty good oscillator for trend strength measurement
  • From: Mark Johnson <janitor@xxxxxxxxxxxx>
  • Date: Wed, 20 Oct 1999 07:49:53 -0700
  • In-reply-to: <199910191909.MAA06076@xxxxxxxxxxxxxx>

PureBytes Links

Trading Reference Links

October 19, 1999

I've been fooling around with indicators that try
to answer the question "Is this market in a trend?
And if so, how strongly is it trending?"  I found
one that looks sort of promising and I am including
it as an attachment to this message.

I suppose I should disclose my own personal trading
biases and preferences, in case they have accidentally
or deliberately influenced my efforts:

  * I am a long-term trendfollower and so I look
    for indications of long-term trends

  * I don't work with tick-by-tick data or with
    hourly data; I focus on daily bars

  * I seek an indicator that will work equally well
    on all markets that trend long-term; I don't
    want one indicator for Bonds, another for Yen,
    and a third for Coffee


With those caveats, I went looking for a "trendiness"
indicator and I think I might have found the beginnings
of one.  I call it "PG_trendosc" ("Pretty Good trend
oscillator") and it seems to work reasonably well.

To test out the indicator, I created a simple trading
system that uses the indicator and nothing else.
The system is merely
      if indicator > +3.0 then go long
      if indicator < -3.0 then go short
      if indicator crosses 0.0 then exit and go flat

As you can see, the performance of this system is 100%
determined by the performance of the indicator.  So
it's a quick and easy way to get a reading on whether
or not the indicator is performing well.

I subjected this little system to two different tests:
  (1) the MAXIMUM SLIPPAGE test;
  (2) the PORTFOLIO TRADING WITH BETSIZING test.
========================================================

The MAXIMUM SLIPPAGE test comes from Bruce Babcock's
book "Profitable Commodity Futures Trading from A to Z",
specifically the interview with Fred Gehm.  [by the way,
Fred's own book _Quantitative_Trading_&_Money_Management_
is *excellent*].  On page 178 of Babcock's book, Fred
Gehm describes his "torture test" for futures trading
systems:

   "...by subjecting it to the worst possible conditions.
   For example, he always assumes he is filled at the
   high of the day for buys, and the low of the day for
   sells.  "If a trading system survives that, it should
   be pretty resilient to other market adversities."

This is a GREAT idea.  It imposes the MAXIMUM SLIPPAGE
on a trade, both at the entry and at the exit.

Of course, this is hard to do using Omega Research
products.  So I implemented the MAXIMUM SLIPPAGE
test in other, non-Omega, software.  And I applied
it to the simple system (attached) that buys and
sells based on my trendiness indicator.

I ran the little system on 20 futures markets that I
happen to trade myself in my own real-money account.
   BP   CD   CL   CT   DM
   DX   FY   HG   HO   HU
   JO   JY   KC   LB   MB
   NG   SF   TU   TY   US

The test ran from 01 Jan 1987 to 07 Aug 1999, a
period of about twelve and a half years.  I
used exactly the same code and exactly the same
parameter values on all markets.

Although the simple trading system only buys
and sells at market-on-the-open, in this test
ORDERS WERE ALWAYS FILLED AT THE WORST POSSIBLE
PRICE: buy orders were filled at the high of
the day, sell orders were filled at the low of
the day.  On top of this, a commission of $25.00
per round trip trade was also assessed.

Under these conditions, the simple trading system
still managed to have 269 winning trades [and 379
losing trades], a winning percentage of 41.5%.
Average profit per trade (when trading one-lots)
was $438.95.  Think about that --- even with the
worst possible slippage on BOTH entry AND exit,
the system made over $400 per trade.  Wow.
That's pretty robust.  Imagine how much better it
would do when the oscillator is incorporated into
a more sophisticated system (having, for example,
trailing stops and MAE stops and filters and so on.)

It makes me think this is probably a Pretty Good
oscillator.
========================================================
========================================================


Next I applied some betsizing rules to the little
system and tested it using non-Omega software.
(It's difficult to test multicommodity systems
that trade all markets out of the same account,
using TradeStation)

The betsizing rules I used in this test were:

    Start off with $80K equity at the beginning of the test

    Bet a variable percentage of equity on every trade

    Make the variable percentage equal to 2.0%, times "A"
        where "A" is an "aggressiveness" factor.  When
        the account is small, we will be aggressive.  When
        the account is big, we will be unaggressive.

    Calculate A as a function of total account equity,
        using these piecewise linear equations:

        if (equity < 100K) or (equity > 1.3M) then A=1.0

        if (100K < equity < 180K) then
              A = 1.0 + ((equity - 100K)/80K)

        if (180K < equity < 600K) then
              A = 2.0 - (0.6 * (equity - 180K)/420K)

        if (600K < equity < 1.3M) then
              A = 1.4 - (0.4 * (equity - 600K)/700K)


I reverted back to normal commission+slippage of $75 per
contract per round trip trade, for this portfolio test.
The same 20 markets were tested for the same time period,
and the same buy and sell rules were used in all markets
(the same ones that were used in the MAX SLIPPAGE test).

The summary results for this portfolio+betsizing test were:

      80000.00     Starting equity
   88277536.00     Final equity
   88197536.00     Net profit
         72.85     Compound Annual Growth Rate (percent per yr)
         45.13     Max Drawdown (percent) on 920521
           239     Days in longest drawdown   ending on 960405
         1.614     (CAGR / MAXDD) Ratio
         46.53     Annual Standard Deviation (percent)
         30.52     Average max annual drawdown (percent)
        10.189     Percent of days making new equity highs
         1.458     Sharpe Ratio
         2.097     Semideviation Ratio
         6.248     Return Retracement Ratio
         1.645     Sterling Ratio
        870101     First day of test
        990809     Last day of test
          3288     # days in test
         75.00     Slippage and commission per round trip trade


I would point out that the Sharpe ratio is relatively
high, and so are the various modifications of the Sharpe
ratio that Jack Schwager presents in his book "Managed
Futures" (semideviation, RRR, etc).  The one that *I*
personally focus upon is the "CAGR/MAXDD Ratio" but you
may have a different favorite.

If you prefer to look at the full equity curve rather
than these end-of-test summary statistics, I've made
it available on the web, at
      http://www.mjohnson.com/trecipes/pg1.xls

When I look at these test results, again I come to
the conclusion that this is probably a Pretty Good
oscillator.

Try it out for yourself -- horse around with the
oscillator, or the simple trading system, or both.
See what YOU think.  Improve it if you want.  Learn.
Have fun.  Trade well.

I hope you enjoyed reading this.

  -Mark Johnson
   mark@xxxxxxxxxxxx

Attachment Converted: "c:\eudora\attach\Pg_sys1.ela"

--
   Mark Johnson     Silicon Valley, California     mark@xxxxxxxxxxxx

   "... The world will little note, nor long remember, what we
    say here..."   -Abraham Lincoln, "The Gettysburg Address"