How do I verify the existence of a prior trend, say over the last 8 bars, without using moving averages for an indicator?
I found the following screener code below but want to convert it into an indicator and not sure how to test (Increase /NormalV), as I don’t know what it should compare against?
REM Determine the "force" of the preceding up trend.
// Find the lowest point over the last 8 bars
Low8 = lowest[8](Low)
// Determine the increase since this point
Increase = Close - Low8
// Determine the normal volatility of the security (median of true range over the last 3
bars)
NormalV = summation[3](TR) - highest[3](TR) - lowest[3](TR)
REM Condition: Bearish engulfing Engulfing
Filter = Close[1] > Open[1] AND Open > Close[1] AND Close < Open[1]
REM Display results. Sorting Criteria: Increase/NormalV (preceding up trend force)
SCREENER[Filter](Increase / NormalV AS "Up Trend Force")
Just remove everything related to “Filter” and use this line as the last one (delete the line 12 first).
RETURN Increase / NormalV AS "Up Trend Force"