Hi
I was hoping someone could help me code a moving average indicator for a P&F chart in metastock, the only example i have found is here, but cant seem to get it to work in metastock even though i follow the "copy and paste example"
Any help would be much appreciated.
Point and figure (P&F) charting has always been touted as a
stand-alone charting technique, requiring no other indicators nor any
other confirmation. But it's always good to have confirmation, and to
that end, here's a customized simple moving average (SMA) that may be
useful.
Because P&F is unique in that it has no linear time base
(days, weeks, or months), our plain-vanilla SMA will not work. This is
because the standard simple moving average is based upon a time period
(days, weeks, or months) that fits the standard bar (or candlestick)
charts beautifully. Without a linear time base, however, a simple
moving average overlay on a P&F chart would have no relationship to
the changing price pattern of the plotted Xs and Os in which Xs denote a
rise in price and Os a decline.
The input to a moving average
formula is normally the close of the bar (day, week, or month), although
the high or low may be used if desired. To construct the SMA, we will
use the midpoint of the P&F column, which is analogous to
the midpoint of a conventional daily or weekly bar. A conventional MA is
constructed by adding together the observations over the period
desired and dividing the sum by the number of observations. We will
follow the same procedure to construct our P&F simple moving
average.
The first step is to enter the indicator builder of our
charting program. If the program allows the construction of customized
indicators, it will usually have a "paste function" utility. Here are
two examples:
In SuperCharts, the moving average function is
AVERAGE (PRICE, PERIOD). Normally, for PRICE you would enter H, C, or
L. We will enter (H+L)/2 (the midpoint of the column). For PERIOD we
will enter 5 for one average, and 10 for the other.
In
MetaStock, the moving average function is MOV ( DATA ARRAY, PERIOD, S,
E). For DATA ARRAY we will enter (H+L)/2, for PERIOD we will enter 5 or
10, and S for simple.
Finally, we will overlay our P&F chart
with the two simple moving averages we've just constructed. We will
also change the standard three-box P&F reversal to a one-box
reversal. This provides a greater array of Xs and Os for a more
accurate display of the moving averages. Since I chose a one-box
reversal, I chose five- and 10-period moving averages for my trials. (I
have not yet experimented with three-box reversals. If you do, I'd
appreciate an email with your results.)
Thanks in advance