First down day after uptrend


Category:
0
0

Hello Pete,

The purpose of this post is to create a scan condition that detects the first red day of a stock that has been running up with 2 or more green days in a row with each green day making higher lows and higher highs than the previous day in the sequence.

The scan should look for a pattern like green green …..(continuous green)……. red.

 

With a minimum of 2 green days

 

Thank you

 

 

 

Marked as spam
Posted by (Questions: 22, Answers: 63)
Asked on November 28, 2018 1:04 pm
145 views
0
Private answer

This should do it.

def upTrend = close > open and close > close[1] and high > high[1] and low > low[1];
def seriesOfTwo = upTrend and upTrend[1];
def firstDownBar = seriesOfTwo[1] and close < close[1];
plot scan = firstDownBar;

Screenshot below shows the signals this will pick up.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4117)
Answered on November 29, 2018 9:29 am
0
The code works perfectly, my last question is how can we modify this code to only return results of the uptrend that rose at least 75%. For example From the low price of the first green candle to the high price of the last green candle in the trend, the percent change is over 75% second, the total volume of the uptrend is greater that 1 million
( at February 20, 2019 7:57 am)