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

Re: PGTrend for TS2000



PureBytes Links

Trading Reference Links

Message text written by INTERNET:omega-list@xxxxxxxxxx
>Mark Jurik posted a simplified version of this code earlier.

I have made the parameters inputs in the version below. With the 
defaults shown, this code does exactly the same thing as the original 
code. (Make sure the MaxBarsBack setting is 92 for both systems.)

The simpler code makes it easy to see what is actually happening.

Since the term:

     Average(Close, Length1)

lags the Close by ((Length1 - 1) / 2) bars, this term is positive 
when the trend is up. This is basically the usual moving average 
crossover system with three important differences:

   > The short average of the moving average crossover system is
     replaced by the unaveraged Close

   > There is a dead band in the middle to help eliminate the usual
     whipsaws of a moving average crossover system

   > The dead band is adaptively adjusted by the volatility of the market

To understand this we need to rearrange the terms a little.

Restating the equation for the buy point in a little simpler notation:

    Close - (AverageClose) / (XAverageTrueRange) > 3

Rearranging:

    Close - (AverageClose) > 3 * (XAverageTrueRange)

so the size of the dead band is directly proportional to the volatility.

By comparison, the usual moving average crossover system buy point 
can be written as:

    ShortAverageClose - (LongAverageClose) > 0

So the dead band makes it harder to enter by a self-adjusting amount, 
eliminating a lot of the whipsaws.

Interesting system.

Bob Fulks



===========================================

Input: EntLevel(3), ExLevel(0), Length1(89), Length2(89.9090);
Vars:  MP(0), Osc(0);

MP = MarketPosition;

Osc = (Close - Average(Close, Length1)) / XAverage (TrueRange, Length2);

if MP < 1 and Osc > +EntLevel then Buy        at market ;
if MP = 1 and Osc < +ExLevel  then ExitLong   at market ;
if MP >-1 and Osc < -EntLevel then Sell       at market ;
if MP =-1 and Osc > -ExLevel  then ExitShort  at market ;

============================================



<