EMA 5 lines ( you can change range and color)EMA 5 lines
this is simple code !!
Hope this one will help you!
Have a nice day and trade!
Penunjuk dan strategi
Blackscrum Fear and Greed IndicatorBlackscrum Fear & Greed Indicator
— The Ultimate Crypto Market Sentiment Gauge —
WHAT IT IS
A real-time 0–100 composite sentiment index for crypto, combining 6 key signals: RSI, Trend vs EMA, Volatility (ATR), Volume Momentum, BTC Dominance, and USDT Dominance. High score = Greed (caution). Low score = Fear (buy zone).
6 PILLARS OF SENTIMENT
• RSI (30%) — High = Greed
• Trend vs EMA (20%) — Above EMA = Greed
• ATR Volatility (10%) — High = Fear
• Volume Momentum (15%) — Rising = Greed
• BTC Dominance (12.5%) — High = Fear
• USDT Dominance (12.5%) — High = Fear
VISUAL ZONES
• ≥80 Extreme Greed — Hot Pink (FOMO peak)
• 60–79 Greed — Spring Green (bullish)
• 40–59 Neutral — Light Gray (balance)
• 20–39 Fear — Deep Pink (pressure)
• ≤20 Extreme Fear — Bright Pink (BUY ZONE)
HOW TO USE
• ≤20 → Strong buy (capitulation)
• ≥80 → Take profit / caution (euphoria)
• Crossing 50 → Trend shift
• Use on 4H/1D for swing trades
• Combine with volume or BTC.D breaks
CUSTOMIZE
• Smoothing EMA: 3–5 for cleaner line
• Background Opacity: 70–90% for clarity
• Toggle BTC/USDT Dominance
ALERTS
Set two:
1. Extreme Greed ≥ 80
2. Extreme Fear ≤ 20
BEST FOR
BTC, ETH, altcoins — swing entries, exits, risk management
No lag. No external data. 100% on-chain + price. Built by traders, for traders.
"When others are greedy, be fearful. When others are fearful, be greedy." — Now with a score.
BlackScrum Swing Boxes 1/2/3 After seeing influencers selling their indicator suite's online, I decided to start making replicas of them, maybe mine are better, maybe they are worse. I use them in my day to day trading and they help me make money, hopefully they help you make money.
Not financial advice, Do Your Own Research.
Everything provided without warranty or liability. If you stuff up, learn from it, get better, we all make mistakes.
// BlackScrum — 1/2/3-Bar Swing Boxes (auto timeframe)
//
// DESCRIPTION
// This indicator displays three swing-direction boxes (1B, 2B, 3B) in the top-right corner of the chart.
// The boxes automatically adapt to the chart's timeframe (15m, 1H, 4H, 1D, etc.).
// Each box represents the direction of the most recently confirmed swing pivot:
// • 1B → 1-bar swing (fastest, most sensitive)
// • 2B → 2-bar swing (medium confirmation)
// • 3B → 3-bar swing (slowest, strongest confirmation)
//
// COLORS
// • GREEN = last confirmed swing pivot was a higher low (up swing)
// • RED = last confirmed swing pivot was a lower high (down swing)
// • GREY = no clear swing yet (fresh/transition area)
//
// CONFLUENCE
// • ALL GREEN = bullish alignment across 1B, 2B, 3B → strong trend continuation signal
// • ALL RED = bearish alignment across all three → strong downtrend continuation signal
//
// HOW TO USE (TRADEPLAY)
//
// 1) ENTRIES
// • Aggressive entry → enter when ALL GREEN prints on your timeframe.
// • Safer pullback entry → wait for 1B to briefly turn red during a green 2B/3B,
// then flip back to green. Enter on the re-flip.
// • Multi-timeframe filter:
// Take longs only when higher TF (e.g., 1H/4H) boxes are at least neutral-to-green.
//
// 2) EXITS
// • Weakness exit → when 1B flips against your position while 2B is neutral/red.
// • Full exit → when ALL RED prints.
// • Time stop → if price hasn’t moved after several bars of your execution timeframe.
//
// 3) STOP-LOSS / RISK
// • Place stops beyond the latest opposite swing used by 2B or 3B.
// • Add 0.5–1× ATR buffer if your market has stop-hunt volatility.
// • Always size position based on the distance to the swing stop.
//
// 4) WHEN TO IGNORE SIGNALS
// • Chop zones → 1B flipping repeatedly while 2B/3B disagree.
// • News candles → wait for pivots to confirm on the *closed* bar.
//
// 5) USING WITH OTHER TOOLS
// • With a trend ribbon (e.g., Larsson-style):
// Only take ALL GREEN longs when the ribbon is UP, and ALL RED shorts when ribbon is DOWN.
// • With a Fear & Greed index:
// Prefer longs when F&G > 60,
// Avoid longs when F&G < 40 unless countertrend scalping.
//
// 6) TIMEFRAME GUIDANCE
// • Scalping: 5m / 15m, confirmed by 1H or 4H boxes.
// • Swinging: 1H / 4H with daily filter.
// • Positioning: 1D with weekly confirmation.
//
// 7) INTERPRETATION CHEATSHEET
// • 1B green, 2B grey, 3B red → short-term bounce inside higher timeframe downtrend.
// • 1B/2B green, 3B grey → early trend reversal forming.
// • All grey → fresh swing area; wait for direction.
//
// 8) CUSTOMIZATION
// • len1 / len2 / len3 control sensitivity (higher = slower & cleaner).
// • Can add a timeframe header box (e.g., “15m / 4H / 1D”).
// • Can add a multi-timeframe grid (e.g., 15m | 1H | 4H | 1D each with 1B/2B/3B).
//
// ====================================================================================================
Liquidity Regime OscillatorThe Liquidity Signal Line is a macro-driven confirmation tool designed to capture the underlying global liquidity regime in a single, smoothed oscillator. It measures the combined directional flow of monetary and financial conditions using high-impact macro data: Federal Reserve assets (WALCL), Treasury General Account (TGA), and the Overnight Reverse Repo facility (RRP) – adjusted by key market proxies such as the U.S. Dollar Index, credit spreads (HYG/LQD), and equity risk appetite (SPHB/SPHQ). These components are normalized, weighted, and then double-smoothed into a stable signal that translates complex liquidity dynamics into a simple 0–100 scale.
Liquidity expansion provides fuel for risk assets, while contraction drains leverage and risk appetite. The Signal Line acts as a confirmation overlay for trend and allocation strategies, showing whether systemic liquidity is broadly supportive or restrictive. Readings above 50 indicate an expansionary environment (risk-on bias), below 50 a contractionary one (risk-off bias). Because the calculation uses higher-timeframe macro data, it can be displayed on any chart to give traders a consistent, regime-aware signal that bridges macro policy and technical execution.
OverUnderVixingIt shows how the VIX daily change has deviated from the historical relation with the SPX daily % change.
Read more here: threadreaderapp.com
BTC Short-Term Holder Moving Average (Approx. 155-day)short-term average buy price over 155 days for biction
BAY Technical Indicators//@version=5
indicator("BAY Technical Indicators", overlay=true)
// Price source
price = close
// VWAP
vwap = ta.vwap
plot(vwap, title="VWAP", color=color.blue, linewidth=2)
// SMMA (RMA) 20 and 50
smma20 = ta.rma(price, 20)
smma50 = ta.rma(price, 50)
plot(smma20, title="SMMA 20", color=color.lime)
plot(smma50, title="SMMA 50", color=color.purple)
// EMA 9 and 21
ema9 = ta.ema(price, 9)
ema21 = ta.ema(price, 21)
plot(ema9, title="EMA 9", color=color.white)
plot(ema21, title="EMA 21", color=color.red)
// MA 200
ma200 = ta.sma(price, 200)
plot(ma200, title="MA 200", color=color.orange, linewidth=2)
// SMA 325 (Dark Green)
sma325 = ta.sma(price, 325)
plot(sma325, title="SMA 325", color=color.new(color.green, 0)) // Dark green
// Volume SMA 9 (plotted in data window only)
volume_sma9 = ta.sma(volume, 9)
plot(volume_sma9, title="Volume SMA 9", color=color.fuchsia, linewidth=1, display=display.data_window)
Relative Strength vs S&P 500 (with RS Rating)Relative Strength vs S&P 500 (with RS Rating) - Plots the S&P 500 and the stock's Relative Strength.
- Optional Show RS New High Markers
Relative Strength % vs SPX (Bar-by-Bar)This gives a bar-by-bar strength against any ticker. Good for picking up Intraday RS
Position calculator (without Forex)That's an excellent idea. Here is a complete description of the simplified Pine Script v6 position size calculator, written in English.
📐 Pine Script V6 Position Size Calculator: Full Description
This Pine Script v6 indicator is a simplified, universal position size calculator designed for traders to quickly determine the exact quantity of an asset (shares, crypto units, etc.) they should trade to maintain a specific risk tolerance. It focuses solely on the most common and accessible calculation method: determining the number of units/contracts.
1. 🎯 Purpose
The primary goal of the script is to answer the question: "Given my total account capital and a defined stop-loss price, how many units of this asset can I buy/sell while only risking a specified percentage of my capital?"
It uses the classic position sizing formula:
Position Size (Units)=Risk Per UnitAccount Risk Amount
2. ⚙️ Indicator Settings (Inputs)
The script provides the user with five key adjustable parameters, all located in the indicator's settings panel:
Parameter Type Default Value Description
Capital total ($) float 10000.0 Your total trading account balance. This is the basis for calculating the risk amount.
Risque par trade (%) float 1.0 The maximum percentage of your capital you are willing to lose on this specific trade.
Prix d'Entree float 150.0 The target entry price for the trade. Since the "use current price" option was removed, this manual price is always used.
Prix Stop Loss float 145.0 The protective stop-loss price where you will exit the trade.
Core USD Liquidity Index### 🏦 Core USD Liquidity Index (v1)
**Purpose:**
The *Core USD Liquidity Index* tracks global **USD liquidity conditions**, the single most important macro driver behind risk-on and risk-off environments.
It combines 4 key monetary metrics into one normalized composite line:
- **FRED:RRPONTSYD** → Reverse Repo balance (⬆️ = liquidity tightening)
- **FRED:WALCL** → Federal Reserve balance sheet (⬆️ = liquidity expansion)
- **FRED:TB3MS** → 3-Month Treasury Bill rate (⬆️ = liquidity tightening)
- **TVC:DXY** → U.S. Dollar Index (⬆️ = global liquidity tightening)
---
### 🧭 **How it Works**
Each metric is normalized and aggregated to create a unified liquidity signal.
The index functions as a **"Liquidity Thermometer"**, visualizing whether dollars are entering or leaving global financial circulation.
---
### 📊 **Interpretation**
| Zone | Meaning | Market Behavior |
|------|----------|-----------------|
| 🟢 Above 0 | Liquidity expanding | Risk assets (BTC, SPX, Tech) strengthen |
| ⚪ Around 0 | Neutral liquidity | Sideways / indecisive markets |
| 🔴 Below 0 | Liquidity contracting | USD strengthens, risk assets weaken |
---
### 💡 **Use Cases**
- Identify **macro liquidity inflection points** ahead of price action
- Track **Fed policy impact** (balance sheet, RRP flows, T-Bill yields)
- Confirm or fade BTC/SPX rallies based on liquidity context
**Recommended timeframe:** Weekly or Daily
**Best pairs:** BTCUSD, SPX500, NASDAQ100, XAUUSD
Miggy Oscillator — NeoWave v5Miggy Oscillator — NeoWave v5
Advanced Multi-Filter Trading Oscillator
🚀 OVERVIEW
The Miggy Oscillator v5 is a sophisticated trading tool that combines the powerful WaveTrend algorithm with complementary RSI and Money Flow Index filters. Designed for traders who demand precision and reliability, this oscillator provides clear, filtered signals with multiple confirmation layers.
⚡ CORE FEATURES
🎯 Enhanced WaveTrend Engine
· Optimized channel calculations for superior trend detection
· Smooth crossover signals with reduced noise
· Customizable overbought/oversold zones
🛡️ Multi-Layer Confirmation System
· RSI Filter: Smoothed and normalized momentum confirmation
· Money Flow Index: Volume-based money flow analysis
· Trend Confirmations: Optional VWAP and EMA50/200 filters
🧠 Smart Operation Modes
· Scalping: Fast parameters for quick movements
· Intraday: Balanced settings for day trading
· Swing 1H-4H: Conservative parameters for higher timeframes
· Directional Modes: LONG-only or SHORT-only configurations
📊 SIGNAL TYPES
🔴 STRONG SIGNALS
· WaveTrend crosses in extreme zones
· RSI and MFI confirmation
· Trend alignment filters
🟡 EARLY WARNINGS
· Zone breakouts with momentum confirmation
· Early entry opportunities
· Reduced confirmation requirements
🔵 DIVERGENCES
· Automatic price-oscillator discrepancy detection
· Bullish and bearish divergence alerts
· Visual labels on chart
🎨 VISUAL FEATURES
· Clean, professional neon color scheme
· Multiple plot layers for comprehensive analysis
· Customizable signal sizes and styles
· Clear OB/OS reference lines
⚙️ PROFESSIONAL TOOLS
· Built-in Alert System: Separate alerts for each signal type
· Divergence Detection: Automatic bullish/bearish divergence spotting
· Flexible Timeframes: Works on all timeframes from 1 minute to 4 hours
· Customizable Parameters: Full control over all calculation periods
📈 RECOMMENDED USAGE
· Primary Timeframes: 15-minute to 1-hour charts
· Markets: Forex, Cryptocurrencies, Stocks, Indices
· Trading Styles: Scalping, Day Trading, Swing Trading
· Experience Levels: Suitable for both beginners and advanced traders
🎯 KEY BENEFITS
· Reduced False Signals: Multiple confirmation layers eliminate noise
· Clear Visual Alerts: Easy-to-spot signals on chart
· Flexible Configuration: Adaptable to any trading style
· Professional Grade: Institutional-quality analysis tools
💡 TRADING STRATEGY SUGGESTIONS
1. Strong Signals: Wait for full confirmation with all filters
2. Early Entries: Use warnings for potential early positioning
3. Divergence Plays: Combine with price action for reversal trades
4. Trend Following: Use in direction of higher timeframe trend
---
⚠️ RISK DISCLAIMER
This indicator is for educational and analytical purposes only. It is not financial advice. Always conduct your own research, use proper risk management, and understand that past performance does not guarantee future results. Trading carries significant risk of loss.
🔧 Technical Specifications
· Built on Pine Script v6
· Lightweight and efficient
· Regular updates and improvements
· Community support available
---
Join our community of professional traders! Your feedback and suggestions are always welcome for continuous improvement of this tool.
Happy Trading! 📈
Normalized EFINormalized EFI (nEFI)
The Normalized EFI (nEFI) is a volume-weighted momentum oscillator that refines the classic Elder Force Index (EFI) by normalizing it against average trading volume. This makes it highly adaptable across different assets, timeframes, and market conditions—especially useful when comparing momentum strength between low- and high-volume instruments.
How It Works:
Relative Price Change: Measures the percentage change in price from the prior bar:
(Close - Close ) / Close
Volume Normalization: Divides current volume by its EMA (default: 30 periods) to create a relative volume factor:
Volume / EMA(Volume, 30)
Normalized Force: Combines the two:
nEFI_raw = PriceChange% × RelativeVolume × 100
Smoothing: Applies an EMA (default: 13 periods) to reduce noise and highlight meaningful trends.
Key Features & Inputs:
Smoothing Length (default: 13): Controls responsiveness of the EMA smoothing.
Volume EMA Length (default: 30): Sets the lookback for volume normalization—longer values create a more stable baseline.
Zero Line Centered: Positive values indicate buying pressure; negative values show selling pressure.
How to Use:
Trend Confirmation: Rising nEFI above zero supports bullish trends; falling below zero confirms bearish moves.
Divergences: Look for price making new highs/lows while nEFI fails to follow — often signals reversal.
Zero Line Crossovers: Cross above zero = potential buy signal; cross below = sell signal.
Extreme Readings: Spikes far from zero may indicate overbought/oversold conditions or climax moves.
Advantages:
Volume-Adaptive: Unlike raw EFI, nEFI scales properly across assets with vastly different volume profiles (e.g., stocks vs. crypto).
Consistent Scaling: Values are intuitive and comparable over time and across symbols.
Reduced Noise: EMA smoothing filters out erratic volume spikes common in illiquid markets.
Cross-Market Friendly: Works reliably on forex, futures, stocks, and crypto without manual recalibration.
Ideal for:
Swing traders, momentum strategies, and multi-asset analysis seeking a clean, interpretable measure of volume-adjusted price force.
Position Size & Drawdown ManagerThis tool is designed to help traders dynamically adjust their position size and drawdown expectations as their trading capital changes over time. It provides a simple and intuitive way to translate backtest results into real-world position sizing decisions.
Purpose and Functionality
The indicator uses your original backtest parameters — including base capital, base drawdown percentage, and base position size — and your current account balance to calculate how your risk profile changes. It presents two main scenarios:
Lock Drawdown %: Keeps your original drawdown percentage fixed and calculates the new position size required.
Lock Position Size: Keeps your position size unchanged and shows how your drawdown percentage will shift.
Why it’s useful
Many traders face the challenge of scaling their strategies as their account grows or shrinks. This tool makes it easy to visualize the relationship between position sizing, capital, and drawdown. It’s particularly valuable for risk management, portfolio rebalancing, and maintaining consistent exposure when transitioning from backtest conditions to live trading.
How it works
The calculations are displayed in a clean, color-coded table that updates dynamically. This allows you to instantly see how capital fluctuations impact your expected drawdown or position size. You can toggle between light and dark themes and highlight important cells for clarity.
Practical use case
Combine this tool with your TradingView strategy results to better interpret your backtests and adjust your real-world trade sizes accordingly. It bridges the gap between simulated performance and actual account management.
Chart example
The chart included focuses only on this indicator, showing the output table and visual layout clearly without additional scripts or overlays.
LONG SETUP → 8/13/48 EMA + BoSMarks a perfect ENTRY (green "LONG") the exact candle where: 8 EMA crosses above BOTH 13 & 200 EMA
Price is above 200 EMA
Price breaks the most recent swing high (Break of Structure)
Keeps you IN the trade as long as price stays above the 8,13, 48 EMA
Plots EXIT signals:
Red "STOP" label under the last swing low
Orange "EXIT" when price closes below 13 EMA
Purple "EXIT" when price closes below 48 EMA
Use daily timeframe
PHD-Points
The PHD Pivot Points indicator is a professional-grade support and resistance tool that calculates key price levels based on previous day's price action and current intraday data. It provides traders with multiple reference points for identifying potential reversal zones, breakout levels, and strategic entry/exit positions.
Key Components
1. Previous Day Pivot Point (P)
White Line - The main pivot level calculated from previous day's High, Low, and Close
Formula: P = (Previous High + Previous Low + Previous Close) / 3
Serves as the central reference point for the trading day
Often acts as a psychological support/resistance level
2. Previous Day Support Levels (D1, D2, D3)
Brown Lines - Three support levels below the previous day's pivot
D1 (Support 1): First support level, closest to pivot
D2 (Support 2): Second support level, medium-strength
D3 (Support 3): Third support level, strongest support
Calculated using previous day's high and low ranges
3. Previous Day Resistance Levels (H1, H2, H3)
Yellow-Brown Lines - Three resistance levels above the previous day's pivot
H1 (Resistance 1): First resistance level, closest to pivot
H2 (Resistance 2): Second resistance level, medium-strength
H3 (Resistance 3): Third resistance level, strongest resistance
Calculated using previous day's high and low ranges
4. Today's Pivot Point (PT)
Dark Red Line - Dynamic pivot point that updates throughout the current trading session
Formula: PT = (Current High + Current Low + Current Close) / 3
Provides real-time trend reference for intraday trading
Helps identify intraday momentum and trend strength
5. Today's Dynamic Levels (DD1-DD3, HH1-HH3)
Calculated but not plotted by default
These values represent current session's support and resistance levels
Can be used for advanced intraday analysis
Trading Applications
Support and Resistance Trading
Price tends to bounce at D1, D2, D3 levels (potential buy zones)
Price tends to stall or reverse at H1, H2, H3 levels (potential sell zones)
Breaks above/below these levels signal trend strength
Trend Identification
Price above P = Bullish bias
Price below P = Bearish bias
PT line angle shows intraday momentum direction
DD RatioThe DD Ratio (“Directional Distribution Ratio”) is a breadth indicator that shows, in real time, how many of the selected stocks (e.g., S&P 500 components) are bullish vs. bearish relative to today’s open.
The DD Ratio tells you what’s really happening under the hood of the index:
Futures may mislead: An index future (like ES or NQ) can rise on a few heavy-weighted stocks even while most components fall.
The DD Ratio exposes that divergence.
Breadth confirmation: When the futures are up and DD Ratio ≥ 0.5 → healthy rally.
When futures are up but DD Ratio < 0.5 → weak, narrow advance.
Intraday sentiment gauge: It updates live with each bar, reflecting “who’s winning” since the open.
RSI Overbought/Oversold + Divergence Indicator (new)//@version=5
indicator('CryptoSignalScanner - RSI Overbought/Oversold + Divergence Indicator (new)',
//---------------------------------------------------------------------------------------------------------------------------------
//--- Define Colors ---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------
vWhite = #FFFFFF
vViolet = #C77DF3
vIndigo = #8A2BE2
vBlue = #009CDF
vGreen = #5EBD3E
vYellow = #FFB900
vRed = #E23838
longColor = color.green
shortColor = color.red
textColor = color.white
bullishColor = color.rgb(38,166,154,0) //Used in the display table
bearishColor = color.rgb(239,83,79,0) //Used in the display table
nomatchColor = color.silver //Used in the display table
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Functions--------------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
TF2txt(TF) =>
switch TF
"S" => "RSI 1s:"
"5S" => "RSI 5s:"
"10S" => "RSI 10s:"
"15S" => "RSI 15s:"
"30S" => "RSI 30s"
"1" => "RSI 1m:"
"3" => "RSI 3m:"
"5" => "RSI 5m:"
"15" => "RSI 15m:"
"30" => "RSI 30m"
"45" => "RSI 45m"
"60" => "RSI 1h:"
"120" => "RSI 2h:"
"180" => "RSI 3h:"
"240" => "RSI 4h:"
"480" => "RSI 8h:"
"D" => "RSI 1D:"
"1D" => "RSI 1D:"
"2D" => "RSI 2D:"
"3D" => "RSI 2D:"
"3D" => "RSI 3W:"
"W" => "RSI 1W:"
"1W" => "RSI 1W:"
"M" => "RSI 1M:"
"1M" => "RSI 1M:"
"3M" => "RSI 3M:"
"6M" => "RSI 6M:"
"12M" => "RSI 12M:"
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Show/Hide Settings ----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiShowInput = input(true, title='Show RSI', group='Show/Hide Settings')
maShowInput = input(false, title='Show MA', group='Show/Hide Settings')
showRSIMAInput = input(true, title='Show RSIMA Cloud', group='Show/Hide Settings')
rsiBandShowInput = input(true, title='Show Oversold/Overbought Lines', group='Show/Hide Settings')
rsiBandExtShowInput = input(true, title='Show Oversold/Overbought Extended Lines', group='Show/Hide Settings')
rsiHighlightShowInput = input(true, title='Show Oversold/Overbought Highlight Lines', group='Show/Hide Settings')
DivergenceShowInput = input(true, title='Show RSI Divergence Labels', group='Show/Hide Settings')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Table Settings --------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiShowTable = input(true, title='Show RSI Table Information box', group="RSI Table Settings")
rsiTablePosition = input.string(title='Location', defval='middle_right', options= , group="RSI Table Settings", inline='1')
rsiTextSize = input.string(title=' Size', defval='small', options= , group="RSI Table Settings", inline='1')
rsiShowTF1 = input(true, title='Show TimeFrame1', group="RSI Table Settings", inline='tf1')
rsiTF1 = input.timeframe("15", title=" Time", group="RSI Table Settings", inline='tf1')
rsiShowTF2 = input(true, title='Show TimeFrame2', group="RSI Table Settings", inline='tf2')
rsiTF2 = input.timeframe("60", title=" Time", group="RSI Table Settings", inline='tf2')
rsiShowTF3 = input(true, title='Show TimeFrame3', group="RSI Table Settings", inline='tf3')
rsiTF3 = input.timeframe("240", title=" Time", group="RSI Table Settings", inline='tf3')
rsiShowTF4 = input(true, title='Show TimeFrame4', group="RSI Table Settings", inline='tf4')
rsiTF4 = input.timeframe("D", title=" Time", group="RSI Table Settings", inline='tf4')
rsiShowHist = input(true, title='Show RSI Historical Columns', group="RSI Table Settings", tooltip='Show the information of the 2 previous closed candles')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- RSI Input Settings ----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiSourceInput = input.source(close, 'Source', group='RSI Settings')
rsiLengthInput = input.int(14, minval=1, title='RSI Length', group='RSI Settings', tooltip='Here we set the RSI lenght')
rsiColorInput = input.color(#26a69a, title="RSI Color", group='RSI Settings')
rsimaColorInput = input.color(#ef534f, title="RSIMA Color", group='RSI Settings')
rsiBandColorInput = input.color(#787B86, title="RSI Band Color", group='RSI Settings')
rsiUpperBandExtInput = input.int(title='RSI Overbought Extended Line', defval=80, minval=50, maxval=100, group='RSI Settings')
rsiUpperBandInput = input.int(title='RSI Overbought Line', defval=70, minval=50, maxval=100, group='RSI Settings')
rsiLowerBandInput = input.int(title='RSI Oversold Line', defval=30, minval=0, maxval=50, group='RSI Settings')
rsiLowerBandExtInput = input.int(title='RSI Oversold Extended Line', defval=20, minval=0, maxval=50, group='RSI Settings')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- MA Input Settings -----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
maTypeInput = input.string("EMA", title="MA Type", options= , group="MA Settings")
maLengthInput = input.int(14, title="MA Length", group="MA Settings")
maColorInput = input.color(color.yellow, title="MA Color", group='MA Settings') //#7E57C2
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Divergence Input Settings ---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
lbrInput = input(title="Pivot Lookback Right", defval=2, group='RSI Divergence Settings')
lblInput = input(title="Pivot Lookback Left", defval=2, group='RSI Divergence Settings')
lbRangeMaxInput = input(title="Max of Lookback Range", defval=10, group='RSI Divergence Settings')
lbRangeMinInput = input(title="Min of Lookback Range", defval=2, group='RSI Divergence Settings')
plotBullInput = input(title="Plot Bullish", defval=true, group='RSI Divergence Settings')
plotHiddenBullInput = input(title="Plot Hidden Bullish", defval=true, group='RSI Divergence Settings')
plotBearInput = input(title="Plot Bearish", defval=true, group='RSI Divergence Settings')
plotHiddenBearInput = input(title="Plot Hidden Bearish", defval=true, group='RSI Divergence Settings')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- RSI Calculation -------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsi = ta.rsi(rsiSourceInput, rsiLengthInput)
rsiprevious = rsi
= request.security(syminfo.tickerid, rsiTF1, [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, rsiTF2, [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, rsiTF3, [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, rsiTF4, [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- MA Calculation -------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
ma(source, length, type) =>
switch type
"SMA" => ta.sma(source, length)
"Bollinger Bands" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
"SMMA (RMA)" => ta.rma(source, length)
"WMA" => ta.wma(source, length)
"VWMA" => ta.vwma(source, length)
rsiMA = ma(rsi, maLengthInput, maTypeInput)
rsiMAPrevious = rsiMA
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Stoch RSI Settings + Calculation --------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
showStochRSI = input(false, title="Show Stochastic RSI", group='Stochastic RSI Settings')
smoothK = input.int(title="Stochastic K", defval=3, minval=1, maxval=10, group='Stochastic RSI Settings')
smoothD = input.int(title="Stochastic D", defval=4, minval=1, maxval=10, group='Stochastic RSI Settings')
lengthRSI = input.int(title="Stochastic RSI Lenght", defval=14, minval=1, group='Stochastic RSI Settings')
lengthStoch = input.int(title="Stochastic Lenght", defval=14, minval=1, group='Stochastic RSI Settings')
colorK = input.color(color.rgb(41,98,255,0), title="K Color", group='Stochastic RSI Settings', inline="1")
colorD = input.color(color.rgb(205,109,0,0), title="D Color", group='Stochastic RSI Settings', inline="1")
StochRSI = ta.rsi(rsiSourceInput, lengthRSI)
k = ta.sma(ta.stoch(StochRSI, StochRSI, StochRSI, lengthStoch), smoothK) //Blue Line
d = ta.sma(k, smoothD) //Red Line
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Divergence Settings ------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
bearColor = color.red
bullColor = color.green
hiddenBullColor = color.new(color.green, 50)
hiddenBearColor = color.new(color.red, 50)
//textColor = color.white
noneColor = color.new(color.white, 100)
osc = rsi
plFound = na(ta.pivotlow(osc, lblInput, lbrInput)) ? false : true
phFound = na(ta.pivothigh(osc, lblInput, lbrInput)) ? false : true
_inRange(cond) =>
bars = ta.barssince(cond == true)
lbRangeMinInput <= bars and bars <= lbRangeMaxInput
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Define Plot & Line Colors ---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiColor = rsi >= rsiMA ? rsiColorInput : rsimaColorInput
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Plot Lines ------------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Create a horizontal line at a specific price level
myLine = line.new(bar_index , 75, bar_index, 75, color = color.rgb(187, 14, 14), width = 2)
bottom = line.new(bar_index , 50, bar_index, 50, color = color.rgb(223, 226, 28), width = 2)
mymainLine = line.new(bar_index , 60, bar_index, 60, color = color.rgb(13, 154, 10), width = 3)
hline(50, title='RSI Baseline', color=color.new(rsiBandColorInput, 50), linestyle=hline.style_solid, editable=false)
hline(rsiBandExtShowInput ? rsiUpperBandExtInput : na, title='RSI Upper Band', color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)
hline(rsiBandShowInput ? rsiUpperBandInput : na, title='RSI Upper Band', color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)
hline(rsiBandShowInput ? rsiLowerBandInput : na, title='RSI Upper Band', color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)
hline(rsiBandExtShowInput ? rsiLowerBandExtInput : na, title='RSI Upper Band', color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)
bgcolor(rsiHighlightShowInput ? rsi >= rsiUpperBandExtInput ? color.new(rsiColorInput, 70) : na : na, title="Show Extended Oversold Highlight", editable=false)
bgcolor(rsiHighlightShowInput ? rsi >= rsiUpperBandInput ? rsi < rsiUpperBandExtInput ? color.new(#64ffda, 90) : na : na: na, title="Show Overbought Highlight", editable=false)
bgcolor(rsiHighlightShowInput ? rsi <= rsiLowerBandInput ? rsi > rsiLowerBandExtInput ? color.new(#F43E32, 90) : na : na : na, title="Show Extended Oversold Highlight", editable=false)
bgcolor(rsiHighlightShowInput ? rsi <= rsiLowerBandInput ? color.new(rsimaColorInput, 70) : na : na, title="Show Oversold Highlight", editable=false)
maPlot = plot(maShowInput ? rsiMA : na, title='MA', color=color.new(maColorInput,0), linewidth=1)
rsiMAPlot = plot(showRSIMAInput ? rsiMA : na, title="RSI EMA", color=color.new(rsimaColorInput,0), editable=false, display=display.none)
rsiPlot = plot(rsiShowInput ? rsi : na, title='RSI', color=color.new(rsiColor,0), linewidth=1)
fill(rsiPlot, rsiMAPlot, color=color.new(rsiColor, 60), title="RSIMA Cloud")
plot(showStochRSI ? k : na, title='Stochastic K', color=colorK, linewidth=1)
plot(showStochRSI ? d : na, title='Stochastic D', color=colorD, linewidth=1)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Plot Divergence -------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Regular Bullish
// Osc: Higher Low
oscHL = osc > ta.valuewhen(plFound, osc , 1) and _inRange(plFound )
// Price: Lower Low
priceLL = low < ta.valuewhen(plFound, low , 1)
bullCond = plotBullInput and priceLL and oscHL and plFound
plot(
plFound ? osc : na,
offset=-lbrInput,
title="Regular Bullish",
linewidth=2,
color=(bullCond ? bullColor : noneColor)
)
plotshape(
DivergenceShowInput ? bullCond ? osc : na : na,
offset=-lbrInput,
title="Regular Bullish Label",
text=" Bull ",
style=shape.labelup,
location=location.absolute,
color=bullColor,
textcolor=textColor
)
//------------------------------------------------------------------------------
// Hidden Bullish
// Osc: Lower Low
oscLL = osc < ta.valuewhen(plFound, osc , 1) and _inRange(plFound )
// Price: Higher Low
priceHL = low > ta.valuewhen(plFound, low , 1)
hiddenBullCond = plotHiddenBullInput and priceHL and oscLL and plFound
plot(
plFound ? osc : na,
offset=-lbrInput,
title="Hidden Bullish",
linewidth=2,
color=(hiddenBullCond ? hiddenBullColor : noneColor)
)
plotshape(
DivergenceShowInput ? hiddenBullCond ? osc : na : na,
offset=-lbrInput,
title="Hidden Bullish Label",
text=" H Bull ",
style=shape.labelup,
location=location.absolute,
color=bullColor,
textcolor=textColor
)
//------------------------------------------------------------------------------
// Regular Bearish
// Osc: Lower High
oscLH = osc < ta.valuewhen(phFound, osc , 1) and _inRange(phFound )
// Price: Higher High
priceHH = high > ta.valuewhen(phFound, high , 1)
bearCond = plotBearInput and priceHH and oscLH and phFound
plot(
phFound ? osc : na,
offset=-lbrInput,
title="Regular Bearish",
linewidth=2,
color=(bearCond ? bearColor : noneColor)
)
plotshape(
DivergenceShowInput ? bearCond ? osc : na : na,
offset=-lbrInput,
title="Regular Bearish Label",
text=" Bear ",
style=shape.labeldown,
location=location.absolute,
color=bearColor,
textcolor=textColor
)
//------------------------------------------------------------------------------
// Hidden Bearish
// Osc: Higher High
oscHH = osc > ta.valuewhen(phFound, osc , 1) and _inRange(phFound )
// Price: Lower High
priceLH = high < ta.valuewhen(phFound, high , 1)
hiddenBearCond = plotHiddenBearInput and priceLH and oscHH and phFound
plot(
phFound ? osc : na,
offset=-lbrInput,
title="Hidden Bearish",
linewidth=2,
color=(hiddenBearCond ? hiddenBearColor : noneColor)
)
plotshape(
DivergenceShowInput ? hiddenBearCond ? osc : na : na,
offset=-lbrInput,
title="Hidden Bearish Label",
text=" H Bear ",
style=shape.labeldown,
location=location.absolute,
color=bearColor,
textcolor=textColor
)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Check RSI Lineup ------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
bullTF = rsi > rsi and rsi > rsi
bearTF = rsi < rsi and rsi < rsi
bullTF1 = rsi1 > rsi1_1 and rsi1_1 > rsi1_2
bearTF1 = rsi1 < rsi1_1 and rsi1_1 < rsi1_2
bullTF2 = rsi2 > rsi2_1 and rsi2_1 > rsi2_2
bearTF2 = rsi2 < rsi2_1 and rsi2_1 < rsi2_2
bullTF3 = rsi3 > rsi3_1 and rsi3_1 > rsi3_2
bearTF3 = rsi3 < rsi3_1 and rsi3_1 < rsi3_2
bullTF4 = rsi4 > rsi4_1 and rsi4_1 > rsi4_2
bearTF4 = rsi4 < rsi4_1 and rsi4_1 < rsi4_2
bbTxt(bull,bear) =>
bull ? "BULLISH" : bear ? "BEARISCH" : 'NO LINEUP'
bbColor(bull,bear) =>
bull ? bullishColor : bear ? bearishColor : nomatchColor
newTC(tBox, col, row, txt, width, txtColor, bgColor, txtHA, txtSize) =>
table.cell(table_id=tBox,column=col, row=row, text=txt, width=width,text_color=txtColor,bgcolor=bgColor, text_halign=txtHA, text_size=txtSize)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Define RSI Table Setting ----------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
width_c0 = 0
width_c1 = 0
if rsiShowTable
var tBox = table.new(position=rsiTablePosition, columns=5, rows=6, bgcolor=color.rgb(18,22,33,50), frame_color=color.black, frame_width=1, border_color=color.black, border_width=1)
newTC(tBox, 0,1,"RSI Current",width_c0,color.orange,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,1,str.format(" {0,number,#.##} ", rsi),width_c0,vWhite,rsi < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,1,bbTxt(bullTF, bearTF),width_c0,vWhite,bbColor(bullTF, bearTF),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,1,str.format(" {0,number,#.##} ", rsi ),width_c0,vWhite,rsi < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,1,str.format(" {0,number,#.##} ", rsi ),width_c0,vWhite,rsi < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
if rsiShowTF1
newTC(tBox, 0,2,TF2txt(rsiTF1),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,2,str.format(" {0,number,#.##} ", rsi1),width_c0,vWhite,rsi1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,2,bbTxt(bullTF1, bearTF1),width_c0,vWhite,bbColor(bullTF1,bearTF1),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,2,str.format(" {0,number,#.##} ", rsi1_1),width_c0,vWhite,rsi1_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,2,str.format(" {0,number,#.##} ", rsi1_2),width_c0,vWhite,rsi1_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
if rsiShowTF2
newTC(tBox, 0,3,TF2txt(rsiTF2),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,3,str.format(" {0,number,#.##} ", rsi2),width_c0,vWhite,rsi2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,3,bbTxt(bullTF2, bearTF2),width_c0,vWhite,bbColor(bullTF2,bearTF2),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,3,str.format(" {0,number,#.##} ", rsi2_1),width_c0,vWhite,rsi2_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,3,str.format(" {0,number,#.##} ", rsi2_2),width_c0,vWhite,rsi2_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
if rsiShowTF3
newTC(tBox, 0,4,TF2txt(rsiTF3),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,4,str.format(" {0,number,#.##} ", rsi3),width_c0,vWhite,rsi3 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,4,bbTxt(bullTF3, bearTF3),width_c0,vWhite,bbColor(bullTF3,bearTF3),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,4,str.format(" {0,number,#.##} ", rsi3_1),width_c0,vWhite,rsi3_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,4,str.format(" {0,number,#.##} ", rsi3_2),width_c0,vWhite,rsi3_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
if rsiShowTF4
newTC(tBox, 0,5,TF2txt(rsiTF4),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,5,str.format(" {0,number,#.##} ", rsi4),width_c0,vWhite,rsi4 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,5,bbTxt(bullTF4, bearTF4),width_c0,vWhite,bbColor(bullTF4,bearTF4),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,5,str.format(" {0,number,#.##} ", rsi4_1),width_c0,vWhite,rsi4_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,5,str.format(" {0,number,#.##} ", rsi4_2),width_c0,vWhite,rsi4_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
//------------------------------------------------------
//--- Alerts -------------------------------------------
//------------------------------------------------------
Buy/Sell Volume Tracker [wjdtks255]Indicator Description
Function: Separates buy and sell volume based on candle direction (close ≥ open) and displays the buy−sell difference (hist_val) as a histogram.
Visuals: Buy/sell bars are distinguished by user-selectable colors and opacity; two moving averages (MA1 and MA2) are shown to smooth the flow.
Meaning: A positive histogram indicates buy dominance; a negative histogram indicates sell dominance.
Limitation: The current separation is estimated from candle direction and may differ from execution-side (tick/trade-side) based data.
Trading Rules (Summary)
Conservative trend-following long
Entry: Enter long when hist_val turns above 0 and MA1 crosses MA2 from below.
Stop-loss: Exit if hist_val falls back below 0 or MA1 drops below MA2.
Take-profit: Use a risk:reward of 1:1.5 or set targets based on ATR.
Short-term rebound long
Entry: Enter a short-term long when a large negative histogram region begins to narrow and shows a recovery sign.
Stop-loss: Exit if hist_val drops below the previous low or bearish candles continue.
Take-profit: Prefer quick partial profit-taking.
Short (sell) strategy
Entry: Enter short when hist_val falls below 0 and MA1 crosses MA2 from above.
Stop-loss / Take-profit: Apply the inverse rules of the long strategy.
Filters and risk management
Volume filter: Only accept signals when volume exceeds a fraction of average volume to reduce noise.
Entry strength: Require |hist_val| to exceed a historical average threshold (e.g., avg(|hist_val|, N) × factor) to strengthen signals.
Position sizing: Size positions so that account risk per trade is within limits (e.g., 1–2% of account equity).
Timeframe: Use short timeframes for scalping and 1h+ for swing trading.
BX-Indicator
The BX-ndicator is a comprehensive multi-timeframe technical analysis tool that combines trend-following, momentum, and volatility indicators to provide traders with clear visual signals for market analysis and decision-making.
Key Components
1. TEMA (Triple Exponential Moving Average)
TEMA21 (Yellow line): Fast-reacting trend indicator that reduces lag compared to traditional moving averages
TEMA55 (Red line): Medium-term trend confirmation line
These lines help identify short to medium-term trend direction and momentum shifts
2. Moving Average System
MA21 (Green): Short-term trend reference
MA34 (Orange): Swing trading reference
MA55 (Magenta): Medium-term trend line
MA89 (Blue): Intermediate trend filter
MA144 (Dark Red): Long-term trend baseline
3. Exponential Moving Averages (EMA)
EMA21 (Dark Green): Fast exponential trend
EMA55 (Purple): Medium exponential trend
EMA144 (Pink): Long-term exponential support/resistance
4. Dynamic Bands (Filled Zones)
Three colored bands provide visual trend zones:
Green Band (21-period): SMA21/EMA21 envelope - short-term volatility zone
Purple Band (55/62-period): SMA55/SMA62 envelope - medium-term consolidation zone
Red Band (144/233-period): EMA144/EMA233 envelope - long-term trend channel
5. VWAP (Volume Weighted Average Price)
White line representing the average price weighted by volume
Resets based on selected anchor period (Session/Week/Month/Year/All Time)
Critical reference point for institutional trading levels
6. Bollinger Bands
21-period SMA with 2 standard deviation bands (Cyan lines)
Measures price volatility and identifies overbought/oversold conditions
Helps identify potential breakout or mean reversion opportunities
Trading Applications
Trend Identification: Multiple MA/EMA crossovers confirm trend direction
Support/Resistance: Dynamic bands and VWAP provide key price levels
Volatility Assessment: Bollinger Bands measure market volatility expansion/contraction
Entry/Exit Timing: TEMA lines provide early trend reversal signals
Risk Management: Colored bands help visualize position relative to different timeframe trends






















