OPEN-SOURCE SCRIPT

3s vs 10s Up/Down

56
//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")

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。