I have this watchlist script for % change from the OPEN and would like a code that shows the %change from the prior day close. Thanks in advance if someone know how to do this.
def openPrice = if SecondsTillTime(930) == 0 then open else openPrice[1];
def pctChangeFromOpen = (close - OpenPrice) / OpenPrice;
AddLabel(yes, AsPercent(pctChangeFromOpen), color.black);
AssignBackgroundColor(if pctChangeFromOpen > 0 then color.green else color.red);
def openPrice = if SecondsTillTime(930) == 0 then open else openPrice[1];
def pctChangeFromOpen = (close - OpenPrice) / OpenPrice;
AddLabel(yes, AsPercent(pctChangeFromOpen), color.black);
AssignBackgroundColor(if pctChangeFromOpen > 0 then color.green else color.red);