OPEN-SOURCE SCRIPT
Cập nhật The Bitterroot Trader Checklist

//version=5
indicator("Syntax-Safe Confluence Gauge", overlay=true)
// --- 1. INPUTS ---
col_ema9 = input.color(#00bcd4, "9 EMA Color")
col_ema20 = input.color(#ff9800, "20 EMA Color")
col_ema60 = input.color(#f44336, "60 EMA Color")
col_vwap = input.color(color.gray, "VWAP Color")
// --- 2. 48-HOUR DATA ---
h48 = ta.highest(high, 100)
l48 = ta.lowest(low, 100)
v48_avg = ta.sma(volume, 100)
// --- 3. CALCULATIONS ---
[macdLine, signalLine, hist] = ta.macd(close, 12, 26, 9)
e9 = ta.ema(close, 9), e20 = ta.ema(close, 20), e60 = ta.ema(close, 60)
v_wap = ta.vwap(close)
// --- 4. SCORING & CHECKLIST LOGIC ---
bool c1 = macdLine > signalLine
bool c2_bull = (volume > v48_avg and close > open)
bool c2_bear = (volume > v48_avg and close < open)
bool c3 = (e9 > e20 and e20 > e60)
bool c4_bull = close > h48[1]
bool c4_bear = close < l48[1]
bool c5 = close > v_wap
// Final Scoring
float s2 = c2_bull ? 1.0 : c2_bear ? -1.0 : 0.0
float s4 = c4_bull ? 1.0 : c4_bear ? -1.0 : 0.0
float live_mean = ((c1 ? 1 : -1) + s2 + (c3 ? 1 : -1) + s4 + (c5 ? 1 : -1)) / 5.0
// Count active checks for Alerts
int bull_checks = (c1 ? 1 : 0) + (c2_bull ? 1 : 0) + (c3 ? 1 : 0) + (c4_bull ? 1 : 0) + (c5 ? 1 : 0)
int bear_checks = (macdLine < signalLine ? 1 : 0) + (c2_bear ? 1 : 0) + (e9 < e20 and e20 < e60 ? 1 : 0) + (c4_bear ? 1 : 0) + (close < v_wap ? 1 : 0)
// --- 5. ALERTS ---
alertcondition(bull_checks >= 4, title="Strong Bullish Confluence", message="4+ Bullish Checks Aligned!")
alertcondition(bear_checks >= 4, title="Strong Bearish Confluence", message="4+ Bearish Checks Aligned!")
// --- 6. COLOR ENGINE ---
bool macd_curling_up = hist > hist[1]
bool macd_curling_down = hist < hist[1]
color final_c = #808080
if live_mean <= -0.1
final_c := (live_mean <= -0.8) ? #ff0000 : #8b0000
if macd_curling_up
final_c := #d84315
else if live_mean >= 0.1
final_c := (live_mean >= 0.8) ? #00ff00 : #006400
if macd_curling_down
final_c := #9e9d24
else
final_c := #808080
// --- 7. REWRITTEN NEEDLE LOGIC (Fixes the Mismatched Input Error) ---
string needle = switch
live_mean <= -1.0 => "┃ "
live_mean <= -0.6 => " ┃ "
live_mean <= -0.2 => " ┃ "
live_mean == 0.0 => " ┃ "
live_mean <= 0.4 => " ┃ "
live_mean <= 0.8 => " ┃ "
=> " ┃"
// --- 8. TABLE DISPLAY ---
var table gauge = table.new(position.top_right, 1, 1)
if barstate.islast
string check1 = "MACD: " + (c1 ? "✅" : "❌")
string check2 = "VOL: " + (s2 > 0 ? "✅" : s2 < 0 ? "❌" : "➖")
string check3 = "EMA: " + (c3 ? "✅" : "❌")
string check4 = "48H: " + (s4 > 0 ? "✅" : s4 < 0 ? "❌" : "➖")
string check5 = "VWAP: " + (c5 ? "✅" : "❌")
string display_text = "48H MEAN: " + str.tostring(live_mean, "#.#") + "\n" +
" [ R ▬▬▬|▬▬▬ G ]\n" +
" " + needle + "\n" +
"------------------\n" +
check1 + " | " + check2 + "\n" +
check3 + " | " + check4 + "\n" +
check5 + " | CURL: " + (macd_curling_up ? "UP" : "DN")
table.cell(gauge, 0, 0, display_text, bgcolor=color.new(final_c, 85), text_color=final_c, text_size=size.large)
// --- 9. PLOTS ---
plot(h48, "48H High", color=color.new(#00ff00, 50), style=plot.style_stepline)
plot(l48, "48H Low", color=color.new(#ff0000, 50), style=plot.style_stepline)
indicator("Syntax-Safe Confluence Gauge", overlay=true)
// --- 1. INPUTS ---
col_ema9 = input.color(#00bcd4, "9 EMA Color")
col_ema20 = input.color(#ff9800, "20 EMA Color")
col_ema60 = input.color(#f44336, "60 EMA Color")
col_vwap = input.color(color.gray, "VWAP Color")
// --- 2. 48-HOUR DATA ---
h48 = ta.highest(high, 100)
l48 = ta.lowest(low, 100)
v48_avg = ta.sma(volume, 100)
// --- 3. CALCULATIONS ---
[macdLine, signalLine, hist] = ta.macd(close, 12, 26, 9)
e9 = ta.ema(close, 9), e20 = ta.ema(close, 20), e60 = ta.ema(close, 60)
v_wap = ta.vwap(close)
// --- 4. SCORING & CHECKLIST LOGIC ---
bool c1 = macdLine > signalLine
bool c2_bull = (volume > v48_avg and close > open)
bool c2_bear = (volume > v48_avg and close < open)
bool c3 = (e9 > e20 and e20 > e60)
bool c4_bull = close > h48[1]
bool c4_bear = close < l48[1]
bool c5 = close > v_wap
// Final Scoring
float s2 = c2_bull ? 1.0 : c2_bear ? -1.0 : 0.0
float s4 = c4_bull ? 1.0 : c4_bear ? -1.0 : 0.0
float live_mean = ((c1 ? 1 : -1) + s2 + (c3 ? 1 : -1) + s4 + (c5 ? 1 : -1)) / 5.0
// Count active checks for Alerts
int bull_checks = (c1 ? 1 : 0) + (c2_bull ? 1 : 0) + (c3 ? 1 : 0) + (c4_bull ? 1 : 0) + (c5 ? 1 : 0)
int bear_checks = (macdLine < signalLine ? 1 : 0) + (c2_bear ? 1 : 0) + (e9 < e20 and e20 < e60 ? 1 : 0) + (c4_bear ? 1 : 0) + (close < v_wap ? 1 : 0)
// --- 5. ALERTS ---
alertcondition(bull_checks >= 4, title="Strong Bullish Confluence", message="4+ Bullish Checks Aligned!")
alertcondition(bear_checks >= 4, title="Strong Bearish Confluence", message="4+ Bearish Checks Aligned!")
// --- 6. COLOR ENGINE ---
bool macd_curling_up = hist > hist[1]
bool macd_curling_down = hist < hist[1]
color final_c = #808080
if live_mean <= -0.1
final_c := (live_mean <= -0.8) ? #ff0000 : #8b0000
if macd_curling_up
final_c := #d84315
else if live_mean >= 0.1
final_c := (live_mean >= 0.8) ? #00ff00 : #006400
if macd_curling_down
final_c := #9e9d24
else
final_c := #808080
// --- 7. REWRITTEN NEEDLE LOGIC (Fixes the Mismatched Input Error) ---
string needle = switch
live_mean <= -1.0 => "┃ "
live_mean <= -0.6 => " ┃ "
live_mean <= -0.2 => " ┃ "
live_mean == 0.0 => " ┃ "
live_mean <= 0.4 => " ┃ "
live_mean <= 0.8 => " ┃ "
=> " ┃"
// --- 8. TABLE DISPLAY ---
var table gauge = table.new(position.top_right, 1, 1)
if barstate.islast
string check1 = "MACD: " + (c1 ? "✅" : "❌")
string check2 = "VOL: " + (s2 > 0 ? "✅" : s2 < 0 ? "❌" : "➖")
string check3 = "EMA: " + (c3 ? "✅" : "❌")
string check4 = "48H: " + (s4 > 0 ? "✅" : s4 < 0 ? "❌" : "➖")
string check5 = "VWAP: " + (c5 ? "✅" : "❌")
string display_text = "48H MEAN: " + str.tostring(live_mean, "#.#") + "\n" +
" [ R ▬▬▬|▬▬▬ G ]\n" +
" " + needle + "\n" +
"------------------\n" +
check1 + " | " + check2 + "\n" +
check3 + " | " + check4 + "\n" +
check5 + " | CURL: " + (macd_curling_up ? "UP" : "DN")
table.cell(gauge, 0, 0, display_text, bgcolor=color.new(final_c, 85), text_color=final_c, text_size=size.large)
// --- 9. PLOTS ---
plot(h48, "48H High", color=color.new(#00ff00, 50), style=plot.style_stepline)
plot(l48, "48H Low", color=color.new(#ff0000, 50), style=plot.style_stepline)
Phát hành các Ghi chú
Creates a checklist of when trades are more in your favor in when going long.Phát hành các Ghi chú
Help with understanding entries. Phát hành các Ghi chú
Help with entriesPhát hành các Ghi chú
Helps with understanding indicators and when a good entry may be.Phát hành các Ghi chú
This is to help traders understand when a trade is in their favor. MACD open, moving averages stacked, spanning, and inclining. A volume indicator shows the strength of the volume compared to the daily high. And the curl indicates the direction the MACD is starting to curl to anticipate a crossover. The more indicators in favor of the trade, the higher the percentage. You will see the colors change from red to green for a quick analysis.
Phát hành các Ghi chú
A visual checklist to help with entries and exits.Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.