MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

 A B C D E F G H I J K L M N O P R S T U V W Y Z #

Moving Average - Shift'ed Bands by Corey Saxe

----- Original Message -----
From: Nick Channon
To: metastock@xxxxxxxxxxxxx
Sent: Friday, December 21, 2001 8:02 AM
Subject: Formula help

I wonder if anybody can give me a clue as to how to achieve the following:

I have plotted a 200-day exponential moving average, and also:
* above it, the same MA but with a vertical shift of 0.1%
* below it, the same MA but with a vertical shift of 0.1%

This obviously creates 3 parallel bands.

I want to set up an alert that fires when the price touches or drops below the top band, and another that fires when the price touches or rises above the bottom band.

All suggestions welcome.

Many thanks,
Nick

--

Nick,

Moving Average - Shift'ed Bands - Plot

V1:=Input("Mov periods",2,500,200);
V2:=Input("% shift",0,50,.1);
A1:=Mov(C,V1,E);
A2:=A1+(A1*(V2/100));
A3:=A1-(A1*(V2/100));
A1;
A2;
A3

Moving Average - Shift'ed Bands - Alerts

V1:=Input("Mov periods",2,500,200);
V2:=Input("% shift",0,50,.1);
A1:=Mov(C,V1,E);
A2:=A1+(A1*(V2/100)); {Top band}
A3:=A1-(A1*(V2/100)); {Bottom band}
Alert(C=A2 OR Cross(A2,C),1); {Top band contact OR crossing}
-Alert(C=A3 OR Cross(C,A3),1); {Bottom band contact OR crossing, minus sign in front makes it easier to see plot}

0.1% might be too tight. I would try ~5% shift.

-Corey.
Source / From: TOP
http://purebytes.com/archives/metastock/

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.