Registered User Joined: 1/17/2018 Posts: 7
|
Hello Bruce,
Please help me with a formula/scan. If I have a 20 period Hull moving average of a standard Coppock curve, and I want to scan for stocks that have made the largest 1 day percentage move away from that Hull moving average (either up or down) how would I code that? What about a 5 day move too?
Many thanks,
Dave S.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
A formula for the standard 11,14,10 Coppock Curve minus its own 20 period Hull Moving Average can be written as follows.
100 * FAVG(C / C11 + C / C14 - 2, 10) - HAVG(100 * FAVG(C / C11 + C / C14 - 2, 10), 20)
The absolute value of difference (the distance) can be written as follows.
ABS(100 * FAVG(C / C11 + C / C14 - 2, 10) - HAVG(100 * FAVG(C / C11 + C / C14 - 2, 10), 20))
So the change in this distance from one bar to the next can be written as follows.
ABS(100 * FAVG(C / C11 + C / C14 - 2, 10) - HAVG(100 * FAVG(C / C11 + C / C14 - 2, 10), 20)) - ABS(100 * FAVG(C1 / C12 + C1 / C15 - 2, 10) - HAVG(100 * FAVG(C1 / C12 + C1 / C15 - 2, 10), 20))
Expressing this as a percent change in the distance can be written as follows (altohugh I don't think this is desirable).
100 * (ABS(100 * FAVG(C / C11 + C / C14 - 2, 10) - HAVG(100 * FAVG(C / C11 + C / C14 - 2, 10), 20)) / ABS(100 * FAVG(C1 / C12 + C1 / C15 - 2, 10) - HAVG(100 * FAVG(C1 / C12 + C1 / C15 - 2, 10), 20)) - 1)
And the change in this distance from five bars ago to the current value can be written as follows.
ABS(100 * FAVG(C / C11 + C / C14 - 2, 10) - HAVG(100 * FAVG(C / C11 + C / C14 - 2, 10), 20)) - ABS(100 * FAVG(C5 / C16 + C5 / C19 - 2, 10) - HAVG(100 * FAVG(C5 / C16 + C5 / C19 - 2, 10), 20))
Expressing this as a percent change in the distance can be written as follows (altohugh I don't think this is desirable).
100 * (ABS(100 * FAVG(C / C11 + C / C14 - 2, 10) - HAVG(100 * FAVG(C / C11 + C / C14 - 2, 10), 20)) / ABS(100 * FAVG(C5 / C16 + C5 / C19 - 2, 10) - HAVG(100 * FAVG(C5 / C16 + C5 / C19 - 2, 10), 20)) - 1)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|