Here is Matt's $Silver % +/- 200MA chart from his
newsletter.
FWIW, second chart is my TS version using a simple oscillator
indicator, so the % difference can be calculated automatically.
Horizontal '0' line represents the MA.
Here is the TS code if anyone wants to track any given security
for % +/- price extremes vs any stipulated MA (and MA type):
Inputs:
Length(200),
Price(close),
MA_Type(1);
Vars:
PctAboveBelowAvg(0),
MyMovingAvg(0);
if currentbar>length then
begin
if MA_Type=1 then
MyMovingAvg = Average(Price, Length);
If MA_Type=2 then
MyMovingAvg = xAverage(Price, Length);
If MA_Type=3 then
MyMovingAvg = wAverage(Price, Length);
If MA_Type=4 then
MyMovingAvg = triAverage(Price, Length);
end else
MyMovingAvg=price;
PctAboveBelowAvg = iff(Price > 0,100*(Price -
MyMovingAvg)/MyMovingAvg, -1) ;
Plot1(PctAboveBelowAvg);
Plot2(0);
Newsletter
Subscribe to our email list for regular free market updates
as well as a chance to get coupons!
$Silver % +/- 200MA
SLV
Posted by philosoraptor on 2nd of May 2011 at 11:36 am
Here is Matt's $Silver % +/- 200MA chart from his newsletter.
FWIW, second chart is my TS version using a simple oscillator indicator, so the % difference can be calculated automatically. Horizontal '0' line represents the MA.
Here is the TS code if anyone wants to track any given security for % +/- price extremes vs any stipulated MA (and MA type):
Inputs:
Length(200),
Price(close),
MA_Type(1);
Vars:
PctAboveBelowAvg(0),
MyMovingAvg(0);
if currentbar>length then
begin
if MA_Type=1 then MyMovingAvg = Average(Price, Length);
If MA_Type=2 then MyMovingAvg = xAverage(Price, Length);
If MA_Type=3 then MyMovingAvg = wAverage(Price, Length);
If MA_Type=4 then MyMovingAvg = triAverage(Price, Length);
end else
MyMovingAvg=price;
PctAboveBelowAvg = iff(Price > 0,100*(Price - MyMovingAvg)/MyMovingAvg, -1) ;
Plot1(PctAboveBelowAvg);
Plot2(0);