Looks like Graham beat me to the punch ;) And, he used lowest low of L as I suspect you meant, I used lowest low of C since that was what you had in your example. You'll need to decide which one you meant.
Mike --- In [email protected], Graham <[EMAIL PROTECTED]> wrote: > > hopefully understood what you wanted > > MAshort = MA(C,10); > MAdiff = MAshort - C; > MAlong = MA(C,200); > > Buy = Sum(C<MAshort,10)==10 AND C > MAlong AND L<ref(LLV(L,9),-1) AND > MAdiff>ref(HHV(MAdiff,9),-1); > Sell = C > MA(C,5); > > -- > Cheers > Graham Kav > AFL Writing Service > http://www.aflwriting.com > > > 2008/5/11 droskill <[EMAIL PROTECTED]>: > > Guys, > > > > For some reason I'm having trouble translating the following rules > > into a system: > > > > 1)It has closed below its 10-day moving average for at least 10 days. > > 2) It is above its 200-day moving average. 3) It made its lowest low > > of the recent selloff today. 4) It closed stretched further below its > > 10-day moving average than it has on any day of the recent selloff. > > > > Here's some of the code I have - but I think my approach is completely > > wrong: > > > > > > MAdiff = C - MA(10,C); > > MAlong = MA(200,C); > > > > MAdays = Ref(C,-10) < Ref(MA(C,10),-10) AND Ref(C,-9) < > > Ref(MA(C,10),-9) AND Ref(C,-8) < Ref(MA(C,10),-8) AND Ref(C,-7) < > > Ref(MA(C,10),-7) AND Ref(C,-6) < Ref(MA(C,10),-6) AND Ref(C,-5) < > > Ref(MA(C,10),-5) AND Ref(C,-4) < Ref(MA(C,10),-4) AND Ref(C,-3) < > > Ref(MA(C,10),-3) AND Ref(C,-2) < Ref(MA(C,10),-2) AND Ref(C,-1) < > > Ref(MA(C,10),-1) AND C < MA(C,10); > > > > Buy = MAdays AND LLV(C,10) AND C > MAlong AND HHV(MAdiff,10); > > Sell = C > MA(C,5); >
