Difference between current price and yesterday's close price in Data Window

I want to get the price difference between the current price and the yesterdays's close price in data window so that when I move the cursor to price chart I get the relevant information in live chart.
I am using the Line with dots chart. Whether it is possible to color the dot with a particular color when the defined price difference between current price and yesterdays close price is satisfied ?

Data Window shows content of arrays passed to Plot() statements, so you would need a Plot statement

Plot( Close - Ref( Close, -1 ), "Diff", colorRed, styleLine );

You can use styleNoDraw | styleNoRescale if you want Data window output without actual plot.

1 Like

Thanks a lot. I shall contact you if I want any help in building my strategy , if you permit.

1 Like

I would be glad, if I can get code for current candle size(Price)in %.
E.g. In intraday in 5 min chart first candle size(Price) is 0.7% - how to get it into afl code?