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

Retracement entries, or postponing entries codewise



PureBytes Links

Trading Reference Links

Hello Group,

I've been battling lately with what looks like a very simple thing...

Say I want to enter long on a MA-5 crossover but only if close doesnt close
2% above MA-5.

{Enter long}
Cross(C,Mov(C,5,S)) AND      (C>(Mov(C,5,S)*1.02))<>1

so far, so good...

Next, if close is 2% or more above MA-5 on the crossover day, I want to
stand aside and enter long 1 day after the crossover, hoping for a pullback.

If(   (C>(Mov(C,5,S)*1.02)),
0,
cross(C,Mov(C,5,S))  )

- that would just keep me aside... My question: what do I want to replace
the "0" with to enter 1 day after the crossover? Ref(C,1) wouldnt work,
barssince( cross(C,Mov(C,5,S)))=1 wouldnt either, and they shouldnt (on Day
2 Close doesnt have to still be 2% above MA)...

I tried

If( BarsSince((C>(Mov(C,5,S)*1.02)))=1
,
(C>Mov(C,5,S))
,0
)
OR
(Cross(C,Mov(C,5,S)) AND      (C>(Mov(C,5,S)*1.02))<>1  )

Could someone please recheck the logic? There must be some simpler/better
way? Also, if I really want a pullback towards MA then I would want to
replace    (C>Mov(C,5,S))    by eg.   ( (C>Mov(C,5,S))    AND
(C<Ref(C,-1) )), right? I'm losing it today:-((

Thanks,
Yarroll