OPEN-SOURCE SCRIPT
TSEP Dual SMA + Optional BB

//version=5
indicator("TSEP – 50-day ADTV & Current Volume", overlay=false)
// Calculate values
currentVol = volume
avgVol50 = ta.sma(volume, 50)
// Format as millions (M)
formatVolume(v) =>
v >= 1e9 ? str.tostring(v / 1e9, "#.##") + "B" :
v >= 1e6 ? str.tostring(v / 1e6, "#.##") + "M" :
v >= 1e3 ? str.tostring(v / 1e3, "#.##") + "K" :
str.tostring(v, "#.##")
// Create output strings
volText = "Current Volume: " + formatVolume(currentVol)
adtvText = "50-day ADTV: " + formatVolume(avgVol50)
// Display in a table
var table t = table.new(position.top_right, 1, 2, border_width = 1)
if bar_index % 5 == 0 // Update every 5 bars to avoid flicker
table.cell(t, 0, 0, adtvText, text_color=color.white, bgcolor=color.new(color.blue, 80))
table.cell(t, 0, 1, volText, text_color=color.white, bgcolor=color.new(color.blue, 80))
indicator("TSEP – 50-day ADTV & Current Volume", overlay=false)
// Calculate values
currentVol = volume
avgVol50 = ta.sma(volume, 50)
// Format as millions (M)
formatVolume(v) =>
v >= 1e9 ? str.tostring(v / 1e9, "#.##") + "B" :
v >= 1e6 ? str.tostring(v / 1e6, "#.##") + "M" :
v >= 1e3 ? str.tostring(v / 1e3, "#.##") + "K" :
str.tostring(v, "#.##")
// Create output strings
volText = "Current Volume: " + formatVolume(currentVol)
adtvText = "50-day ADTV: " + formatVolume(avgVol50)
// Display in a table
var table t = table.new(position.top_right, 1, 2, border_width = 1)
if bar_index % 5 == 0 // Update every 5 bars to avoid flicker
table.cell(t, 0, 0, adtvText, text_color=color.white, bgcolor=color.new(color.blue, 80))
table.cell(t, 0, 1, volText, text_color=color.white, bgcolor=color.new(color.blue, 80))
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。