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

RE: Setting colour on a multi-plot indicator


  • To: <metastock@xxxxxxxxxxxxxxxxxx>
  • Subject: RE: Setting colour on a multi-plot indicator
  • From: "Bill Irwin" <Bill-Irwin@xxxxxxxx>
  • Date: Fri, 12 Jan 2001 13:11:38 -0800
  • In-reply-to: <NEBBLKHFFBPAJCIPNOCLCEHBCAAA.dave_nadeau@xxxxxxxxx>

PureBytes Links

Trading Reference Links

Dave:
I've been wrestling with this System trying to improve it, amid all the
other demands on my time during the holidays.  See below:

> -----Original Message-----
> From: owner-metastock@xxxxxxxxxxxxx
> [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of Dave Nadeau
> Sent: Monday, December 25, 2000 9:57 PM
> To: metastock@xxxxxxxxxxxxx
> Subject: RE: Setting colour on a multi-plot indicator
>
> At this point you run an exploration across the TSE and get
> the results as
> you suggested.  Certainly, your average return tells you how
> this system
> performs over the broad market.  It's nice if it does better on more
> securities, but I'm of the opinion that it's very unlikely
> that a single
> system will work well on every market.

When an Exploration's Equity column shows +25 I think that means that the
trades gained $25/share over the run.  Is this correct?

> From here, I would sort those results and look at the best
> performers.  On a
> chart of those, I'd plot the equity line that you have programmed.  A
> smoothly rising equity line suggests consistent, repeatable
> performance in
> the past which should have predictive value for the future,
> assuming that
> you have a fairly high number of trades that this is based on.

How many is a "high number"?

What this system needs now is an exit signal for both long and short
positions that should be terminated.  The Positions indicator is always in
either a long or short position once the crossover occurs that is the
opposite of the first crossover (it misses the first opportunity).  We need
to recognize that a signal may be false because the trend doesn't continue
long enough for all the MAs to cross over so that the opposite signal can be
generated.  In other words, some times after a long signal, the price trends
down before the Medium MA has crossed above the Long MA.  Hence a short
signal isn't generated and the position stays long all the way through the
slide and up through (what should be) the next long position.  The closest
I've been able to come follows:

_Triple MA Crossovers:
Sma := FmlVar("_Triple MA","ShortMA");
Mma := FmlVar("_Triple MA","MediumMA");
Lma := FmlVar("_Triple MA","LongMA");
LongSignal := Cross(Sma, Mma) AND
    Lma > Mma;
ShortSignal := Cross(Mma, Sma) AND
    Lma < Mma;
FalseLong := BarsSince(LongSignal) <=
    BarsSince(ShortSignal) AND
    Sma < Mma;
FalseShort := BarsSince(ShortSignal) <=
    BarsSince(LongSignal) AND
    Sma > Mma;

 _Triple MA Positions
BuyLong := 		FmlVar("_Triple MA Crossovers", "LongSignal");
SellShort := 	FmlVar("_Triple MA Crossovers", "ShortSignal");
ExitLong := 	FmlVar("_Triple MA Crossovers", "FalseLong");
ExitShort := 	FmlVar("_Triple MA Crossovers", "FalseShort");

If(BarsSince(Ref(BuyLong,-1)) <= BarsSince(Ref(SellShort,-1)) AND
    (ExitLong = 0 OR
    BarsSince(BuyLong) <= BarsSince(ExitLong)), +1,
    If(BarsSince(Ref(SellShort,-1)) <= BarsSince(Ref(BuyLong,-1)) AND
        (ExitShort = 0 OR
        BarsSince(SellShort) <= BarsSince(ExitShort)), -1,0
    )
);

The Positions indicator misses several Long and Short triggers early in the
graph.  I haven't figgered out why yet but I suspect my efforts at defining
an early exit are preventing positions to be taken.  I need a way to set a
variable when a position has been entered that can be referenced when
deciding if an exit should be done.  The exit indicator shouldn't turn on
unless the condition exists AND we're currently in the position that the
exit is trying to get us out of.  More study needed here...

I'm having difficulty identifying a position that's been exited while the
condition to enter the position is still true.  In other words, After a Long
position is entered and the ShortMA drops back below the MediumMA, the
FalseLong indicator fires to exit the position.  Then, if the Short pops
back above the Medium, a Long position is taken again.  I need to smooth out
the short, temporary conditions that trigger an entry.

Any ideas would be greatly appreciated.

Bill