Registered User Joined: 10/7/2004 Posts: 45
|
Hi! I have a pcf which looks for compression - in other words, "todays" bar's Open - Close value is 25% or less of the High - Low range of the previous bar. I have the code written as: abs(O-C) <=(H1-L1)*.25.
i am getting bizzare reuts where the scan flags charts where todays bar is much lager than yesterday's. The scan had ben working fine untl recently. Ay idea what is going on or how I need to re-write tthe pcf to get the desired results?
Thanks vey much!
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Your formula is comparing the body of the current bar to the entire range of the previous bar. This means the current bar can in fact be larger than the previous bar as long as the body is less than or equal to 25% of the total range of the previous bar.
If you want the body to be 25% or less than the size of the previous body:
ABS(O - C) <= .25 * ABS(O1 - C1)
If you want the entire candle to be 25% or less than the size of the previous candle.
H - L <= .25 * ABS(H1 - L1)
Note that if you want a non-zero body, you would need to check for that because the formulas allow for equality.
O <> C
If you can have a zero body but not a zero total range, you could use the following instead.
H > L
If you are still not getting the desired results, can you provide some specific examples so we can take a look?
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: 10/7/2004 Posts: 45
|
Bruce - your firmua is working great. Thanks verymuch for your help!
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|