Scan for morning star


Category:
0
0

I am trying to use TOS Candle stick pattern code to scan for morning star but scan return nothing. I know I must not doing this right. Please help

input length = 20;
input trendSetup = 3;
input bodyFactor = 0.3;

Assert(bodyFactor >= 0, “‘body factor’ must not be negative: ” + bodyFactor);

def BodyHeight = BodyHeight();
def IsShort = BodyHeight < bodyFactor * Average(BodyHeight, length);

def Bullish = IsDescending(close, trendSetup)[2] and
IsLongBlack(length)[2] and
IsShort[1] and
high[1] < low[2] and
open < close and
close > MidBodyVal()[2];
plot scan = Bullish;

Marked as spam
Posted by (Questions: 2, Answers: 0)
Asked on November 10, 2019 4:04 pm
195 views
0
Private answer

This candlestick pattern is exceptionally rare. So I'm not surprised at all that you are getting no results. You can check for this pattern in the previous 20 candles using the following as your scan statement:

plot scan = Highest(Bullish, 20) > 0;

To be clear, use the same code you already have but use the line above to replace the last line in your code. Scanning from a daily time frame I found only 4 stocks had this pattern in the last 20 days. Exceptionally rare indeed.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on November 10, 2019 5:41 pm