Registered User Joined: 3/30/2008 Posts: 97
|
What would the real code be to create the following condition to use in scans:
A bearish engulfing bar in which the range of today's closing bar (end of day) was greater than the day before's range (ie: today's high was higher than yesteraday's high, and today's low was lower than yesterday's), and, also, today's close was lower than yesterday's close. If I could get that, it would be great.
If the condition could also be written so that, at the same time, today's 7-period Wilder's RSI must be at least 71 or higher (overbought), that would be phenomenal.
And lastly, if another stipulation could be that, ideally, the engulfing bar that shows up in this scan is the highest bar of, say, the last 5 days (editable period of course in case I need to modify it).... then this would be out of this world!!
Thanks in advance.
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
Create a RealCode rule (or condition in version 5) with the following code and name it Bearish Engulfing.
'# NewHighPeriod = userinput.integer = 5
If price.High=price.MaxHigh(newhighperiod) AndAlso _
price.Close(1)>price.Open(1) AndAlso _
price.Open>price.Close(1) AndAlso _
price.Close<price.Open(1) AndAlso _
price.low < price.low(1) Then pass
Then plot Wilder's RSI and created a rule Greater than Value and set the Value to 70.99
Now, drag the Bearish Engulfing rule onto the RSI rule and select Create Combo. You now have a rule for a bearish engulfing candle and RSI 7 greater than 70.99.
|