Robby Luca
New member
I would like to scan for the price (in afterhours) to be above yesterday's high or below yesterday's low.
I already have an afterhours scan that shows price change from yesterday's close.
Is there a way to use similar code? Instead of PrevClose to change it into PrevHigh and PrevLow?
I already have an afterhours scan that shows price change from yesterday's close.
Is there a way to use similar code? Instead of PrevClose to change it into PrevHigh and PrevLow?
Code:
def marketClose = 1559;
def Price = close;
def today = GetDay() == GetLastDay();
def dayHours = SecondsTillTime(marketClose) >= 0 ;
def PrevClose = if (dayHours[1] and !dayHours) or (dayHours[1] and !today[1] and today)
#in case there was no afterhours trading
then Price[1]
else PrevClose[1];
plot PriceChange = Price - PrevClose;