Registered User Joined: 1/13/2012 Posts: 72
|
Hi. I have looked through the Discussion Forum and have not found the answer to this issue.
I am looking for RealCode for bullish engulfing candles. Here are the requirements:
1) Candle0's real body (not high/low, but open/close) engulfs Candle(1)'s real body (not the wicks).
2) I do not care whether Candle(1) had a positive or negative day, just want the real body to be smaller than Candle0.
---------------------
I wrote some (bearish engulfing) code that ASSUMED(!) that the prior day's candle was negative. Unfortunately, in the real-world, manytimes the prior day was positive and fouled up my code.
Let's start with Bullish Engulfig code:
Once the Bullish code is in place, I will be able to create the Bearish equivalent.
Thank you in advance for your help.
Ken.
|
Registered User Joined: 1/13/2012 Posts: 72
|
TC2000 code may look like this:
(O1 <= c1 AND
O > C1 AND C < O1)
OR
(O1 >= c1 AND
O > O1 AND C < C1)
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Based on your code you want the current candle to have the open be above the close with the tops and bottoms of the body of the previous bar being clearly inside the body of the current bar (neither the tops nor bottoms of the bodies can match).
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Engulfing Candle
'|******************************************************************
If Price.Open > Price.Open(1) AndAlso _
Price.Open > Price.Close(1) AndAlso _
Price.Open(1) > Price.Close AndAlso
Price.Close(1) > Price.Close Then
Pass
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|