OPEN-SOURCE SCRIPT
Trend/Range Composite (Single-Line) v1.4

🔹 Step 1: Add it to your chart
Copy the whole script.
In TradingView → Pine Editor → paste it.
Click Add to chart.
It will show a white line in a subwindow, plus thresholds at 40 and 60, and a colored background.
Optional: You’ll see a status box (top-right of chart) with details like ADX, ATR, slope, etc.
🔹 Step 2: Understand the Score
The indicator compresses all signals into a 0–100 “Trend Strength Score”:
≥ 60 = TREND (teal background)
→ Market is trending, consider trend strategies like vertical spreads, runners, breakouts.
≤ 40 = RANGE (orange background)
→ Market is choppy/sideways, consider range strategies like butterflies, condors, mean-reversion fades.
40–60 = MIXED (gray background)
→ Indecision / chop. Best to reduce size or wait for clarity.
🔹 Step 3: Use with Your Trading Plan
Intraday (5m, 15m, 30m)
Score < 40 → play support/resistance bounces, fade extremes.
Score > 60 → play momentum breakouts or pullback continuations.
Daily chart
Good for swing context (is this month trending or just chopping?).
🔹 Step 4: Alerts
You can set TradingView alerts:
Cross above 60 → market entering trend mode.
Cross below 40 → market entering range mode.
Useful if you don’t want to watch constantly.
🔹 Step 5: Confirm with Price Levels
The score tells you “trend vs range”, but you still need levels:
If score < 40 → mark PDH / PDL (previous day high/low), VAH/VAL, VWAP. Expect rejections/fades.
If score > 60 → watch for breakouts beyond PDH/PDL or supply/demand zones.
Copy the whole script.
In TradingView → Pine Editor → paste it.
Click Add to chart.
It will show a white line in a subwindow, plus thresholds at 40 and 60, and a colored background.
Optional: You’ll see a status box (top-right of chart) with details like ADX, ATR, slope, etc.
🔹 Step 2: Understand the Score
The indicator compresses all signals into a 0–100 “Trend Strength Score”:
≥ 60 = TREND (teal background)
→ Market is trending, consider trend strategies like vertical spreads, runners, breakouts.
≤ 40 = RANGE (orange background)
→ Market is choppy/sideways, consider range strategies like butterflies, condors, mean-reversion fades.
40–60 = MIXED (gray background)
→ Indecision / chop. Best to reduce size or wait for clarity.
🔹 Step 3: Use with Your Trading Plan
Intraday (5m, 15m, 30m)
Score < 40 → play support/resistance bounces, fade extremes.
Score > 60 → play momentum breakouts or pullback continuations.
Daily chart
Good for swing context (is this month trending or just chopping?).
🔹 Step 4: Alerts
You can set TradingView alerts:
Cross above 60 → market entering trend mode.
Cross below 40 → market entering range mode.
Useful if you don’t want to watch constantly.
🔹 Step 5: Confirm with Price Levels
The score tells you “trend vs range”, but you still need levels:
If score < 40 → mark PDH / PDL (previous day high/low), VAH/VAL, VWAP. Expect rejections/fades.
If score > 60 → watch for breakouts beyond PDH/PDL or supply/demand zones.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.