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

Re: [Metastockusers] latches



PureBytes Links

Trading Reference Links

Hi Keith

How you approach the problem will depend on a how you want to exit the trade
or terminate the watch period for each condition. If the same signal can be
used to terminate all stages then a series of staggered simple latches will
be OK. The problem that you need to be aware of is the need to keep all (2
or more) latches synchronised. This is easy when the same reset is applied
to all.

If you have several conditions that need to all be true but may be reset
(made inactive) individually then you may need a PREV based latch that can
count up until all conditions come true in the right sequence. Once at the
final count (say 3) then the latch can be reset to signal the end of the
trade using a different set of conditions again.

Which approach you take depends on the complexity of your requirements. I
made up an example of a PREV based counting latch some time ago but appear
not to have saved it so can't show it at the moment. You are certainly going
to need some sort of "memory" technique and I don't think the If() function
will be up to the task. You might be able to use ValueWhen() as a binary
memory device but the success of that will depend on just how your entry
conditions are coded and applied to the ValueWhen() I think.

Come back to me if you need further assistance.

Regards

Roy

----- Original Message -----
From: "keith" <janus36@xxxxxxxxxx>
To: <Metastockusers@xxxxxxxxxxxxxxx>
Sent: Tuesday, April 22, 2003 12:02 PM
Subject: [Metastockusers] latches


Hi Roy,  this is a common question i'm sure.   I'd like to make a sequential
formula  where  say , if A is correct, wait( implying to check every
subsequent bar) until B is correct then give a signal,
I thought of IF statements first then your latches--  read up on your
latch.doc but not much wiser though. i thought i'd make a binary  of the
Latch 2, seemed to be suitable, a simple one as under.


  {Example 2}
N:=Stoch(10,3)<20 ;
X:=Stoch(20,3)>80;
I:=Cum(N+X>-1)=1;
Tr:=BarsSince(I OR N)<BarsSince(I OR X);
Tr;

  {Example 2  revised  }
N:=Stoch(10,3)<20 ;
X:=Stoch(10,3)>80;
I:=Cum(N+X>-1)=1;
Tr:=BarsSince(I OR N)<BarsSince(I OR X);

Y:=C>Mov(C,50,S);  {new variable with existing X as exit }
I:=Cum(N+Y>-1)=1;
Tr2:=BarsSince(I OR Y)<BarsSince(I OR X);
Tr2;     {  this plots }

am I on the right track here ?  or should I look at IF statements instead

thanks  keith



------------------------ Yahoo! Groups Sponsor ---------------------~-->
DVD Rentals with No Late Fees - Try Netflix for FREE!
http://us.click.yahoo.com/ZKLNcC/pEZFAA/i5gGAA/zMEolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/