Hello All,
I want to code the following conditions and would welcome
some help.
I've included my attempt of the code but would appreciate
comments as
to whether this is an accurate translation into AB
code.
Conditions:
1: Calculate the number of Bars (x) since the
last time High crossed
above the HHV of the High over the last 30
periods.
2. The value of RSI(14) x periods ago should be more than the
current
value of RSI(14)
eg. If the output from condition 1 was say
8, then condition 2 would
be RSI(14)>Ref(RSI(14),-8)
My
attempt at the
Code:
x:=BarsSince(Cross(H,Ref(HHV(H,30),-1)));
RSI(14)>
Ref(RSI(14),x*-1)
Would this work?
Thanks in
advance,
Chorlton