Hi, What about something like the following:
DownTenDays = Sum(C < MA(C, 10), 10) == 10; Above200 = C > MA(C, 200); LowestLow = AlmostEqual(LLV(C, 10), C); Delta = MA(C, 10) - Close; BiggestDrop = AlmostEqual(HHV(Delta, 10), Delta); Buy = DownTenDays AND Above200 AND LowestLow AND BiggestDrop; Sell = C > MA(C, 5); Mike --- In [email protected], "droskill" <[EMAIL PROTECTED]> wrote: > > 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); >
