Chart element that calculates difference between prices

How would I incorporate the current live price (bid or ask) into a script?

ie I’d like to show via a chart element the difference between a certain price (could be a target or stop loss for instance) and the current price. How can I do this so that the display changes in real time?

And additionally - is there a way that I can display in real time the difference between say a price marked by a horizontal line and the current price? One that auto updates with adjustments to the horizontal line level and current price?

Thanks

Hi Steve,

It would have to be a formula using a hard-coded price - it won’t automatically update. For example, the Chart Element in blue automatically updates the difference to 0.672 using the following formula:

0.672 - CLOSE()

Note that when using a Price Alert the Proximity value in the Alerts Manager window will automatically update as the price alert level is moved: