Game Theory Trading StrategyGame Theory Trading Strategy: Explanation and Working Logic
This Pine Script (version 5) code implements a trading strategy named "Game Theory Trading Strategy" in TradingView. Unlike the previous indicator, this is a full-fledged strategy with automated entry/exit rules, risk management, and backtesting capabilities. It uses Game Theory principles to analyze market behavior, focusing on herd behavior, institutional flows, liquidity traps, and Nash equilibrium to generate buy (long) and sell (short) signals. Below, I'll explain the strategy's purpose, working logic, key components, and usage tips in detail.
1. General Description
Purpose: The strategy identifies high-probability trading opportunities by combining Game Theory concepts (herd behavior, contrarian signals, Nash equilibrium) with technical analysis (RSI, volume, momentum). It aims to exploit market inefficiencies caused by retail herd behavior, institutional flows, and liquidity traps. The strategy is designed for automated trading with defined risk management (stop-loss/take-profit) and position sizing based on market conditions.
Key Features:
Herd Behavior Detection: Identifies retail panic buying/selling using RSI and volume spikes.
Liquidity Traps: Detects stop-loss hunting zones where price breaks recent highs/lows but reverses.
Institutional Flow Analysis: Tracks high-volume institutional activity via Accumulation/Distribution and volume spikes.
Nash Equilibrium: Uses statistical price bands to assess whether the market is in equilibrium or deviated (overbought/oversold).
Risk Management: Configurable stop-loss (SL) and take-profit (TP) percentages, dynamic position sizing based on Game Theory (minimax principle).
Visualization: Displays Nash bands, signals, background colors, and two tables (Game Theory status and backtest results).
Backtesting: Tracks performance metrics like win rate, profit factor, max drawdown, and Sharpe ratio.
Strategy Settings:
Initial capital: $10,000.
Pyramiding: Up to 3 positions.
Position size: 10% of equity (default_qty_value=10).
Configurable inputs for RSI, volume, liquidity, institutional flow, Nash equilibrium, and risk management.
Warning: This is a strategy, not just an indicator. It executes trades automatically in TradingView's Strategy Tester. Always backtest thoroughly and use proper risk management before live trading.
2. Working Logic (Step by Step)
The strategy processes each bar (candle) to generate signals, manage positions, and update performance metrics. Here's how it works:
a. Input Parameters
The inputs are grouped for clarity:
Herd Behavior (🐑):
RSI Period (14): For overbought/oversold detection.
Volume MA Period (20): To calculate average volume for spike detection.
Herd Threshold (2.0): Volume multiplier for detecting herd activity.
Liquidity Analysis (💧):
Liquidity Lookback (50): Bars to check for recent highs/lows.
Liquidity Sensitivity (1.5): Volume multiplier for trap detection.
Institutional Flow (🏦):
Institutional Volume Multiplier (2.5): For detecting large volume spikes.
Institutional MA Period (21): For Accumulation/Distribution smoothing.
Nash Equilibrium (⚖️):
Nash Period (100): For calculating price mean and standard deviation.
Nash Deviation (0.02): Multiplier for equilibrium bands.
Risk Management (🛡️):
Use Stop-Loss (true): Enables SL at 2% below/above entry price.
Use Take-Profit (true): Enables TP at 5% above/below entry price.
b. Herd Behavior Detection
RSI (14): Checks for extreme conditions:
Overbought: RSI > 70 (potential herd buying).
Oversold: RSI < 30 (potential herd selling).
Volume Spike: Volume > SMA(20) x 2.0 (herd_threshold).
Momentum: Price change over 10 bars (close - close ) compared to its SMA(20).
Herd Signals:
Herd Buying: RSI > 70 + volume spike + positive momentum = Retail buying frenzy (red background).
Herd Selling: RSI < 30 + volume spike + negative momentum = Retail selling panic (green background).
c. Liquidity Trap Detection
Recent Highs/Lows: Calculated over 50 bars (liquidity_lookback).
Psychological Levels: Nearest round numbers (e.g., $100, $110) as potential stop-loss zones.
Trap Conditions:
Up Trap: Price breaks recent high, closes below it, with a volume spike (volume > SMA x 1.5).
Down Trap: Price breaks recent low, closes above it, with a volume spike.
Visualization: Traps are marked with small red/green crosses above/below bars.
d. Institutional Flow Analysis
Volume Check: Volume > SMA(20) x 2.5 (inst_volume_mult) = Institutional activity.
Accumulation/Distribution (AD):
Formula: ((close - low) - (high - close)) / (high - low) * volume, cumulated over time.
Smoothed with SMA(21) (inst_ma_length).
Accumulation: AD > MA + high volume = Institutions buying.
Distribution: AD < MA + high volume = Institutions selling.
Smart Money Index: (close - open) / (high - low) * volume, smoothed with SMA(20). Positive = Smart money buying.
e. Nash Equilibrium
Calculation:
Price mean: SMA(100) (nash_period).
Standard deviation: stdev(100).
Upper Nash: Mean + StdDev x 0.02 (nash_deviation).
Lower Nash: Mean - StdDev x 0.02.
Conditions:
Near Equilibrium: Price between upper and lower Nash bands (stable market).
Above Nash: Price > upper band (overbought, sell potential).
Below Nash: Price < lower band (oversold, buy potential).
Visualization: Orange line (mean), red/green lines (upper/lower bands).
f. Game Theory Signals
The strategy generates three types of signals, combined into long/short triggers:
Contrarian Signals:
Buy: Herd selling + (accumulation or down trap) = Go against retail panic.
Sell: Herd buying + (distribution or up trap).
Momentum Signals:
Buy: Below Nash + positive smart money + no herd buying.
Sell: Above Nash + negative smart money + no herd selling.
Nash Reversion Signals:
Buy: Below Nash + rising close (close > close ) + volume > MA.
Sell: Above Nash + falling close + volume > MA.
Final Signals:
Long Signal: Contrarian buy OR momentum buy OR Nash reversion buy.
Short Signal: Contrarian sell OR momentum sell OR Nash reversion sell.
g. Position Management
Position Sizing (Minimax Principle):
Default: 1.0 (10% of equity).
In Nash equilibrium: Reduced to 0.5 (conservative).
During institutional volume: Increased to 1.5 (aggressive).
Entries:
Long: If long_signal is true and no existing long position (strategy.position_size <= 0).
Short: If short_signal is true and no existing short position (strategy.position_size >= 0).
Exits:
Stop-Loss: If use_sl=true, set at 2% below/above entry price.
Take-Profit: If use_tp=true, set at 5% above/below entry price.
Pyramiding: Up to 3 concurrent positions allowed.
h. Visualization
Nash Bands: Orange (mean), red (upper), green (lower).
Background Colors:
Herd buying: Red (90% transparency).
Herd selling: Green.
Institutional volume: Blue.
Signals:
Contrarian buy/sell: Green/red triangles below/above bars.
Liquidity traps: Red/green crosses above/below bars.
Tables:
Game Theory Table (Top-Right):
Herd Behavior: Buying frenzy, selling panic, or normal.
Institutional Flow: Accumulation, distribution, or neutral.
Nash Equilibrium: In equilibrium, above, or below.
Liquidity Status: Trap detected or safe.
Position Suggestion: Long (green), Short (red), or Wait (gray).
Backtest Table (Bottom-Right):
Total Trades: Number of closed trades.
Win Rate: Percentage of winning trades.
Net Profit/Loss: In USD, colored green/red.
Profit Factor: Gross profit / gross loss.
Max Drawdown: Peak-to-trough equity drop (%).
Win/Loss Trades: Number of winning/losing trades.
Risk/Reward Ratio: Simplified Sharpe ratio (returns / drawdown).
Avg Win/Loss Ratio: Average win per trade / average loss per trade.
Last Update: Current time.
i. Backtesting Metrics
Tracks:
Total trades, winning/losing trades.
Win rate (%).
Net profit ($).
Profit factor (gross profit / gross loss).
Max drawdown (%).
Simplified Sharpe ratio (returns / drawdown).
Average win/loss ratio.
Updates metrics on each closed trade.
Displays a label on the last bar with backtest period, total trades, win rate, and net profit.
j. Alerts
No explicit alertconditions defined, but you can add them for long_signal and short_signal (e.g., alertcondition(long_signal, "GT Long Entry", "Long Signal Detected!")).
Use TradingView's alert system with Strategy Tester outputs.
3. Usage Tips
Timeframe: Best for H1-D1 timeframes. Shorter frames (M1-M15) may produce noisy signals.
Settings:
Risk Management: Adjust sl_percent (e.g., 1% for volatile markets) and tp_percent (e.g., 3% for scalping).
Herd Threshold: Increase to 2.5 for stricter herd detection in choppy markets.
Liquidity Lookback: Reduce to 20 for faster markets (e.g., crypto).
Nash Period: Increase to 200 for longer-term analysis.
Backtesting:
Use TradingView's Strategy Tester to evaluate performance.
Check win rate (>50%), profit factor (>1.5), and max drawdown (<20%) for viability.
Test on different assets/timeframes to ensure robustness.
Live Trading:
Start with a demo account.
Combine with other indicators (e.g., EMAs, support/resistance) for confirmation.
Monitor liquidity traps and institutional flow for context.
Risk Management:
Always use SL/TP to limit losses.
Adjust position_size for risk tolerance (e.g., 5% of equity for conservative trading).
Avoid over-leveraging (pyramiding=3 can amplify risk).
Troubleshooting:
If no trades are executed, check signal conditions (e.g., lower herd_threshold or liquidity_sensitivity).
Ensure sufficient historical data for Nash and liquidity calculations.
If tables overlap, adjust position.top_right/bottom_right coordinates.
4. Key Differences from the Previous Indicator
Indicator vs. Strategy: The previous code was an indicator (VP + Game Theory Integrated Strategy) focused on visualization and alerts. This is a strategy with automated entries/exits and backtesting.
Volume Profile: Absent in this strategy, making it lighter but less focused on high-volume zones.
Wick Analysis: Not included here, unlike the previous indicator's heavy reliance on wick patterns.
Backtesting: This strategy includes detailed performance metrics and a backtest table, absent in the indicator.
Simpler Signals: Focuses on Game Theory signals (contrarian, momentum, Nash reversion) without the "Power/Ultra Power" hierarchy.
Risk Management: Explicit SL/TP and dynamic position sizing, not present in the indicator.
5. Conclusion
The "Game Theory Trading Strategy" is a sophisticated system leveraging herd behavior, institutional flows, liquidity traps, and Nash equilibrium to trade market inefficiencies. It’s designed for traders who understand Game Theory principles and want automated execution with robust risk management. However, it requires thorough backtesting and parameter optimization for specific markets (e.g., forex, crypto, stocks). The backtest table and visual aids make it easy to monitor performance, but always combine with other analysis tools and proper capital management.
If you need help with backtesting, adding alerts, or optimizing parameters, let me know!
ความผันผวน
Mig Trade Model - Kill Zones
Key features:
Liquidity Hunt Detection: Spots aggressive moves that "hunt" stops beyond recent swing highs/lows.
Consolidation Filter: Requires 1-3 small-range candles after a hunt before confirming with a strong candle.
Bias Application: Uses daily open/close to auto-detect bias or allows manual override.
Kill Zone Restriction: Limits signals to London (default: 7-10 AM UTC) and NY (default: 12-3 PM UTC) sessions for better relevance in active markets.
This strategy is inspired by smart money concepts (SMC) and ICT (Inner Circle Trader) methodologies, aiming to capture venom-like "stings" in price action where liquidity is grabbed before reversals.
How It Works
ATR Calculation: Uses a user-defined ATR length (default: 14) to measure volatility, which scales candle body and range thresholds.
Bias Determination:
Auto: Compares daily close to open (bullish if close > open).
Manual: User selects "Bullish" or "Bearish."
Strong Candles:
Bullish: Green candle with body > 2x ATR (configurable).
Bearish: Red candle with body > 2x ATR.
Small Range Candles:
Candles where high-low < 0.5x ATR (configurable).
Liquidity Hunt:
Bullish Hunt: Strong bearish candle making a new low below the past swing low (default: 10 bars).
Bearish Hunt: Strong bullish candle making a new high above the past swing high.
Signal Generation:
After a hunt, counts 1-3 small-range candles.
Confirms with a strong candle in the opposite direction (e.g., strong bullish after bearish hunt).
Resets if >3 small candles or an opposing strong candle appears.
Kill Zone Filter:
Checks if the current bar's time (in UTC) falls within London or NY Kill Zones.
Only allows final "Buy" (bullish entry) or "Sell" (bearish entry) if bias matches and in Kill Zone.
Plots:
Yellow circle (below): Bullish liquidity hunt.
Orange circle (above): Bearish liquidity hunt.
Blue diamond (below): Raw bullish signal.
Purple diamond (above): Raw bearish signal.
Green triangle up ("Buy"): Filtered bullish entry.
Red triangle down ("Sell"): Filtered bearish entry.
Inputs
Bias: "Auto" (default), "Bullish", or "Bearish" – Controls signal direction based on daily trend.
ATR Length: 14 (default) – Period for ATR calculation.
Swing Length for Liquidity Hunt: 10 (default) – Bars to look back for swing highs/lows.
Strong Candle Body Multiplier (x ATR): 2.0 (default) – Threshold for strong candle bodies.
Small Range Multiplier (x ATR): 0.5 (default) – Threshold for small-range candles.
London Kill Zone Start/End Hour (UTC): 7/10 (default) – Customize London session hours.
NY Kill Zone Start/End Hour (UTC): 12/15 (default) – Customize New York session hours.
Usage Tips
Timeframe: Best on lower timeframes (e.g., 5-15 min) for intraday trading, especially forex pairs like EURUSD or GBPUSD.
Timezone Adjustment: Inputs are in UTC. If your chart is in a different timezone (e.g., EST = UTC-5), adjust hours accordingly (e.g., London: 2-5 AM EST → 7-10 UTC).
Risk Management: Use with stop-loss (e.g., beyond the hunt low/high) and take-profit based on ATR multiples. Not financial advice—backtest thoroughly.
Customization: Tweak multipliers for different assets; higher for volatile cryptos, lower for stocks.
Limitations: Relies on historical data; may generate false signals in ranging markets. Combine with other indicators like volume or support/resistance.
This indicator is for educational purposes. Always use discretion and proper risk management in live trading. If you find it useful, feel free to share feedback or suggestions!
Candle Channel█ OVERVIEW
The "Candle Channel" indicator is a versatile technical analysis tool that plots a price channel based on the Simple Moving Average (SMA) of candlestick midpoints. The channel bands, calculated based on candlestick volatility, form dynamic support and resistance levels that adapt to price movements. The script generates signals for reversals from the bands and SMA breakouts, making it useful for both short-term and long-term traders. By adjusting the SMA length, the channel can vary in nature—from a wide channel encapsulating price movement to narrower support/resistance or trend-following bands. The channel width can be further customized using a scaling parameter, allowing adaptation to different trading styles and markets.
█ MECHANISM
Band Calculation
The indicator is based on the following calculations:  
Candlestick Midpoint: Calculated as the arithmetic average of the candle’s high and low prices: (high + low) / 2.  
Simple Moving Average (SMA): The average of candlestick midpoints over a specified length (default: 20 candles), forming the channel’s centerline.  
Average Candle Height: Calculated as the average difference between the high and low prices (high - low) over the same SMA length, serving as a measure of market volatility.  
Band Scaling: The user specifies a percentage of the average candle height (default: 200%), which is multiplied by the average height to create an offset. The upper band is SMA + offset, and the lower band is SMA - offset.Example: For an average candle height of 10 points and 200% scaling, the offset is 20 points, meaning the bands are ±20 points from the SMA.  
Channel Characteristics: The SMA length determines the channel’s dynamics. Shorter SMA values (10–30) create a wide channel that contains price movement, ideal for scalping or short-term trading. Longer SMA values (above 30, e.g., 50–100) transform the channel into narrower support/resistance or trend-following bands, suitable for longer-term analysis. Band scaling further adjusts the channel width to match market volatility.
Signals  
Reversal from Bands: Signals are generated when the price closes outside the band (above the upper or below the lower) and then returns to the channel, indicating a potential trend reversal.  
SMA Breakout: Signals are generated when the price crosses the SMA upward (bullish signal) or downward (bearish signal), suggesting potential trend changes.
Visualization  
Centerline: The SMA of candlestick midpoints, displayed as a thin line.  
Channel Bands: Upper and lower channel boundaries, with customizable colors.  
Fill: Options include a gradient (smooth color transition between bands) or solid color. The fill can also be disabled for greater clarity.
█ FEATURES AND SETTINGS  
SMA Length: Determines the moving average period (default: 20). Values of 10–30 are suitable for a wide channel containing price movement, ideal for short-term timeframes. Longer values (e.g., 50–100) create narrower support/resistance or trend-following bands, better suited for higher timeframes.  
Band Scaling: Percentage of the average candle height (default: 200%). Adjusts the channel width to match market volatility—smaller values (e.g., 50–100%) for narrower bands, larger values (e.g., 200–300%) for wider channels.  
Fill Type: Gradient, solid, or no fill, allowing customization to user preferences.  
Colors: Options to change the colors of bands, fill, and signals for better readability.  
Signals: Options to enable/disable reversal signals from bands and SMA breakout signals.
█ HOW TO USE  
Add the script to your chart in TradingView by clicking "Add to Chart" in the Pine Editor.  
Adjust input parameters in the script settings:  
SMA Length: Set to 10–30 for a wide channel containing price movement, suitable for scalping or short-term trading. Set above 30 (e.g., 50–100) for narrower support/resistance or trend-following bands.  
Band Scaling: Adjust the channel width to market volatility. Smaller values (50–100%) for tighter support/resistance bands, larger values (200–300%) for wider channels containing price movement.  
Fill Type and Colors: Choose a gradient for aesthetics or a solid fill for clarity.
Analyze signals:  
Reversal Signals: Triangles above (bearish) or below (bullish) candles indicate potential reversal points.  
SMA Breakout Signals: Circles above (bearish) or below (bullish) candles indicate trend changes.
Test the indicator on different instruments and timeframes to find optimal settings for your trading style.
█ LIMITATIONS  
The indicator may generate false signals in highly volatile or consolidating markets.  
On low-liquidity charts (e.g., exotic currency pairs), the bands may be less reliable.  
Effectiveness depends on properly matching parameters to the market and timeframe.
Moving Average Shift [Quantora]Title: Moving Average Shift  
Description:
The Moving Average Shift   is a dynamic technical analysis tool designed to help traders better visualize trend strength and direction using a combination of customizable moving averages and a volatility-adjusted oscillator.
🔧 Features:
    Multi-Type Moving Average Selection
    Choose from SMA, EMA, SMMA (RMA), WMA, and VWMA for your main signal line.
    ZLSMA Trio
    Three Zero-Lag Smoothed Moving Averages (ZLSMA) with adjustable lengths and colors provide a smoother trend-following structure without the delay of traditional MAs.
    EMA Ribbon (50/100/200)
    Add clarity to long-term trend direction with layered Exponential Moving Averages in key institutional periods.
    Volatility-Adjusted Oscillator
    A color-changing oscillator calculated from the normalized deviation between price and the selected MA. This helps identify trend shifts and momentum buildups.
    Custom MA Line Widths and Styling
    Full control over the width and appearance of all MA lines for visual clarity.
    Bar & Candle Coloring
    Bars and candles dynamically change color based on the relationship between price and the selected MA — helping you quickly assess bullish/bearish conditions.
