Here's the code:
def previousdaysaverage = Average(((high("$tick") + low("$tick") + close("$tick")) / 3), 395);
plot data = TotalSum(((high("$tick") + low("$tick") + close("$tick")) / 3)) / 100 - previousdaysaverage;


Got this graph from markettells.com