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

Re: [EquisMetaStock Group] barssince - what am I doing wrong??



PureBytes Links

Trading Reference Links

------------------------------------------------------------------------
You cannot reply to this message via email because you have chosen not
to disclose your email address to the group.

To reply:  http://groups.yahoo.com/group/equismetastock/post?act=reply&messageNum=5200
------------------------------------------------------------------------

Chellester

Pd:=5;
A:=C>(BBandTop(C,20,S,2));
B:=A AND Alert(A=0,2);
D:=If(PREV=0,If(B,1,0),If(BarsSince(PREV=0)>=Pd,0,PREV));
Buy:=D AND Alert(D=0,2);
Sell:=D=0 AND Alert(D,2);
Sell;

This will give the most accurate timing from the FIRST bar of a signal. I
would create this as an indicator and use an FmlVar() call for the System
Tester "Buy" signal, and an Fml() call for the System Tester "Sell" signal.

There are a number of ways you can approach different parts of your problem,
but I think the approach above using a PREV based latch is going to be the
most accurate. You probably need to display all variables as outputs at the
same time to get an idea of what each is doing. As presented above "Sell" is
the only output.  For visual verification you could use

Pd:=5;
A:=C>(BBandTop(C,20,S,2));
B:=A AND Alert(A=0,2);
D:=If(PREV=0,If(B,1,0),If(BarsSince(PREV=0)>=Pd,0,PREV));
Buy:=D AND Alert(D=0,2);
Sell:=D=0 AND Alert(D,2);
A+5;
B+3.75;
D+2.5;
Buy+1.25;
Sell;

Roy

> Hi, I must be doing something wrong with my formulas etc -(Only had
> MetaStock for a couple of weeks, so thats quite possible!!)
> I want to test trades that last a number of days, say 5, but I can't
> see a simple way of doing this.  What I've tried is setting up the
> buy signals, getting that all working, and then for closing using the
> barssince function. For example if the Enter Long formula was
>
> c>(BBandTop(c,20,S,2)) I would be trying to close by
>
>
> barssince(c>(BBandTop(c,20,S,2)) )>5
>
> but in my tests, I'm still getting results where the longest trade
> was for up to 300 days!!  I've also tried using if() in a similar
> manner.
>
> Can anyone tell me what I'm doing wrong, or if there is a better way
> to do this.
>
> Thanks so much, it's driving me nuts!!
>
>
>
>
> 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/
>
>
>
>



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Looking for a more powerful website? Try GeoCities for $8.95 per month.
Register your domain name (http://your-name.com). More storage! No ads!
http://geocities.yahoo.com/ps/info
http://us.click.yahoo.com/auyVXB/KJoEAA/jd3IAA/BefplB/TM
---------------------------------------------------------------------~->

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/