Registered User Joined: 6/17/2005 Posts: 63
|
How you do code a scan for a Harami cross
followed the next day be a gap up/ gap down?
Thanks
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The Condition Formula given in the Boolean PCFs for Candlestick Patterns topic for a Harami Cross is as follows.
ABS(C1 - O1) > .5 * (H1 - L1) AND C1 < O1 AND H < O1 AND L > C1 AND (C + O) / 2 - L > .4 * (H - L) AND (C + O) / 2 - L < .6 * (H - L) AND ABS(C - O) < .2 * (H - L)
You would need to convert this to a version from 1 bar ago.
ABS(C2 - O2) > .5 * (H2 - L2) AND C2 < O2 AND H1 < O2 AND L1 > C2 AND (C1 + O1) / 2 - L1 > .4 * (H1 - L1) AND (C1 + O1) / 2 - L1 < .6 * (H1 - L1) AND ABS(C1 - O1) < .2 * (H1 - L1)
And then add code for the current bar being a gap or or gap down (the following assumes a gap means no overlap at all between the two bars.
(L > H1 OR H < L1) AND ABS(C2 - O2) > .5 * (H2 - L2) AND C2 < O2 AND H1 < O2 AND L1 > C2 AND (C1 + O1) / 2 - L1 > .4 * (H1 - L1) AND (C1 + O1) / 2 - L1 < .6 * (H1 - L1) AND ABS(C1 - O1) < .2 * (H1 - L1)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 6/17/2005 Posts: 63
|
Thanks
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|