PureBytes Links
Trading Reference Links
|
Rick,
First and foremost I have problems with anything that uses a peak,
trough, or zig because of the dynamic nature of these indicators.
That being said the zig trend cycle indicator should be providing a
varying lookback for the StochRSI calculation.
The Raftopoulos explanation says the indicator gives an output of +1
or -1 which would not fill the bill for what you want.
The indicator that you provided stays positive but goes all the way
down to 1 then spikes up for as long as a short trend is in effect.
It the drops very quickly to 1 once a trend has slowed but has not
been broken. I really think these spikes are far to quick. An ATR
indicator might work much better.
I did not get a floating point overflow error but did get some
division by zero errors. I think these are related to the low values
generated by the zig trend cycle indicator.
Hope this helps,
Preston
--- In equismetastock@xxxxxxxxxxxxxxx, rickbriggs1 <no_reply@xxx>
wrote:
>
> Thanks very much Preston for narrowing down the problem. I found one
> error in my "Zig Trend Cycle" formula, which is an adaptation of a
> Spyros Raftopoulos formula but I'm still getting a "An MSX DLL is
> reporting a floating point overflow error referenced DLL
> "forumdll.VarRSI" when I use it as a variable period input. It ("Zig
> Trend Cycle") plots fine on it's own, as does VAR StochRSI" but they
> don't together. Here is the code for "Zig Trend Cycle" with comments
> on the original by Mr. Raftopoulos. I have tried to make it a cycle
> count indicator. Please excuse my pathetic coding abilities:
>
> {The SR Zigzag Trend indicator.
> This indicator returns 1 for valid uptrend and -1 for valid
> downtrend, REJECTING ALL the INVALID readings of zig().
> It can be used as a stand-alone indicator (even in zig's place).
> It is useful for visual inspection but also for many other
purposes.
> ALL its readings (present and past ones) are trusty. It can be
safely
> used in systems and if pasted in the system tester its variables
can
> be even optimised.
> In my opinion one does not really need my "ZigZag Validity"
anymore.
> One can do the job much more effectively with "SR ZigZag Trend"
which
> is always reliable and safe. Additionally "SR ZigZag Trend" ("SR
ZZT"
> for short) returns also the direction of the trend. It is like
having
> an always-valid zigzag indicator!
>
> This indicator can calculate not only Close prices but also other
> price fields including various plots. This means that you can drop
it
> on RSI, Stochastics etc. provided that the "vr" value=0 (the "P"
> variable), which for this reason is the default option.
>
> One can also choose between the Percent and the Points method. The
> last one is better suited to indicators, especially those, which
> return negative values.}
>
> {******** Start of code **********}
>
> {SR ZigZag Trend (SR ZZT) v.4}
> {by Spyros Raftopoulos}
>
> {It is based on the Zig Zag indicator and it returns 1 for a
confirmed
> uptrend, and -1 for a confirmed downtrend.}
>
> {****************************************}
>
> vr:=CLOSE;
> amnt:=3;
> md:=1;
> {****************************************}
>
> zz0:=If(md=1, Zig(vr,amnt,%), Zig(vr,amnt,$));
> zz1:=Ref(zz0,-1);
> zz2:=Ref(zz0,-2);
> {****************************************}
>
> tr:=ValueWhen(1,zz0>zz1 AND zz1<zz2, zz1);
> pk:=ValueWhen(1,zz0<zz1 AND zz1>zz2, zz1);
> PU:=If(md=1,tr+Abs(tr)*amnt/100,tr+amnt);
> PD:=If(md=1,pk-Abs(pk)*amnt/100,pk-amnt);
>
> res:=If(vr>=PU AND zz0>zz1,1,
> If(vr<=PD AND zz0<zz1,-1,0));
> res:=If(res<>0,res,ValueWhen(1,res<>0,res));
> rescycle:=If(res = 1,(BarsSince(res=-1 AND Ref(res,-1)=1))-
> BarsSince(res=-1),(BarsSince(res=1 AND Ref(res,-1)=-1))-BarsSince
(res=1));
> res1:= If(res=1,BarsSince( res=-1),BarsSince(res=1));
> res:=If(res1>rescycle,res1,rescycle);
> res
>
>
> {******** End of code **********}
>
>
>
> --- In equismetastock@xxxxxxxxxxxxxxx, pumrysh <no_reply@> wrote:
> >
> > Rick,
> >
> > You may not be getting a value from the Fml("Zig Trend Cycle")
> > variable.
> >
> > To check this try:
> >
> > vp:=Fml("Zig Trend Cycle");
> > vp;
> >
> > When I replaced vp:=Fml("Zig Trend Cycle"); with
> > vp:= 10;
> > the plot was fine.
> >
> > Preston
> >
> >
> >
> >
> > --- In equismetastock@xxxxxxxxxxxxxxx, rickbriggs1 <no_reply@>
> > wrote:
> > >
> > > I'm trying to use the forum.dll functions to rewrite Chande's
> > StochRSI
> > > for variable periods and something is wrong somewhere. Can
anyone
> > spot
> > > the problem? It doesn't plot. I have included the original PS
> > StochRsi
> > > formula for reference at the end. Any help would be freatly
> > > appreciated. Thanks in advance. Rick.
> > >
> > > vp:= Fml("Zig Trend Cycle");
> > > Sum(ExtFml("forumdll.VarRSI",C,vp)-ExtFml("forumdll.VarLLV",
> > > ExtFml("forumdll.VarRSI",C,vp),vp),3)/Sum(ExtFml
("forumdll.VarHHV",
> > > ExtFml("forumdll.VarRSI",C,vp),vp)-ExtFml
("forumdll.VarLLV",ExtFml
> > > ("forumdll.VarRSI",C,vp),vp),3)*100;20;80
> > >
> > > {Original:
> > > Sum(RSI(10)-LLV(RSI(10),10),3)/Sum(HHV(RSI(10),10)-LLV(RSI
> > (10),10),3))*100;
> > > 20;
> > > 80}
> > >
> >
>
------------------------------------
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/
|