PureBytes Links
Trading Reference Links
|
Hi Roy,
Thanks for your assistance and sorry I couldn't get back to you
earlier.
Here's just one implementation of your suggestion to insert the take
profit code into the Trade variable:
------------------------------------------------
{Long Entry}
Pds:=20;
UpperBB:=Mov(C,Pds,S)+(2.0*(Std(C,Pds)));
LE:= L<Mov(C,Pds,S)AND H>UpperBB AND Mov(C,Pds,S)>Ref(Mov(C,Pds,S),-
1);
{Short Entry}
LowerBB:=Mov(C,Pds,S)-(2.0*(Std(C,Pds)));
SE:= H>Mov(C,Pds,S)AND L<LowerBB AND Mov(C,Pds,S)<Ref(Mov(C,Pds,S),-
1);
{Long Exit}
LongNumatr:=3;
LongPeriods:=3;
LongSL:=L-LongNumatr*ATR(LongPeriods);
Longstop:=If(L<PREV,LongSL,If(LongSL>PREV,LongSL,PREV));
LX:=L<Ref(Longstop,-1);
{Short Exit}
ShortNumatr:=3;
ShortPeriods:=3;
ShortSL:=H+ShortNumatr*ATR(ShortPeriods);
Shortstop:=If(H>PREV,ShortSL,If(ShortSL<PREV,ShortSL,PREV));
SX:=H>Ref(Shortstop,-1);
Trade:=If(PREV=0,
If(LE,C,
If(SE,-C,0)),
If((PREV>0 AND (LX OR C>PREV*1.005 )) OR
(PREV<0 AND (SX OR C<Abs(PREV)/1.005 )),0,PREV));
Long Entry: cross( trade, 0.5 )
Short Entry: cross( -0.5, trade )
Long Exit: cross( 0.5, trade )
Short Exit: cross( trade, -0.5 )
-----------------------------------------------------
It seems to give the required results.
Regards,
Tim
--- In equismetastock@xxxxxxxxxxxxxxx, "Roy Larsen" <rlarsen@xxxx>
wrote:
> Hi Bob
>
> The problem with "ValueWhen(1,{your long entry formula here},C);"
is that it
> picks up the most recent entry signal of the current trade, it does
not
> retain the original entry value when that is followed by further
signals.
>
> Regards
>
> Roy
>
>
>
> ----- Original Message -----
> From: "Bob" <rtstrade@xxxx>
> To: <equismetastock@xxxxxxxxxxxxxxx>
> Sent: Friday, May 23, 2003 11:45 AM
> Subject: [EquisMetaStock Group] Re: Referencing the most recent
occurrence
>
>
> > --- In equismetastock@xxxxxxxxxxxxxxx, "timinwaedi"
<timinwaedi@xxxx>
> > wrote:
> > > Can anyone suggest how I can reference the price at which a the
> > most
> > > recent occurrence of a long entry took place. I need to know
this
> > > price in order to define a stop loss or stop profit exit.
> > >
> > > Would be grateful for any input
> > >
> > > Tim
> >
> > Tim, if this is for the System Tester then this should work:
> >
> > stop:={stop value};
> > profit:={stop value};
> > Trade:=ValueWhen(1,{your long entry formula here},C);
> >
> > (trade*(1-stop))>=c
> > OR
> > (trade*(1+profit))<=c
> >
> > If for an Expert, then you will need more.
> >
> > Bob
> >
> >
> >
> >
> > 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 ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/uetFAA/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/
|