Scanner condition: Prior day must be green candle on daily chart

KhanhQ83

New member
VIP
Hi everyone. I'm newbie here. I'm trying to fine tune my scanner by adding a condition where the prior day or 2 days ago must be a green candle on the daily chart. Could someone please help me? Thanks in advance.
 

BenTen

Administrative
Staff
VIP
Here you go.

Plot an up arrow for two consecutive green days.

Code:
# Generation time: 2021-03-20T02:18:28.634Z

def IsUp = close > open;
def IsDown = close < open;
def IsDoji = IsDoji();
def avgRange = 0.05 * Average(high - low, 20);
plot PatternPlot =
    IsUp[1] and
    IsUp[0];

PatternPlot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
PatternPlot.SetDefaultColor(GetColor(0));
 

KhanhQ83

New member
VIP
@BenTen Thank you very much sir.

Sorry I wanted to ask for another favor if you can point me to the right direction. I'm also looking for a scan that would return results for stocks that have opening range that is equal or less than $1 (for example) between 9:30 and 10 AM EST. Very much appreciated for your help.
 

Similar threads

Top