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=5362
------------------------------------------------------------------------
at
> Does anyone know how to write an exploration that closes a position a
certain number of days after a position is taken i.e. say 30 days?
You you mean "exploration" or "system test"?
The following slightly modified code that I posted for Chellester just a few
days ago should help you with System Tester code. Just how you would apply
this directly to an exploration I'm not sure. Forgive me if I'm making a
false assumption here. I've included my original comments so you can
understand what each line of code does.
Roy
Chellester
Pd:=30;
A:=Fml("Your Entry Signal");
{substitute your own code here or create an indicator and call it using
Fml()}
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
------------------------ 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/
|