This thing is, I still think like a manual trader! These first efforts were really just trying to replicate what I do in day trading and Hull18 on a 2.5m FTSE chart is actually quite reliable as a turnaround, in conjunction with other slower trend indicators.
Whether or not it’s a good strategy for ProOrder (prob not!) isn’t really the issue here.
What I’m trying to figure out is, if I have coded c1 = hull > hull[1] why am I getting c1 = hull > hull[2] ???
A bottom would be: if c1 and c2[1] then 1 if c1 and c2[1] then and a top would be: if c2 and c1[1] then 1 if c2 and c1[1] then
Thanks Vonasi, i’ll try that.
No, you only need the last 3 values to detect a peak or a trough:
top = hull<hull[1] and hull[1]>hull[2]
bottom = hull>hull[1] and hull[1]<hull[2]
I just adapted the original conditions in the code to achieve exactly the same as your code Nicolas. It just checks the rising or falling condition for the last two candles.
c1 = hull > hull[1] //rising
c2 = hull < hull[1] //falling
//bottom is rising after falling
if c1 and c2[1] then
//top is falling after rising
if c2 and c1[1] then
No problem, I replied this morning without have read your most recent replies!