ADX for BTC [PineIndicators]The ADX Strategy for BTC is a trend-following system that uses the Average Directional Index (ADX) to determine market strength and momentum shifts. Designed for Bitcoin trading, this strategy applies a customizable ADX threshold to confirm trend signals and optionally filters entries using a Simple Moving Average (SMA). The system features automated entry and exit conditions, dynamic trade visualization, and built-in trade tracking for historical performance analysis.
⚙️ Core Strategy Components
1️⃣ Average Directional Index (ADX) Calculation
The ADX indicator measures trend strength without indicating direction. It is derived from the Positive Directional Movement (+DI) and Negative Directional Movement (-DI):
+DI (Positive Directional Index): Measures upward price movement.
-DI (Negative Directional Index): Measures downward price movement.
ADX Value: Higher values indicate stronger trends, regardless of direction.
This strategy uses a default ADX length of 14 to smooth out short-term fluctuations while detecting sustainable trends.
2️⃣ SMA Filter (Optional Trend Confirmation)
The strategy includes a 200-period SMA filter to validate trend direction before entering trades. If enabled:
✅ Long Entry is only allowed when price is above a long-term SMA multiplier (5x the standard SMA length).
✅ If disabled, the strategy only considers the ADX crossover threshold for trade entries.
This filter helps reduce entries in sideways or weak-trend conditions, improving signal reliability.
📌 Trade Logic & Conditions
🔹 Long Entry Conditions
A buy signal is triggered when:
✅ ADX crosses above the threshold (default = 14), indicating a strengthening trend.
✅ (If SMA filter is enabled) Price is above the long-term SMA multiplier.
🔻 Exit Conditions
A position is closed when:
✅ ADX crosses below the stop threshold (default = 45), signaling trend weakening.
By adjusting the entry and exit ADX levels, traders can fine-tune sensitivity to trend changes.
📏 Trade Visualization & Tracking
Trade Markers
"Buy" label (▲) appears when a long position is opened.
"Close" label (▼) appears when a position is exited.
Trade History Boxes
Green if a trade is profitable.
Red if a trade closes at a loss.
Trend Tracking Lines
Horizontal lines mark entry and exit prices.
A filled trade box visually represents trade duration and profitability.
These elements provide clear visual insights into trade execution and performance.
⚡ How to Use This Strategy
1️⃣ Apply the script to a BTC chart in TradingView.
2️⃣ Adjust ADX entry/exit levels based on trend sensitivity.
3️⃣ Enable or disable the SMA filter for trend confirmation.
4️⃣ Backtest performance to analyze historical trade execution.
5️⃣ Monitor trade markers and history boxes for real-time trend insights.
This strategy is designed for trend traders looking to capture high-momentum market conditions while filtering out weak trends.
Pineindicators
MACD Volume Strategy for XAUUSD (15m) [PineIndicators]The MACD Volume Strategy is a momentum-based trading system designed for XAUUSD on the 15-minute timeframe. It integrates two key market indicators: the Moving Average Convergence Divergence (MACD) and a volume-based oscillator to identify strong trend shifts and confirm trade opportunities. This strategy uses dynamic position sizing, incorporates leverage customization, and applies structured entry and exit conditions to improve risk management.
⚙️ Core Strategy Components
1️⃣ Volume-Based Momentum Calculation
The strategy includes a custom volume oscillator to filter trade signals based on market activity. The oscillator is derived from the difference between short-term and long-term volume trends using Exponential Moving Averages (EMAs)
Short EMA (default = 5) represents recent volume activity.
Long EMA (default = 8) captures broader volume trends.
Positive values indicate rising volume, supporting momentum-based trades.
Negative values suggest weak market activity, reducing signal reliability.
By requiring positive oscillator values, the strategy ensures momentum confirmation before entering trades.
2️⃣ MACD Trend Confirmation
The strategy uses the MACD indicator as a trend filter. The MACD is calculated as:
Fast EMA (16-period) detects short-term price trends.
Slow EMA (26-period) smooths out price fluctuations to define the overall trend.
Signal Line (9-period EMA) helps identify crossovers, signaling potential trend shifts.
Histogram (MACD – Signal) visualizes trend strength.
The system generates trade signals based on MACD crossovers around the zero line, confirming bullish or bearish trend shifts.
📌 Trade Logic & Conditions
🔹 Long Entry Conditions
A buy signal is triggered when all the following conditions are met:
✅ MACD crosses above 0, signaling bullish momentum.
✅ Volume oscillator is positive, confirming increased trading activity.
✅ Current volume is at least 50% of the previous candle’s volume, ensuring market participation.
🔻 Short Entry Conditions
A sell signal is generated when:
✅ MACD crosses below 0, indicating bearish momentum.
✅ Volume oscillator is positive, ensuring market activity is sufficient.
✅ Current volume is less than 50% of the previous candle’s volume, showing decreasing participation.
This multi-factor approach filters out weak or false signals, ensuring that trades align with both momentum and volume dynamics.
📏 Position Sizing & Leverage
Dynamic Position Calculation:
Qty = strategy.equity × leverage / close price
Leverage: Customizable (default = 1x), allowing traders to adjust risk exposure.
Adaptive Sizing: The strategy scales position sizes based on account equity and market price.
Slippage & Commission: Built-in slippage (2 points) and commission (0.01%) settings provide realistic backtesting results.
This ensures efficient capital allocation, preventing overexposure in volatile conditions.
🎯 Trade Management & Exits
Take Profit & Stop Loss Mechanism
Each position includes predefined profit and loss targets:
Take Profit: +10% of risk amount.
Stop Loss: Fixed at 10,100 points.
The risk-reward ratio remains balanced, aiming for controlled drawdowns while maximizing trade potential.
Visual Trade Tracking
To improve trade analysis, the strategy includes:
📌 Trade Markers:
"Buy" label when a long position opens.
"Close" label when a position exits.
📌 Trade History Boxes:
Green for profitable trades.
Red for losing trades.
📌 Horizontal Trade Lines:
Shows entry and exit prices.
Helps identify trend movements over multiple trades.
This structured visualization allows traders to analyze past performance directly on the chart.
⚡ How to Use This Strategy
1️⃣ Apply the script to a XAUUSD (Gold) 15m chart in TradingView.
2️⃣ Adjust leverage settings as needed.
3️⃣ Enable backtesting to assess past performance.
4️⃣ Monitor volume and MACD conditions to understand trade triggers.
5️⃣ Use the visual trade markers to review historical performance.
The MACD Volume Strategy is designed for short-term trading, aiming to capture momentum-driven opportunities while filtering out weak signals using volume confirmation.
Balance of Power for US30 4H [PineIndicators]The Balance of Power (BoP) Strategy is a momentum-based trading system for the US30 index on a 4-hour timeframe. It measures the strength of buyers versus sellers in each candle using the Balance of Power (BoP) indicator and executes trades based on predefined threshold crossovers. The strategy includes dynamic position sizing, adjustable leverage, and visual trade tracking.
⚙️ Core Strategy Mechanics
Positive values indicate buying strength.
Negative values indicate selling strength.
Values close to 1 suggest strong bullish momentum.
Values close to -1 indicate strong bearish pressure.
The strategy uses fixed threshold crossovers to determine trade entries and exits.
📌 Trade Logic
Entry Conditions
Long Entry: When BoP crosses above 0.8, signaling strong buying pressure.
Exit Conditions
Position Close: When BoP crosses below -0.8, indicating a shift to selling pressure.
This threshold-based system filters out low-confidence signals and focuses on high-momentum shifts.
📏 Position Sizing & Leverage
Leverage: Adjustable by the user (default = 5x).
Risk Management: Position size adapts dynamically based on equity fluctuations.
📊 Trade Visualization & History Tracking
Trade Markers:
"Buy" labels appear when a long position is opened.
"Close" labels appear when a position is exited.
Trade History Boxes:
Green for profitable trades.
Red for losing trades.
These elements provide clear visual tracking of past trade execution.
⚡ Usage & Customization
1️⃣ Apply the script to a US30 4H chart in TradingView.
2️⃣ Adjust leverage settings as needed.
3️⃣ Review trade signals and historical performance with visual markers.
4️⃣ Enable backtesting to evaluate past performance.
This strategy is designed for momentum-based trading and is best suited for volatile market conditions.