lostcoastsurf
Member
How can you reference the current trading price on the daily chart? I am attempting to place a label on the chart that shows the % difference between yesterday's close and the current price of the ticker. Here's my first feeble attempt which does not work because ##close## references the close of the previous days candle.
def currentGap = round(( ##close## - close("period" = AggregationPeriod.DAY)[1])/(close("period" = aggPeriod)[1])*100, 1);
AddLabel(yes, AsPercent(currentGap/100), if gap > 0 then Color.DARK_GREEN else Color.DARK_RED );
def currentGap = round(( ##close## - close("period" = AggregationPeriod.DAY)[1])/(close("period" = aggPeriod)[1])*100, 1);
AddLabel(yes, AsPercent(currentGap/100), if gap > 0 then Color.DARK_GREEN else Color.DARK_RED );