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

[EquisMetaStock Group] Re: Help needed



PureBytes Links

Trading Reference Links

Hi Preston,

I am looking for a 5 day-range-switch as in the following 2 day 
range switch.

It looks for a close higher than the high of the previous 5 days and 
changes position when the close is lower than the previous 5 day low.

This is the advisor code for a  2 day range switch. I wonder how it 
be changed to a 5 day range.

d:=If(C>Ref(Max(H,Ref(H,-1)),-1),Min(L,Ref(L,-1)),If(C<Ref(Min(L,Ref
(L,-1)),-1),Max(H,Ref(H,-1)),PREV));

a:=Cross(C,d);
b:=Cross(d,C);

state:=If(BarsSince(a)<BarsSince(b),1,0);

state>Ref(state,-1)


Thanks

Parthasarathy



--- In equismetastock@xxxxxxxxxxxxxxx, pumrysh <no_reply@xxx> wrote:
>
> Parthasarathy,
> 
> Can you explain what you mean by a "5 day range switch" ?
> 
> Preston
> 
> 
> 
> --- In equismetastock@xxxxxxxxxxxxxxx, "parthaab" <parthaab@> 
wrote:
> >
> > Friends,
> > 
> > I am looking for a 5 day range switch code.
> > A customisable 'days' where I can replace the '5 days' with 3,4, 
5 
> or 
> > 6 days, would be even better.
> > 
> > 
> > Can anyone help?
> > 
> > Thanks
> > Parthasarathy
> >
>




 
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/