RicardoSantos

[RS]Temporal Median Price V0

EXPERIMENTAL: previous custom time window median price and current time window open price in a neat package :p
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
study(title="[RS]Temporal Median Price V0", shorttitle="[RS]TMP.V0", overlay=true)
hideopen = input(true)
hidemedian = input(false)
timewindow = input("3M")
topen = hideopen ? na : security(tickerid, timewindow, open)
tmedian = hidemedian ? na : security(tickerid, timewindow, hl2[1])

plot(tmedian, color=(tmedian != tmedian[1] ? na : black), linewidth=2)
plot(topen, color=(topen != topen[1] ? na : black), linewidth=1)