Registered User Joined: 9/20/2005 Posts: 18
|
Hello Bruce:
Is it possible to create a PCF, and therby a scan condition to scan a watchlist for stocks that have either one of OLHC price being below the lower Bollinger Band as of 1 or 2 or 3 days ago and the price crossing over the 10 period ema at the time the scan is initiated. I am a GOLD customer and hence cannot set it to scan in intraday intervals, if this can be done I will upgrade to the Platinum version in the upcoing Chicago seminar on May 11.
Please e-mail or respond on this forum at your ealriest.
Thanks in advance for all your help
Deepak
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I'm not sure I understand your particular requirements.
A Condition Formula for the Low being being below the Lower Bollinger Band during one of the previous three bars would depend on your Bollinger Band settings. For a Simple Bollinger Band 20,2.00, the formula would be:
L1 < AVGC20.1 - 2 * SQR(ABS(C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 + C20 ^ 2 - 20 * AVGC20.1 ^ 2) / 20) OR L2 < AVGC20.2 - 2 * SQR(ABS(C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 + C20 ^ 2 + C21 ^ 2 - 20 * AVGC20.2 ^ 2) / 20) OR L3 < AVGC20.3 - 2 * SQR(ABS(C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 + C20 ^ 2 + C21 ^ 2 + C22 ^ 2 - 20 * AVGC20.3 ^ 2) / 20)
And a Condition Formula for price crossing up through its own 10-Period Exponential Moving Average could be written as:
C > XAVGC10 AND C1 <= XAVGC10.1
Combining these into a single Condition Formula would result in:
C > XAVGC10 AND C1 <= XAVGC10.1 AND (L1 < AVGC20.1 - 2 * SQR(ABS(C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 + C20 ^ 2 - 20 * AVGC20.1 ^ 2) / 20) OR L2 < AVGC20.2 - 2 * SQR(ABS(C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 + C20 ^ 2 + C21 ^ 2 - 20 * AVGC20.2 ^ 2) / 20) OR L3 < AVGC20.3 - 2 * SQR(ABS(C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 + C20 ^ 2 + C21 ^ 2 + C22 ^ 2 - 20 * AVGC20.3 ^ 2) / 20))
Modelling Bollinger Bands (& Standard Deviation) in a TC PCF
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 9/20/2005 Posts: 18
|
Hello Bruce:
I have created a PCF based on the the above post for BB Period 15 and StdDev 1.5 and have a condition(formula) to show stocks with the Low Price being less than the Lower BB as follows
L < (AVGC15 - 1.5 * SQR(ABS(C1 ^ 1.5 + C2 ^ 1.5 + C3 ^ 1.5 + C4 ^ 1.5 + C5 ^ 1.5 + C6 ^ 1.5 + C7 ^ 1.5 + C8 ^ 1.5 + C9 ^ 1.5 + C10 ^ 1.5 + C11 ^ 1.5 + C12 ^ 1.5 + C13 ^ 1.5 + C14 ^ 1.5 + C15 ^ 1.5 - 15 * AVGC15 ^ 1.5) / 14))
The other PCF created as a condition (formula) is for a hammer candlestick pattern as follows:
(H-C)<=(H-L)/3 AND (H-O)<=(H-L)/3
As of close on April 5th , a scan on a 4 hour chart using both the above conditions against the S&P500 list displays the following 5 symbols
MDT,FIS,APH,VRSN & APPL
APH & VRSN appear correctly on the 4 hour chart .
MDT,FIS, AAPL are all incorrect see data below (based on 4 hour chart)
MDT Low 38.85 Lower BB 38.83 - Violates L to be lower than Lower BB
FIS Low 38.85 Lower BB 38.83 - Violates L to be Lower than Lower BB
AAPL Low 419.68 Lower BB 417.93 - Violates L to be lower than lower BB
Are my PCF's written correctly ? Any help debugging will be appreciated.
Thanks so much
Deepak
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Your Personal Criteria Formula for the low being below the Lower Bollinger Band 15,1.5 was a very good try but is incorrect. It should be:
L < AVGC15 - 1.5 * SQR(ABS(C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 - 15 * AVGC15 ^ 2) / 15)
Your Hammer PCF should identify symbols where the body is entirely within the top third of the entire range of the candle.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|