OPEN-SOURCE SCRIPT

3s vs 10s Up/Down

49
//version=5
indicator("3s vs 10s Up/Down", overlay=true, scale=scale.none)

three_sec_diff = close - request.security(syminfo.tickerid, "3S", close[1])
ten_sec_diff = close - request.security(syminfo.tickerid, "10S", close[1])

faster_up = three_sec_diff > ten_sec_diff
faster_down = three_sec_diff < ten_sec_diff
col = faster_up ? color.green : faster_down ? color.red : color.gray

// Plot a shape at the top of each bar
plotshape(series=true, location=location.top, color=col, style=shape.circle, size=size.large, title="Speed Tick Light")

// Optional: only display on the last bar for dashboard style light
show_light = barstate.islast
plotshape(series=show_light, location=location.top, color=col, style=shape.circle, size=size.huge, title="Current Tick Light")

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.