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

RE: Consec code question



PureBytes Links

Trading Reference Links

> What I'm missing is the calculation of N - then I can say for N>4 so I
> set up a variable that increments N every time RSI>70 then I retest
> the condition 

Ohhh, you want it to *find* N -- i.e. determine how many bars RSI has been 
>70?  Then how about something like this:

InBounds = RSI(close, 14)<=70;
N = MRO(InBounds, 20, 1);  // Find the last time RSI was NOT >70
if (N = -1) then N = 20;
if (N < 4) then N = 0;

That will return 0 if RSI>70 for 4 or fewer bars, N if RSI>70 for the last N 
bars, looking back a max of 20 bars.

Gary


> All set now -- thx
> 
> -----Original Message-----
> From: Gary Fritz [mailto:fritz@xxxxxxxx] 
> Sent: Thursday, May 15, 2008 12:59 PM
> To: omega-List
> Subject: RE: Consec code question
> 
> That line should return true if RSI is >70 for N consecutive days, for any 
> positive value of N.  If you want it to be true only for N>4, you could just
> add 
> "(N>4) and" to the start of the conditional.
> 
> If that's not what you're looking for, try describing it again.
> 
> 
> 
> On 15 May 2008 at 7:56, Chris Evans wrote:
> 
> > 
> > Condition1= Countif(RSI(close,14)>70),N)=N
> > For N>4
> > 
> > So I the condition is true if RSI is OB for 5 days, 6 days, 7 days  etc
> etc
> > 
> > (Countif is a function in EL for TS8.X)
> > 
> > -----Original Message-----
> > From: unicorn@xxxxxxxxxxxxxxx [mailto:unicorn@xxxxxxxxxxxxxxx] On Behalf
> Of
> > Alex Matulich
> > Sent: Thursday, May 15, 2008 6:58 AM
> > To: omega-list@xxxxxxxxxx
> > Subject: Re: Consec code question
> > 
> > Chris Evans wrote:
> > >I need to have a condition where 
> > >
> > >Countif(Var1>0,N)=N where N>= X .. How would I do this without writing
> any
> > >"or" lines in the condition statement.
> > 
> > Countif() is an Excel function, not an EasyLanguage function (at
> > least not TS2000i).  The syntax you used above wouldn't work in
> > Excel either.  Can you explain more clearly what you are trying to
> > do?
> > 
> > -Alex
> > 
> 
>