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

Re: [EquisMetaStock Group] System Test: Sell = 1.1(buy)



PureBytes Links

Trading Reference Links

RP

> I am trying to keep the sell order when
> the close exceeds the buy price by 10%.
>
> Buy : When condition is met
> Sell: When Close > 1.1(buy)
>
> I am unable to assign a variable in the
> system test in order to link the buy
> and sell.
>
> Please advise as how to get this done.

Depending on which version of MS you have there are various ways you can
achieve this. If you want signals that are independant of any stop setups in
the System Tester then 'Trade Stop Lite' has all the features you need and
more, and it can also be used to show you the entry price and and exit
targets on individual stocks.

This code can be simplified down to a bare 4 or 5 lines to do only what you
want. Entry and independent exit code is best created as discrete
indicators, but this is not absolutely necessary for relatively simple code
that you may wish to use optimisation on.

Including commissions and price based entry stop capability (other than
OHLC) can also be done but it requires another level of sophistication.

Come back to me if you need help to strip this code back to bare bones.

Roy


  {Trade Stop Lite}
  {V4.2 long, © 2003 Roy Larsen}
No:=Input("Entry Price 1=O 2=C 3=H 4=L",1,4,2);
Nd:=Input("Entry Delay",0,3,0);
Xd:=Input(" Exit Delay",0,3,0);
Pf:=1+Input("Profit Target %",1,99,25)/100;
Lf:=1-Input("Stoploss %",1,99,10)/100;
N:= Fml("PS Fractal Entry"); {my entry formula}
X:= 0; {my exit formula if required}
{* end of user area *}
N:=N AND Alert(N=0,2);X:=X AND Alert(X=0,2);
N:=If(Nd=0,N,Alert(N,Nd+1) AND Alert(N,Nd)=0);
N:=If(N>0,If(No=1,O,If(No=3,H,If(No=4,L,C))),0);
X:=If(Xd=0,X,Alert(X,Xd+1) AND Alert(X,Xd)=0);
I:=Cum(N+X>-1)=1;
M:=C<Ref(C,-1);
Tr:=If(PREV<=0,N>0,If(X OR
  If(M,-1,1)*ValueWhen(1,PREV=0,N)<=
  If(M,-C/Lf,C/Pf),-1,1));
Xb:=Tr<0;
Tr:=Abs(Tr)*ValueWhen(1,I OR (Alert(Tr=0,2) AND Tr),N);
Tr; Pf*Tr; Lf*Tr; Xb;
{Tr plots the entry price}
{Pf*Tr plots the profit target price}
{Lf*Tr plots the stoploss exit price}
{Xb plots the exit signal}



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Save up to 80% on top-quality inkjet cartridges and get your order fast!
FREE shipping on orders $50 or more to the US & Canada. Shop at Myinks.com!
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/v2G7ND/KfUGAA/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/