PureBytes Links
Trading Reference Links
|
Cameron,
The code:
{This will not work}
SD:= LastValue(Mov(20,Stdev(C,60),s);
Should be:
{This will work}
SD:= LastValue(Mov(Stdev(C,60),20,S));
Remember, the number of lookback periods must be constant unless as
you have seen you are using a DLL which allows a variable lookback.
Then I looked through the archived group messages and found the
following which was posted in 2004.
Hope this helps,
Preston
{Sigma Bands}
pds:= Input("LR Periods",10,100,55);
a:= Input("Stdev Periods",10,100,30);
s1:=Input("Smoothing Periods",2,50,10);
r:=LinearReg(C,pds);
x:=Mov(r,s1,S);
x1 :=x+1*Stdev(C,a);
x2 :=x+2*Stdev(C,a);
x3 :=x+3*Stdev(C,a);
y1:= x-1*Stdev(C,a);
y2:= x-2*Stdev(C,a);
y3:= x-3*Stdev(C,a);
X;x3;x2;x1;
y1;y2;y3;
{End}
=================================
{Sigma Bands (no smoothing)}
A:= Input("Periods?",1,300,21);
x:=Mov(C,a,S);
x1 :=x+1*Stdev(C,a);
x2 :=x+2*Stdev(C,a);
x3 :=x+3*Stdev(C,a);
y1:= x-1*Stdev(C,a);
y2:= x-2*Stdev(C,a);
y3:= x-3*Stdev(C,a);
X;x1;x2;x3;
y1;y2;y3;
{end}
--- In equismetastock@xxxxxxxxxxxxxxx, Cameron Reid <cwr_74@xxx>
wrote:
>
> Hi Steve,
>
> First, I made an error in the code I first posted:
>
>
> {This will not work}
> SD:= LastValue(Mov( 20,Stdev( C,60),s);
>
> {This will work}
> SD:= LastValue(ExtFml("Forum.MOV",Stdev(C,60),20,s));In either case
Stdev {standard deviation} can be replaced with Ste {standard error}.
>
> I try not to put too much effort into exactly right; there is far
too much noise in financial markets for this to make sense. I do
like to try to replicate the work of others as a starting point for
my own creative efforts.
>
> Mostly I was looking for an intellectually acceptable reason to
modify the band widths to fit the chart. I have more comfort if I
can find a reason instead of just datamining.
>
> Thanks for your comment.
>
> Cheers,
>
> Cameron
>
>
>
>
>
> To: equismetastock@xxx: skeeter47@xxx: Thu, 17 Jul 2008 09:25:44 -
0700Subject: Re: [EquisMetaStock Group] Sigma Bands
>
>
>
>
>
>
>
>
>
> Cam,
>
> Can't help from a formula perspective...but, keep this in mind: For
years, I used an eight period Standard Error Band. By chance, I
stumbled on to some work posted about Forex that was using BB Bands.
I quickly discovered that substituting the SEBs for the BBs, I got
much better testing results. Since that time, I am now using SEB in
the range of 50-120 days. This is a far cry from eight!
>
> My point is that way too much is made out of "exacting" and
duplicating a formula or trying to replicate system rules to a tee.
Allow common sense and your technical ability to improve on what has
been written. You might be twice as good a trader than the author.
Gee, Lind-Waldock, Chicago Merc and others have published articles
that I have penned (and I'm a total "nobody"). It does not mean that
I am a dragon slayer. It does mean that I am willing to share an
approach that has merit.
>
> Remember, the markets are dynamic and that changes in volatility
are the biggerst system "killas". Fit all approaches to current
conditions. Don't ever get stubborn. Always, put your spin on
various approaches and I think you will have more confidence when
putting them into play. Btw, I'm sure that your math education
exceeds the average trader's. I hope you find the answer your
questions.
>
> Take care,
>
> Steve--- On Thu, 7/17/08, Cameron Reid <cwr_74@xxx> wrote:
> From: Cameron Reid <cwr_74@xxx>Subject: [EquisMetaStock Group]
Sigma BandsTo: "equismetastock@xxxxxxxxxxxxxxx"
<equismetastock@xxxxxxxxxxxxxxx>Date: Thursday, July 17, 2008, 9:53 AM
>
>
>
> Good Morning,
> Over the past few months there have been a few comments regarding
2nd order polynomials (parabolas) as a means to approximate the price
curve and sigma bands as a way to measure the chances of a stock
moving higher. I was able to find a graphic example of this at
http://sigmabands. blogspot. com/ . According to the author /
blogger the center line in based on 250 bars worth of data and the
sigma bands are each spaced one standard deviation apart. I am
assuming that the standard deviation data is also based on 250 bars,
although this is not mentioned specifically.
> What I thought was quite interesting / impressive about these
examples is that, visually, it appears that the price series does
spend roughly 2/3rds of the time within the first sigma bands and
roughly 2% of the time outside the third sigma bands. Exactly what
you would like to see. Bollinger Bands, to me, have never shown this
level of consistency.
>
> I purchased Umits Trend Toolbox (I have no financial interest in
this product at all) so that I could plot a second order polynomial
fitted to the price curve. This curve on my charts was the same
shape as the those on the web site, but roughly 10 pts or 1% higher;
not really a big deal. Where my efforts began to stumble was with
the Sigma bands.
>
> To get the sigma bands equally spaced at all point I used to
following construction:
> SD:= LastValue(Stdev( C,60));
> And then I added / subtracted this value to / from the centre line
to create my first sigma bands.
> As an aside, I am thinking about this to smooth out the Standard
Deviation value:
> SD:= LastValue(Mov( 20,Stdev( C,60),s);
>
> The key difference is that my standard deviation value on the S&P
500 is near 80 and the website lists theirs at 25. I¢m off by a
mile. Additionally, as you would assume, nearly 100% of prices are
within the first standard deviation; this should not be the case.
This pattern repeated itself on a number of individual stocks that I
tested this on.
> Perhaps someone who has a better grasp of statistics might be
willing to share why Metastock¢s Stdev value is so significantly
different?
> I know that I could fix this by just dividing the value by some
number between 2 and 3; however, this is not very satisfying.
> Also, I am looking at testing an long exit strategy whereby trades
are closed when the 60-day parabola makes it¢s first move down.
>
> Cheers,
>
> Cameron
>
> Stay in touch when you're away with Windows Live Messenger. IM
anytime you're online.
>
>
>
>
>
> _________________________________________________________________
> Time for vacation? WIN what you need- enter now!
> http://www.gowindowslive.com/summergiveaway/?ocid=tag_jlyhm
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/equismetastock/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:equismetastock-digest@xxxxxxxxxxxxxxx
mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|