📈 How It Helps:
    Spot early trend shifts through the oscillator.
    Confirm trades using the alignment between ZLSMAs and EMAs.
    Quickly assess current trend conditions using color-coded price bars.
20-Candle ATR in Pips (5m only)This custom indicator displays the Average True Range (ATR) over the last 20 candles on a 5-minute chart, specifically designed for pairs where 1 pip = 0.01.
Key features:
📐 Calculates a simple moving average of the true range over the last 20 five-minute candles.
📋 Outputs the ATR value in a clean table with a green background and white text.
⚠️ Designed exclusively for the 5-minute timeframe – prompts you to switch if you’re on a different one.
📏 Values are shown in pips (e.g., “ATR (20 candles): 9.83 pips”).
This tool is ideal for short-term volatility tracking, scalping strategies, and identifying market conditions where price is expanding or contracting.
Two assets correlation trackerHi, I made this simple script to see how two correlated assets are actually performing short-term. The idea comes from correlation between BTC and ETH that that usually stands 0.9 (Pearson's correlation). However Pearson's correlation doesn't indicate the relative price difference and cannot be used trading correlation when used alone. 
My approach is simple - we can select the date/time from which we will start tracking the price change, and instead of tracking the price, we track 100 USD worth of BTC and ETH and how this investment perform. This gives us the price difference relative to a point in the near future, I would suggest using latest trend shift, for example. 
On example of how this can be used: If we see that BTC is falling slower than ETH since trend shift, we can long BTC and short ETH in equal parts and expect to gain from the difference while hedging potential loss.
Ultimate Scalping Strategy v2Strategy Overview
 This is a versatile scalping strategy designed primarily for low timeframes (like 1-min, 3-min, or 5-min charts). Its core logic is based on a classic EMA (Exponential Moving Average) crossover system, which is then filtered by the VWAP (Volume-Weighted Average Price) to confirm the trade's direction in alignment with the market's current intraday sentiment.
The strategy is highly customizable, allowing traders to add layers of confirmation, control trade direction, and manage exits with precision.
 Core Strategy Logic
 
The strategy's entry signals are generated when two primary conditions are met simultaneously:
 
 Momentum Shift (EMA Crossover): It looks for a crossover between a fast EMA (default length 9) and a slow EMA (default length 21).
 Buy Signal: The fast EMA crosses above the slow EMA, indicating a potential shift to bullish momentum.
 Sell Signal: The fast EMA crosses below the slow EMA, indicating a potential shift to bearish momentum.
 Trend/Sentiment Filter (VWAP): The crossover signal is only considered valid if the price is on the "correct" side of the VWAP.
 For a Buy Signal: The price must be trading above the VWAP. This confirms that, on average, buyers are in control for the day.
 For a Sell Signal: The price must be trading below the VWAP. This confirms that sellers are generally in control.
 
 Confirmation Filters (Optional)
 
To increase the reliability of the signals and reduce false entries, the strategy includes two optional confirmation filters:
 
 Price Action Filter (Engulfing Candle): If enabled (Use Price Action), the entry signal is only valid if the crossover candle is also an "engulfing" candle.
 A Bullish Engulfing candle is a large green candle that completely "engulfs" the body of the previous smaller red candle, signaling strong buying pressure.
 A Bearish Engulfing candle is a large red candle that engulfs the previous smaller green candle, signaling strong selling pressure.
 Volume Filter (Volume Spike): If enabled (Use Volume Confirmation), the entry signal must be accompanied by a surge in volume. This is confirmed if the volume of the entry candle is greater than its recent moving average (default 20 periods). This ensures the move has strong participation behind it.
 
 Exit Strategy
 
A position can be closed in one of three ways, creating a comprehensive exit plan:
 
 Stop Loss (SL): A fixed stop loss is set at a level determined by a multiple of the Average True Range (ATR). For example, a 1.5 multiplier places the stop 1.5 times the current ATR value away from the entry price. This makes the stop dynamic, adapting to market volatility.
 Take Profit (TP): A fixed take profit is also set using an ATR multiplier. By setting the TP multiplier higher than the SL multiplier (e.g., 2.0 for TP vs. 1.5 for SL), the strategy aims for a positive risk-to-reward ratio on each trade.
 Exit on Opposite Signal (Reversal): If enabled, an open position will be closed automatically if a valid entry signal in the opposite direction appears. For example, if you are in a long trade and a valid short signal occurs, the strategy will exit the long position immediately. This feature turns the strategy into more of a reversal system.
 
 Key Features & Customization
 
 
 Trade Direction Control: You can enable or disable long and short trades independently using the Allow Longs and Allow Shorts toggles. This is useful for trading in harmony with a higher-timeframe trend (e.g., only allowing longs in a bull market).
 Visual Plots: The strategy plots the Fast EMA, Slow EMA, and VWAP on the chart for easy visualization of the setup. It also plots up/down arrows to mark where valid buy and sell signals occurred.
 Dynamic SL/TP Line Plotting: A standout feature is that the strategy automatically draws the exact Stop Loss and Take Profit price lines on the chart for every active trade. These lines appear when a trade is entered and disappear as soon as it is closed, providing a clear visual of your risk and reward targets.
 Alerts: The script includes built-in alertcondition calls. This allows you to create alerts in TradingView that can notify you on your phone or execute trades automatically via a webhook when a long or short signal is generated.
Currency Weekend - shading weekend trading// ─────────────────────────────────────────────────────────────────────────────
// © 2025, Steve / Steven Anthony – "Currency Weekend"
// This script highlights the low-liquidity weekend window that often affects 
// both fiat currency markets and cryptocurrencies like Bitcoin. 
//
// ╭─────────────────────────────── DESCRIPTION ───────────────────────────────╮
// | This indicator shades a customizable time window on your chart,           |
// | originally set to highlight the **forex weekend lull** from               |
// | **Friday 21:00 UTC to Sunday 21:00 UTC**, when traditional fiat           |
// | currency markets close.                                                  |
// |                                                                          |
// | Traders who observe Bitcoin, Ethereum, or other crypto assets may        |
// | notice reduced liquidity or increased erratic moves during this time,    |
// | due to overlapping behaviors from professional forex traders who         |
// | trade both markets.                                                      |
// ╰──────────────────────────────────────────────────────────────────────────╯
//
// 🔧 Flexible Configuration:
// - Define your own start and end **day + time** for shading
// - Useful for shading other custom quiet periods or session transitions
//
// 💡 Use Cases:
// - Avoid trading during low-liquidity periods
// - Spot potential weekend traps or price gaps
// - Align crypto behavior with fiat market hours
//
// 📍 Default Settings:
// - Start: Friday 21:00 UTC
// - End:   Sunday 21:00 UTC
//
// Timezone is normalized to the chart’s timezone for seamless integration.
//
// ─────────────────────────────────────────────────────────────────────────────
Advanced Forex Currency Strength Meter 
# Advanced Forex Currency Strength Meter
 🚀 The Ultimate Currency Strength Analysis Tool for Forex Traders 
This sophisticated indicator measures and compares the relative strength of major currencies (EUR, GBP, USD, JPY, CHF, CAD, AUD, NZD) to help you identify the strongest and weakest currencies in real-time, providing clear trading signals based on currency strength differentials.
##  📊 What This Indicator Does 
The Advanced Forex Currency Strength Meter analyzes currency relationships across 28+ major forex pairs and 8 currency indices to determine which currencies are gaining or losing strength. Instead of relying on individual pair analysis, this tool gives you a  bird's-eye view  of the entire forex market, helping you:
 
 Identify the strongest and weakest currencies at any given time
 Find high-probability trading opportunities by pairing strong vs weak currencies
 Avoid ranging markets by detecting when currencies have similar strength
 Get clear LONG/SHORT/NEUTRAL signals for your current trading pair
 Optimize your trading strategy based on your preferred timeframe and holding period
 
##  ⚙️ How The Indicator Works 
###  Dual Calculation Method 
The indicator uses a sophisticated dual approach for maximum accuracy:
 
 Pairs-Based Analysis:  Calculates currency strength from 28+ major forex pairs (EURUSD, GBPUSD, USDJPY, etc.)
 Index-Based Analysis:  Incorporates official currency indices (DXY, EXY, BXY, JXY, CXY, AXY, SXY, ZXY)
 Weighted Combination:  Blends both methods using smart weighting for enhanced accuracy
 
###  Smart Auto-Optimization System 
The indicator automatically adjusts its parameters based on your chart timeframe and intended holding period:
 The system recognizes that scalping requires different sensitivity than swing trading, automatically optimizing lookback periods, analysis timeframes, signal thresholds, and index weights. 
###  Strength Calculation Process 
 
 Fetches price data from multiple timeframes using optimized tuple requests
 Calculates percentage change over the specified lookback period
 Optionally normalizes by ATR (Average True Range) to account for volatility differences
 Combines pair-based and index-based calculations using dynamic weighting
 Generates relative strength by comparing base currency vs quote currency
 Produces clear trading signals when strength differential exceeds threshold
 
##  🎯 How To Use The Indicator 
###  Quick Start 
 
 Add the indicator to any forex pair chart
 Enable  🧠 Smart Auto-Optimization  (recommended for beginners)
 Watch for LONG 🚀 signals when the relative strength line is green and above threshold
 Watch for SHORT 🐻 signals when the relative strength line is red and below threshold
 Avoid trading during NEUTRAL ⚪ periods when currencies have similar strength
 
 Note:  This is highly recommended to couple this indicator with fundamental analysis and use it as an extra signal.
###  📋 Parameters Reference 
####  🤖 Smart Settings 
 
 🧠 Smart Auto-Optimization:   (Default: Enabled)  Automatically optimizes all parameters based on chart timeframe and trading style
 
####  ⚙️ Manual Override 
 These settings are only active when Smart Auto-Optimization is disabled: 
 
 Manual Lookback Period:   (Default: 14)  Number of periods to analyze for strength calculation
 Manual ATR Period:   (Default: 14)  Period for ATR normalization calculation
 Manual Analysis Timeframe:   (Default: 240)  Higher timeframe for strength analysis
 Manual Index Weight:   (Default: 0.5)  Weight given to currency indices vs pairs (0.0 = pairs only, 1.0 = indices only)
 Manual Signal Threshold:   (Default: 0.5)  Minimum strength differential required for trading signals
 
####  📊 Display 
 
 Show Signal Markers:   (Default: Enabled)  Display triangle markers when signals change
 Show Info Label:   (Default: Enabled)  Show comprehensive information label with current analysis
 
####  🔍 Analysis 
 
 Use ATR Normalization:   (Default: Enabled)  Normalize strength calculations by volatility for fairer comparison
 
####  💰 Currency Indices 
 
 💰 Use Currency Indices:   (Default: Enabled)  Include all 8 currency indices in strength calculation for enhanced accuracy
 
####  🎨 Colors 
 
 Strong Currency Color:   (Default: Green)  Color for positive/strong signals
 Weak Currency Color:   (Default: Red)  Color for negative/weak signals  
 Neutral Color:   (Default: Gray)  Color for neutral conditions
 Strong/Weak Backgrounds:  Background colors for clear signal visualization
 
###  🧠 Smart Optimization Profiles 
The indicator automatically selects optimal parameters based on your chart timeframe:
####  ⚡ Scalping Profile (1M-5M Charts) 
 For positions held for a few minutes: 
 
 Lookback: 5 periods (fast/sensitive)
 Analysis Timeframe: 15 minutes
 Index Weight: 20% (favor pairs for speed)
 Signal Threshold: 0.3% (sensitive triggers)
 
####  📈 Intraday Profile (10M-1H Charts)  
 For positions held for a few hours: 
 
 Lookback: 12 periods (balanced sensitivity)
 Analysis Timeframe: 4 hours
 Index Weight: 40% (balanced approach)
 Signal Threshold: 0.4% (moderate sensitivity)
 
####  📊 Swing Profile (4H-Daily Charts) 
 For positions held for a few days: 
 
 Lookback: 21 periods (stable analysis)
 Analysis Timeframe: Daily
 Index Weight: 60% (favor indices for stability)
 Signal Threshold: 0.5% (conservative triggers)
 
####  📆 Position Profile (Weekly+ Charts) 
 For positions held for a few weeks: 
 
 Lookback: 30 periods (long-term view)
 Analysis Timeframe: Weekly
 Index Weight: 70% (heavily favor indices)
 Signal Threshold: 0.6% (very conservative)
 
###  Entry Timing 
 
 Wait for clear LONG 🚀 or SHORT 🐻 signals
 Avoid trading during NEUTRAL ⚪ periods
 Look for signal confirmations on multiple timeframes
 
###  Risk Management 
 
 Stronger signals (higher relative strength values) suggest higher probability trades
 Use appropriate position sizing based on signal strength
 Consider the trading style profile when setting stop losses and take profits
 
 💡 Pro Tip:  The indicator works best when combined with your existing technical analysis. Use currency strength to identify  which  pairs to trade, then use your favorite technical indicators to determine  when  to enter and exit. 
##  🔧 Key Features 
 
 28+ Forex Pairs Analysis:  Comprehensive coverage of major currency relationships
 8 Currency Indices Integration:  DXY, EXY, BXY, JXY, CXY, AXY, SXY, ZXY for enhanced accuracy
 Smart Auto-Optimization:  Automatically adapts to your trading style and timeframe
 ATR Normalization:  Fair comparison across different currency pairs and volatility levels
 Real-Time Signals:  Clear LONG/SHORT/NEUTRAL signals with visual markers
 Performance Optimized:  Efficient tuple-based data requests minimize external calls
 User-Friendly Interface:  Simplified settings with comprehensive tooltips
 Multi-Timeframe Support:  Works on any timeframe from 1-minute to monthly charts
 
 Transform your forex trading with the power of currency strength analysis! 🚀
Titan Wick Zone IndicatorThe  Titan Wick Zone Indicator  visually highlights the upper and lower wick regions of each candlestick on your chart, helping traders instantly identify areas where price was aggressively rejected (top wick) or absorbed (bottom wick). The indicator fills the area above the candle body to the wick high in red (sell zone), and the area below the candle body to the wick low in green (buy zone), both with adjustable opacity for clear visibility.
 How to Use: 
Spot Rejection and Absorption:
The red-filled upper wick zone marks where upward price moves were sharply rejected by sellers, often indicating supply, resistance, or “stop hunt” zones.
The green-filled lower wick zone marks where downward price moves were absorbed by buyers, pointing to potential demand, support, or accumulation zones.
 Enhance Price Action Analysis:
 
Use these zones to avoid entering trades at price extremes, spot potential reversals, and find areas of confluence with support/resistance, Fibonacci levels, or order blocks.
 Risk Management:
 
The indicator helps visualize where liquidity hunts or false breakouts may occur, so you can better place stop losses outside of volatile wick zones.
 Ideal For:
 Price action traders, scalpers, and swing traders seeking a visual edge in spotting supply/demand dynamics, liquidity zones, and wick-driven traps.
🏆 UNMITIGATED LEVELS ACCUMULATIONPDH TO ATH RISK FREE
All the PDL have a buy limit which starts at 0.1 lots which will duplicate at the same time the capital incresases. All of the buy limits have TP in ATH for max reward.
Зміщена MA з урахуванням волатильності (ATR) Long,ShortThis indicator displays a moving average (MA) line adjusted with volatility (ATR) to define dynamic long and short entry zones.
Trend Strength Index [Alpha Extract]The Trend Strength Index leverages Volume Weighted Moving Average (VWMA) and Average True Range (ATR) to quantify trend intensity in cryptocurrency markets, particularly Bitcoin. The combination of VWMA and ATR is particularly powerful because VWMA provides a more accurate representation of the market's true average price by weighting periods of higher trading volume more heavily—capturing genuine momentum driven by increased participation rather than treating all price action equally, which is crucial in volatile assets like Bitcoin where volume spikes often signal institutional interest or market shifts. 
Meanwhile, ATR normalizes this measurement for volatility, ensuring that trend strength readings remain comparable across different market conditions; without ATR's adjustment, raw price deviations from the mean could appear artificially inflated during high-volatility periods (like during news events or liquidations) or understated in low-volatility sideways markets, leading to misleading signals. Together, they create a volatility-adjusted, volume-sensitive metric that reliably distinguishes between meaningful trend developments and noise. 
This indicator measures the normalized distance between price and its volume-weighted mean, providing a clear visualization of trend strength while accounting for market volatility. It helps traders identify periods of strong directional movement versus consolidation, with color-coded gradients for intuitive interpretation.
🔶 CALCULATION 
The indicator processes price data through these analytical stages:
 
 Volume Weighted Moving Average: Computes a smoothed average weighted by trading volume
 Volatility Normalization: Uses ATR to account for market volatility
 Distance Measurement: Calculates absolute deviation between current price and VWMA
 Strength Normalization: Divides price deviation by ATR for a volatility-adjusted metric
Formula:
 VWMA = Volume-Weighted Moving Average of Close over specified length
 ATR = Average True Range over specified length
 Price Distance = |Close - VWMA|
 Trend Strength = Price Distance / ATR
 
🔶 DETAILS Visual Features:
 
 VWMA Line: Blue line overlay on the price chart representing the volume-weighted mean
 Trend Strength Area: Histogram-style area plot with dynamic color gradient (red for weak trends, transitioning through orange and yellow to green for strong trends)
 Threshold Line: Horizontal red line at the customizable Trend Enter level
 Background Highlight: Subtle green background when trend strength exceeds the enter threshold for strong trend visualization
 Alert System: Triggers notifications for strong trend detection
 
Interpretation:
 
 0-Weak (Red): Minimal trend strength, potential consolidation or ranging market
 Mid-Range (Orange/Yellow): Building momentum, watch for breakout potential
 At/Above Enter Threshold (Green): Strong trend conditions, potential for continued directional moves
 Threshold Crossing: Trend strength crossing above the enter level signals increasing conviction in the current direction
 Color Transitions: Gradual shifts from warm (red/orange) to cool (green) tones indicate strengthening trends
 
🔶 EXAMPLES
 
 Strong Trend Entry: When trend strength crosses above the enter threshold (e.g., 1.2), it identifies the onset of a powerful move where price deviates significantly from the mean.
 Example: During a rally, trend strength rising from yellow (around 1.0) to green (1.2+) often precedes sustained upward momentum, providing entry opportunities for trend followers.
 Consolidation Detection: Low trend strength values in red shades (below 0.5) highlight periods of low volatility and mean reversion potential.
 Example: After a sharp sell-off, persistent red values signal a likely sideways phase, allowing traders to avoid whipsaws and wait for orange/yellow transitions as a precursor to recovery.
 Volatility-Adjusted Pullbacks: In volatile markets, the ATR component ensures trend strength remains accurate; a dip back to yellow from green during minor corrections can indicate healthy pullbacks within a strong trend.
 
Example: Trend strength briefly falling to yellow levels (e.g., 0.8-1.1) after hitting green provides profit-taking signals without invalidating the overall bullish bias if the VWMA holds as support.
Threshold Alert Integration: The alert condition combines strength value with the enter threshold for timely notifications.
Example: Receiving a "Strong Trend Detected" alert when the area plot turns green helps confirm Bitcoin's breakout from consolidation, aligning with increased volume for higher-probability trades.
🔶 SETTINGS
Customization Options:
 
 Lengths: VWMA length (default 14), ATR length (default 14)
 Thresholds: Trend enter (default 1.2, step 0.1), trend exit (default 1.15, for potential future signal enhancements)
 Visuals: Automatic color scaling with red at 0, transitioning to green at/above enter threshold
 Alert Conditions: Strong trend detection (when strength > enter)
 
The Trend Strength Index equips traders with a robust, easy-to-interpret tool for gauging trend intensity in volatile markets like Bitcoin. By normalizing price deviations against volatility, it delivers reliable signals for identifying high-momentum opportunities while the gradient coloring and alerts facilitate quick assessments in both trending and choppy conditions.
Neural Network Buy and Sell SignalsTrend Architect Suite Lite - Neural Network Buy and Sell Signals 
 Advanced AI-Powered Signal Scoring 
This indicator provides neural network market analysis on buy and sell signals designed for scalpers and day traders who use 30s to 5m charts. Signals are generated based on an ATR system and then filtered and scored using an advanced AI-driven system.
 Features 
 Neural Network Signal Engine 
 
 5-Layer Deep Learning analysis combining market structure, momentum, and market state detection
 AI-based Letter Grade Scoring (A+ through F) for instant signal quality assessment
 Normalized Input Processing with Z-score standardization and outlier clipping
 Real-time Signal Evaluation using 5 market dimensions
 
 Advanced Candle Types 
 
 Standard Candlesticks - Raw price action
 Heikin Ashi - Trend smoothing and noise reduction  
 Linear Regression - Mathematical trend visualization
 Independent Signal vs Display - Calculate signals on one type, display another
 
 Key Settings 
 Signal Configuration 
- Signal Trigger Sensitivity (Default: 1.7) - Controls signal frequency vs quality
- Stop Loss ATR Multiplier (Default: 1.5) - Risk management sizing
- Signal Candle Type (Default: Candlesticks) - Data source for signal calculations
- Display Candle Type (Default: Linear Regression) - Visual candle display
 Display Options 
- Signal Distance (Default: 1.35 ATR) - Label positioning from price
- Label Size (Default: Medium) - Optimal readability
 Trading Applications 
Scalping 
- Fast pace signal detection with quality filtering
- ATR-based stop management prevents signal overlap
- Neural network attempts to reduces false signals in choppy markets
Day Trading
- Multi-timeframe compatible with adaptation settings
- Clear trend visualization with Linear Regression candles
- Support/resistance integration for better entries/exits
Signal Filtering
- Use A+/A grades for highest probability setups
- B grades for confirmation in trending markets
- C-F grades help identify market uncertainty
 Why Choose Trend Architect Lite? 
 
 No Lag - Real-time neural network processing  
 No Repainting - Signals appear and stay fixed  
 Clean Charts - Focus on price action, not indicators  
 Smart Filtering - AI reduces noise and false signals  
 Flexible and customizable - Works across all timeframes and instruments  
 
Compatibility
- All Timeframes - 1m to Monthly charts
- All Instruments - Forex, Crypto, Stocks, Futures, Indices
Risk Disclaimer
This indicator is a tool for technical analysis and should not be used as the sole basis for trading decisions. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
BERLIN-MAX 1V.5BERLIN-MAX 1V.5 is a comprehensive trading indicator designed for TradingView that combines multiple advanced strategies and tools. It integrates EMA crossover signals, UT Bot logic with ATR-based trailing stops, customizable stop-loss and target multipliers per timeframe, Hull Moving Averages with color-coded trends, linear regression channels for support and resistance, and a multi-timeframe RSI and volume signal table. This script aims to provide clear entry and exit signals for scalping and swing trading, enhancing decision-making across different market conditions.
Time-Price Velocity [QuantAlgo]🟢 Overview 
The  Time-Price Velocity  indicator uses advanced velocity-based analysis to measure the rate of price change normalized against typical market movement, creating a dynamic momentum oscillator that identifies market acceleration patterns and momentum shifts. Unlike traditional momentum indicators that focus solely on price change magnitude, this indicator incorporates time-weighted displacement calculations and ATR normalization to create a sophisticated velocity measurement system that adapts to varying market volatility conditions.
  
This indicator displays a velocity signal line that oscillates around zero, with positive values indicating upward price velocity and negative values indicating downward price velocity. The signal incorporates acceleration background columns and statistical normalization to help traders identify momentum shifts and potential reversal or continuation opportunities across different timeframes and asset classes.
 🟢 How It Works 
The indicator's key insight lies in its time-price velocity calculation system, where velocity is measured using the fundamental physics formula:
 velocity = priceChange / timeWeight 
The system normalizes this raw velocity against typical price movement using Average True Range (ATR) to create market-adjusted readings:
 normalizedVelocity = typicalMove > 0 ? velocity / typicalMove : 0 
where "typicalMove = ta.atr(lookback)" provides the baseline for normal price movement over the specified lookback period.
The Time-Price Velocity indicator calculation combines multiple sophisticated components. First, it calculates acceleration as the change in velocity over time:
 acceleration = normalizedVelocity - normalizedVelocity 
Then, the signal generation applies EMA smoothing to reduce noise while preserving responsiveness:
 signal = ta.ema(normalizedVelocity, smooth) 
This creates a velocity-based momentum indicator that combines price displacement analysis with statistical normalization, providing traders with both directional signals and acceleration insights for enhanced market timing.
 🟢 How to Use 
 1. Signal Interpretation and Threshold Zones 
 Positive Values (Above Zero):  Time-price velocity indicating bullish momentum with upward price displacement relative to normalized baseline
 Negative Values (Below Zero):  Time-price velocity indicating bearish momentum with downward price displacement relative to normalized baseline
  
 Zero Line Crosses:  Velocity transitions between bullish and bearish regimes, indicating potential trend changes or momentum shifts
 Upper Threshold Zone:  Area above positive threshold (default 1.0) indicating strong bullish velocity and potential reversal point
 Lower Threshold Zone:  Area below negative threshold (default -1.0) indicating strong bearish velocity and potential reversal point
 
 2. Acceleration Analysis and Visual Features 
 
 Acceleration Columns:  Background histogram showing velocity acceleration (the rate of change of velocity), with green columns indicating accelerating velocity and red columns indicating decelerating velocity. The interpretation depends on trend context: red columns in downtrends indicate strengthening bearish momentum, while red columns in uptrends indicate weakening bullish momentum
  
 Acceleration Column Height:  The height of each column represents the magnitude of acceleration, with taller columns indicating stronger acceleration or deceleration forces
 Bar Coloring:  Optional price bar coloring matches velocity direction for immediate visual trend confirmation
 Info Table:  Real-time display of current velocity and acceleration values with trend arrows and change indicators
 
 3. Additional Features: 
 
 Confirmed vs Live Data:  Toggle between confirmed (closed) bar analysis for stable signals or current bar inclusion for real-time updates
 Multi-timeframe Adaptability:  Velocity normalization ensures consistent readings across different chart timeframes and asset volatilities
 Alert System:  Built-in alerts for threshold crossovers and direction changes
 
 🟢 Examples with Preconfigured Settings 
 
 Default : Balanced configuration suitable for most timeframes and general trading applications, providing optimal balance between sensitivity and noise filtering for medium-term analysis.
  
 Scalping : High sensitivity setup with shorter lookback period and reduced smoothing for ultra-short-term trades on 1-15 minute charts, optimized for capturing rapid momentum shifts and frequent trading opportunities.
  
 Swing Trading : Extended lookback period with enhanced smoothing and higher threshold for multi-day positions, designed to filter market noise while capturing significant momentum moves on 1-4 hour and daily timeframes.
  
ATR Squeeze BackgroundThis simple but powerful indicator shades the background of your chart whenever volatility contracts, based on a custom comparison of fast and slow ATR (Average True Range) periods.
By visualizing low-volatility zones, you can:
* Identify moments of compression that may precede explosive price moves
* Stay out of choppy, low-momentum periods
* Adapt this as a component in a broader volatility or breakout strategy
🔧 How It Works
* A Fast ATR (default: 7 periods) and a Slow ATR (default: 40 periods) are calculated
* When the Fast ATR is lower than the Slow ATR, the background is shaded in blue
* This shading signals a contraction in volatility — a condition often seen before breakouts or strong directional moves
⚡️ Why This Matters
Many experienced traders pay close attention to volatility cycles. This background indicator helps visualize those cycles at a glance. It's minimal, non-intrusive, and easy to combine with your existing tools.
🙏 Credits
This script borrows core logic from the excellent “Relative Volume at Time” script by TradingView. Credit is given with appreciation.
⚠️ Disclaimer
This script is for educational purposes only.
It does not constitute financial advice, and past performance is not indicative of future results. Always do your own research and test strategies before making trading decisions.
Market Energy – Trend vs RetestShows who is in control of the market. The red lines are sellers in control and the green are the buyers in control
Advanced Supertrend StrategyA comprehensive Pine Script v5 strategy featuring an enhanced Supertrend indicator with multiple technical filters, risk management, and advanced signal confirmation for automated trading on TradingView.
## Features
- **Enhanced Supertrend**: Configurable ATR-based trend following with improved accuracy
- **RSI Filter**: Optional RSI-based signal filtering to avoid overbought/oversold conditions
- **Moving Average Filter**: Trend confirmation using SMA/EMA/WMA with customizable periods
- **Risk Management**: Built-in stop-loss and take-profit based on ATR multiples
- **Trend Strength Analysis**: Filters weak signals by requiring minimum trend duration
- **Breakout Confirmation**: Optional price breakout validation for stronger signals
- **Visual Interface**: Comprehensive chart plotting with multiple indicator overlays
- **Advanced Alerts**: Multiple alert conditions with detailed signal information
- **Backtesting**: Full strategy backtesting with commission and realistic execution
Auto AVWAP (Anchored-VWAP) with Breakout ScreenerAuto AVWAP (Anchored-VWAP) with Breakout Screener. fINAL VERSION
Opening Range Breakout (08:00 - 08:15 NY) - AAPNIndicador que marca la apertura de Forex en NY a 15 minitos, la primera vela
Pre-Market & Previous Day Levels 300here is the indicator pre market high low and prev day hihg low levels






















