PureBytes Links
Trading Reference Links
|
Jack
What I was thinking of was something like this.
{Trade 1% Move}
N:= Fml("PS Fractal Entry");{your entry signal/price}
X:= Fml("PS Fractal Exit"); {your independent exit signal}
I:=Cum(N+X>-1)=1; {}
Tr:=If(PREV<=0,N>0,If(X>0 {OR entry dependent exits},
{end of trade} -1,{continue trade} 1));
Xb:=Tr<0; {trade exit bar}
Tr:=Abs(Tr)*ValueWhen(1,I OR (Alert(Tr=0,2) AND Tr),N);
{trade entry price}
Pc:=Int(100*(C/If(Tr>0,Tr,C)));
{Tr;} {plot trade and entry price}
{Xb;} {plot exit bar}
{plot +1 for 1% increase, -1 for 1% decrease}
If(Tr>0,If(Pc>Ref(PC,-1),1,If(Pc<Ref(PC,-1),-1,0)),0);
This is constructed for long side only and gives a +1 spike 1% positive move
and a -1 spike for a negative move. The code could be adapted to work with
both long and short side but how you achieve that could depend very much on
your system. Another approach would be to duplicate the code for use on the
short side. The only changes if you did that would be in the 'Pc'
calculation I think. Of course the output line would need to be amended for
both long and short so that only favourable moves were signalled.
Roy
----- Original Message -----
From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx>
To: <equismetastock@xxxxxxxxxxxxxxx>
Sent: Thursday, July 24, 2003 7:34 AM
Subject: Re: [EquisMetaStock Group] Re: Tim--Code for %price increments
> Jack
>
> It sounds to me as though you need a PREV latch to lock in the trade entry
> price, followed by a mechanism that gives a signal every time the integer
of
> % change is different from the previous bar.
>
> Roy
>
>
>
>
> ----- Original Message -----
> From: "superfragalist" <j3ttt@xxxxxxxxxxx>
> To: <equismetastock@xxxxxxxxxxxxxxx>
> Sent: Thursday, July 24, 2003 7:11 AM
> Subject: [EquisMetaStock Group] Re: Tim--Code for %price increments
>
>
> > Thanks Tim,
> >
> > The code you posted is one way of tracking the rise and fall of
> > prices by percent. What I'm trying to do is to write a statement for
> > my expert that will put a dot on my chart each time there's been a
> > cumulative price increase of 1% on the long side or a 1% decrease on
> > the short side.
> >
> > I wrote a zig zag formula that would plot it in an indicator window
> > but I haven't been able to get it in to an expert version that will
> > put the dots on the chart. I'm close but not quit there.
> >
> > If you have any ideas let me know.
> >
> > Thanks
> > Jack
> >
> >
> >
> >
> > --- In equismetastock@xxxxxxxxxxxxxxx, "timinwaedi" <timinwaedi@xxxx>
> > wrote:
> > > --- In equismetastock@xxxxxxxxxxxxxxx, "superfragalist"
> > <j3ttt@xxxx>
> > > wrote:
> > > > Has anyone seen any code for creating an expert or indicator that
> > > > will identify when a price moves up x% from the entry price and
> > > then
> > > > moves up x% again from the previous x% increase.
> > > >
> > > > Jack
> > >
> > > Hi Jack,
> > >
> > > Try this indicator:
> > > -----------------------------------------------------------------
> > > {Percentage Crossover w/Input}
> > > Percentage:=Input("Enter the percentage threshhold;",0.1,20,3.0);
> > > base:=(100-Percentage)/100;
> > > top:=(100+Percentage)/100;
> > > If((C*base)>PREV,C*base,If((C*top)<PREV,C*top,PREV))
> > >
> > > -----------------------------------------------------------------
> > >
> > > Regards,
> > >
> > > Tim
> >
> >
> >
> > 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/
> >
> >
> >
> >
>
>
>
>
> 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 ---------------------~-->
Buy Ink Cartridges & Refill Kits for Your Epson at Myinks.com
Free shipping on orders $50 or more to the US and Canada.
http://www.c1tracking.com/l.asp?cid=5705&lp=home/epson.asp
http://us.click.yahoo.com/brYXfA/_xWGAA/ySSFAA/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/
|