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

[EquisMetaStock Group] Re: ROC formula



PureBytes Links

Trading Reference Links

Preston,

It's my fault i didn't mention it since I mostly write down ratios of
change without multiplying by 100.
About the corrected version, it's of course right though you could
simply leave it as 100*(c/wh-1), since c/wh-1=(c-wh)/wh  :)
Hope this fixes my previous note.
Now, in case one needs to come up with some sort of "backTesting" the
long side, might find useful the following formula,

{9/21 crossover performance, atc}
{This formula is for 'backTesting' the 9/21 crossover,
though it of course can be used for any other buy/sell simple strategy
by simply replacing the buy/sell signals below.
comEntry and comExit stand for the commisions paid upon entry and exit
respectively in terms of percentage, thus 0.5 stands for 0.50%.}

comEntry:=0.5;
comExit:=0.5;
buy:=Cross(Mov(C,9,S),Mov(C,21,S));
sell:=Cross(Mov(C,21,S),Mov(C,9,S));
permLong:=If(BarsSince(buy)<BarsSince(sell),1,0);
sigbs:=buy-sell;
a:=ValueWhen(1,sigbs=1,C);
performance:=100*(Exp(Cum(Log(If(sigbs=1,1/(1+comentry/100),If(sigbs=-1,C*(1-comexit/100)/Ref(C,-1),If(permlong=1,C/Ref(C,-1),1))))))-1);
trades:=Cum(buy);
buyandhold:=Exp(Cum(Log(If(trades>0,C/Ref(C,-1),1))));
performance;


Regards,
mc

--- In equismetastock@xxxxxxxxxxxxxxx, pumrysh <no_reply@xxx> wrote:
>
> mc,
> 
> Went back and reviewed your formula...something didn't seem right.
> 
> Below is a corrected version of your indicator and two more using the 
> Metastock Users guidelines.
> 
> 
> MS Users Manual:
> The following formula calculates the 12-period Price Rate-Of-Change:
> (( C - ref(C,-12)) / ref(C,-12)) * 100
> The 12-period rate-of-change can also be written using the roc() 
> function shown below:
> roc( close, 12, % )
> The 12-period rate-of-change can be expressed in "points" using the 
> following formula:
> close - ref(close, -12)
> 
> 
> Panther ROC Points {corrected}
> a:=Mov(C,9,S);
> b:=Mov(C,21,S);
> wh:=ValueWhen(1,Cross(a,b),C);
> If(a>=b,C/wh-1,0)*100
> 
> 
> Panther ROC Percentage
> a:=Mov(C,9,S);
> b:=Mov(C,21,S);
> wh:=ValueWhen(1,Cross(a,b),C);
> If(a>=b,((C-wh)/wh)*100,0)
> 
> 
> Panther ROC Points
> a:=Mov(C,9,S);
> b:=Mov(C,21,S);
> wh:=ValueWhen(1,Cross(a,b),C);
> If(a>=b,C-wh,0)
> 
> 
> Again thanks for your help with this! I'm sure Yahya will find them 
> useful.
> 
> Preston
> 
>  
> 
> --- In equismetastock@xxxxxxxxxxxxxxx, pumrysh <no_reply@> wrote:
> >
> > mc,
> > 
> > Kudos for thinking outside of the box!
> > 
> > The values for the two indicators are different but this is still 
> an 
> > approach that could be used.
> > 
> > Thanks for submitting it.
> > 
> > Preston
> > 
> >  
> > 
> > 
> > --- In equismetastock@xxxxxxxxxxxxxxx, "p_panther_73" <mchantzi@> 
> > wrote:
> > >
> > > Well, there seems to be another way:
> > > 
> > > Try this one:
> > > 
> > > a:=Mov(C,9,S);
> > > b:=Mov(C,21,S);
> > > wh:=ValueWhen(1,Cross(a,b),C);
> > > If(a>=b,C/wh-1,0)
> > > 
> > > Regards,
> > > 
> > > mc
> > > 
> > > --- In equismetastock@xxxxxxxxxxxxxxx, pumrysh <no_reply@> wrote:
> > > >
> > > > Yahya,
> > > > 
> > > > Your formula would require a variable lookback period for the 
> > ROC. 
> > > > The only way to accomplish this would be to use a variable DLL 
> of 
> > the 
> > > > ROC.
> > > > 
> > > > There is one in our files section that you could use. 
> > > > Your formula would look like this:
> > > > 
> > > > a:=Mov(C,9,S);
> > > > b:=Mov(C,21,S);
> > > > x:=If(a>=b,1,0);
> > > > y:= BarsSince(x<1);
> > > > ExtFml("Forum.ROC",C,y,0)
> > > > 
> > > > 
> > > > Hope this helps,
> > > > 
> > > > Preston
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > --- In equismetastock@xxxxxxxxxxxxxxx, Yahya Kemal Beler 
> > > > <yahyakemalbeler@> wrote:
> > > > >
> > > > > Hi,
> > > > > 
> > > > > I want to develop a formula like this:
> > > > > 
> > > > > a:=Mov(C,9,S);
> > > > > b:=Mov(C,21,S);
> > > > > x:=If(a>=b,1,0);
> > > > > y:= BarsSince(x<1);
> > > > > 
> > > > > ROC(c,y,%)
> > > > > 
> > > > > But how?
> > > > > 
> > > > > Thanks
> > > > >
> > > >
> > >
> >
>



------------------------------------

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/