USD VolumeSimple USD volume indicator designed to visualize trading volume in USD terms rather than raw share/contract volume. It's particularly useful for comparing liquidity across assets with different price levels, as it shows the approximate dollar value traded per bar (e.g., candle). The indicator appears in a separate pane below the main chart (non-overlay) and uses a volume-formatted scale for readability.
指标和策略
Torus Trend Bands — Windowed HammingTorus Trend Bands — Windowed Hamming
This TradingView indicator creates dynamic support and resistance bands on your chart. It uses the mathematical model of a torus (a donut shape) to generate cyclical and responsive channel boundaries. The bands are further refined with an advanced smoothing method called a Hamming window to reduce noise and provide a clearer signal.
How It Works
The Torus Model: The indicator maps price action onto a geometric torus shape. This is defined by two key parameters:
Major Radius (a): The distance from the center of the torus to the center of the tube. This controls the overall size and primary cycle.
Minor Radius (b): The radius of the tube itself. This controls the secondary, faster "breathing" motion of the bands.
Dual-Phase Engine: The behavior of the bands is driven by two different cyclical inputs, or "phases":
Major Rotation (φ): A slow, time-based cycle (φ period) that governs the long-term oscillation of the bands.
Minor Rotation (q): A fast, momentum-based cycle derived from the Relative Strength Index (RSI). This makes the bands react quickly to price momentum, expanding and contracting as the market becomes overbought or oversold.
Standard Technical Core : The torus model is anchored to the price chart using standard indicators:
Midline : A central moving average that acts as the baseline for the channel. You can choose from EMA, SMA, HMA, or VWAP.
Width Source: A volatility measure that determines the fundamental width of the bands. You can choose between the Average True Range (ATR) or Standard Deviation.
Hamming Window Smoothing: This is a sophisticated weighted averaging technique (a Finite Impulse Response filter) used in digital signal processing. It provides exceptionally smooth results with less lag than traditional moving averages. You can apply this smoothing to the RSI, the midline, and the width source independently to filter out market noise.
How to Interpret and Use the Indicator
Dynamic Support & Resistance: The primary use is to identify potential reversal or continuation points. The upper band acts as dynamic resistance, and the lower band acts as dynamic support.
Trend Identification: The color of the bands helps you quickly see the current trend. Teal bands indicate an uptrend (the midline is rising), while red bands indicate a downtrend (the midline is falling).
Volatility Gauge: When the bands widen, it signals an increase in market volatility. When they contract, it suggests volatility is decreasing.
Alerts: The indicator includes built-in alerts that can notify you when the price touches or breaks through the upper or lower bands, helping you stay on top of key price action.
Key Settings
Torus Parameters : Adjust Major radius a and Minor radius b to change the shape and cyclical behavior of the bands.
Phase Controls:
φ period: Controls the length of the main, slow cycle in bars.
RSI length → q: Sets the lookback for the RSI that drives the momentum-based cycle.
Midline & Width: Choose the type and length for the central moving average and the volatility source (ATR/StDev) that best fits your trading style.
Width & Bias Shaping:
Min/Max width ×: Control how much the bands expand and contract.
Bias ×: Shifts the entire channel up or down based on RSI momentum, helping the bands better capture strong trends.
Hamming Controls: Enable or disable the advanced smoothing on different parts of the indicator and set the Hamming length (a longer length results in more smoothing).
This indicator provides a unique and highly customizable way to visualize market cycles, volatility, and trend, combining geometry with proven technical analysis tools.
Fair Value GapThe indicator plots a rectangle when a Fair Value Gap is set.
Green rectangle = Long FVG
Red rectangle = Short FVG
TFX Multi EMA Indicator (5, 10, 20, 50, 100, 200)5, 10, 20, 50, 100, 200 EMA
This indicator will be used to see the averages up to 5 candles, 10 candles, 20 candles, 50 candles, 100 candles, and 200 candles, enjoy!
High-Low-Avg Plot (1D)This script aims to plot the High, Low, Average (of High+Low+Close) for past 14 days of an index/a stock to provide certain levels in trading
[PDR] Daily Rebalance█ OVERVIEW
This indicator is a powerful portfolio backtesting tool designed to simulate the performance of a static-weight, daily rebalancing strategy. It allows you to define a portfolio of up to 10 assets, set their target weights, and track its cumulative return against a user-defined benchmark and a risk-free rate.
The core of the script is its daily rebalancing logic, which calculates and logs every trade needed to bring the portfolio back to its target allocations at the close of each day. This provides a transparent and detailed view of how a static portfolio would have performed historically, including the impact of trading costs.
█ KEY FEATURES
Daily Rebalancing: Simulates a portfolio that is rebalanced at the close of every day to maintain target asset allocations.
Customizable Portfolio: Configure up to 10 different assets with specific weights. If all weights are left at 0, the script automatically creates an equal-weight portfolio from the selected assets.
Performance Comparison: Plots the portfolio's equity curve against a user-defined benchmark (e.g., SET:SET50 ) and a risk-free return, allowing for easy relative performance analysis.
Realistic Simulation: Accounts for trading costs like broker commission and minimum lot sizes for more accurate and grounded backtesting results.
Detailed Performance Metrics: An on-chart table displays real-time statistics, including Current Drawdown, Max Drawdown, and Total Return for both your portfolio and the benchmark.
Trade-by-Trade Logs: For full transparency, every rebalancing trade (BUY/SELL), including shares, price, notional value, and fees, is logged in the Pine Logs panel.
█ HOW TO USE
**Apply to a Daily Chart:** This script is designed to work exclusively on the daily ( 1D ) timeframe. Applying it to any other timeframe will result in a runtime error.
**Configure Settings:** Open the indicator's settings. Set your `Initial Capital`, `Start Time`, and the `Benchmark` symbol you wish to compare against.
**Define Your Assets:** In the 'Assets' group, check the box to enable each asset you want to include, select the symbol, and define its target `Weight (%)`.
**Set Trading Costs:** Adjust the `Broker Commission (%)` and `Minimal Buyable Lot` to match your expected trading conditions.
**Analyze the Results:** The performance curves are plotted in the indicator pane below your main chart. The key metrics table is displayed on the bottom-right of your chart.
**View Rebalancing Trades:** This is a crucial step for understanding the simulation. To see the detailed daily trades, you **must** open the **Pine Logs**. You can find this panel at the bottom of your TradingView window, next to the "Pine Editor" and "Strategy Tester" tabs. The logs provide a complete breakdown of every rebalancing action.
█ DISCLAIMER
This is a backtesting and simulation tool, not a trading signal generator. Its purpose is for research and performance analysis. Past performance is not indicative of future results. Always conduct your own research before making any investment decisions.
Dual ATR with OffsetGives you a cross when ATR moves unusually, perhaps like would happen at the beginning of a trade.
DAMMU Swing Trading PRODammu Scalping Pro – Short Notes
1️⃣ Purpose:
Scalping and swing trading tool for 15-min and 1-min charts.
Designed for trend continuation, pullbacks, and reversals.
Works well with Heikin Ashi candles (optional).
2️⃣ Core Components:
EMAs:
Fast: EMA5-12
Medium: EMA12-36 Ribbon
Long: EMA75/89 (1-min), EMA180/200 (15-min), EMA540/633
Price Action Channel (PAC): EMA-based High, Low, Close channel.
Fractals: Regular & filtered (BW) fractals for swing recognition.
Higher Highs / Lower Highs / Higher Lows / Lower Lows (HH, LH, HL, LL).
Pivot Points: Optional display with labels.
3️⃣ Bar Coloring:
Blue: Close above PAC
Red: Close below PAC
Gray: Close inside PAC
4️⃣ Alerts:
Swing Buy/Sell arrows based on PAC breakout and EMA200 filter.
Optional “Big Arrows” mode for visibility.
Alert messages: "SWING_UP" and "SWING_DN"
5️⃣ Workflow / Usage Tips:
Set chart to 15-min (for trend) + 1-min (for entry).
Optionally enable Heikin Ashi candles.
Trade long only above EMA200, short only below EMA200.
Watch for pullbacks into EMA channels or ribbons.
Confirm trend resumption via PAC breakout & bar color change.
Use fractals and pivot points to draw trendlines and locate support/resistance.
6️⃣ Optional Filters:
Filter PAC signals with 200 EMA.
Filter fractals for “Pristine/Ideal” patterns (BW filter).
7️⃣ Visuals:
EMA ribbons, PAC fill, HH/LL squares, fractal triangles.
Pivot labels & candle numbering for patterns.
8️⃣ Notes:
No extra indicators needed except optionally SweetSpot Gold2 for major S/R levels.
Suitable for scalping pullbacks with trend confirmation.
If you want, I can make an even shorter “one-screen cheat sheet” with colors, alerts, and EMAs, perfect for real-time chart reference.
Do you want me to do that?
CHAN CRYPTO RS🩷 ATR RS (Crypto / High-based 2.1x, Decimal Safe v2)
This indicator is designed for crypto position sizing and stop calculation using ATR-based risk management. It helps traders automatically determine the stop price, per-unit risk, and optimal position size based on a fixed risk amount in USDT.
🔧 Core Logic
ATR Length (Daily RMA) — calculates the daily Average True Range (ATR) using RMA smoothing.
ATR Multiplier (2.1× default) — defines how far the stop is placed from the daily high.
Stop Price (for Longs) = Daily High − ATR × Multiplier
Per-Unit Risk = (Entry − Stop) × Point Value
Position Size = Risk Amount ÷ Per-Unit Risk
Automatically handles decimal precision for micro-priced crypto assets (e.g., PEPE, SHIB).
Includes safeguards for minimum size and maximum position caps.
💡 Features
Uses Daily ATR without lookahead (no repainting).
Dynamically switches between current and previous ATR for stable results when the daily bar isn’t yet confirmed.
“Snap to tick” ensures stop prices align with the symbol’s tick size.
Table display summarizes ATR, stop price, per-unit risk, total risk, size, and bet amount.
Optional stop label on the chart for visual clarity.
🧮 Output Table
Metric Description
ATR(10) Daily RMA-based ATR
ATR used Chosen ATR (current or previous)
Stop Calculated stop price
Per-unit Risk per coin/unit
Risk Total risk in USDT
Size Optimal position size
Bet Total position value (Entry × Size)
🧠 Ideal For
Crypto traders who use fixed-risk ATR strategies and need precise, decimal-safe position sizing even for ultra-low-priced tokens.
Directional Momentum VisualizerDescription
This script provides a color-coded column visualization of a classic momentum oscillator that measures relative strength and weakness. Instead of a single line, it uses conditional coloring to make directional changes easier to identify at a glance.
The tool is designed for clarity and adaptability, offering both column and line displays, with optional overbought, oversold, and midpoint guides.
How It Works
The script evaluates the oscillator’s value relative to a midpoint and its previous reading.
Depending on whether it’s above or below the midpoint — and whether it’s rising or falling — each column changes color:
Strong upward momentum (above midpoint and rising) → bright green
Fading upward momentum (above midpoint but falling) → pale green
Strong downward momentum (below midpoint and falling) → bright red
Fading downward momentum (below midpoint but rising) → pale red
Unchanged from the previous value → gray
This structure makes momentum shifts instantly visible without relying on line crossings or alerts.
Key Features
Color-coded momentum columns for instant visual interpretation
Adjustable midpoint, overbought, and oversold levels
Optional line overlay for smoother reference
Dynamic background highlighting in extreme zones
Works on any symbol or timeframe
Inputs Overview
Length: Controls the sensitivity of the oscillator calculation.
Source: Selects the price source (Close, HL2, etc.).
Midpoint Level: Defines the central reference level separating bullish and bearish momentum.
Show Line: Toggles visibility of the traditional line overlay.
Overbought / Oversold Levels: Define upper and lower boundaries for potential exhaustion zones.
How to Use
Add the script to your chart from the Indicators tab.
Adjust the midpoint and level settings to fit your preferred configuration.
Observe how column colors shift to reflect strength or weakness in momentum.
Use these transitions as visual context, not as trade signals.
How it Helps
This visual approach offers a clearer perspective on momentum dynamics by replacing the traditional single-line display with color-coded columns. The conditional coloring instantly reveals whether momentum is strengthening or weakening around a chosen midpoint, making trend shifts and fading pressure easier to interpret at a glance. It helps reduce visual noise and allows for quicker, more intuitive analysis of market behavior.
This tool is intended purely as a visual aid to help identify changing momentum conditions at a glance. It is not a buy or sell signal generator and should be used in combination with other forms of analysis and sound risk management.
⚠️ Disclaimer:
This script is provided for educational and informational purposes only. It is not financial advice and should not be considered a recommendation to buy, sell, or hold any financial instrument. Trading involves significant risk of loss and is not suitable for every investor. Users should perform their own due diligence and consult with a licensed financial advisor before making any trading decisions. The author does not guarantee any profits or results from using this script, and assumes no liability for any losses incurred. Use this script at your own risk.
Trading Sessions with 15 minute ORBA working copy of the original Tradingview trading sessions indicator with the addition of horizontal lines marking the 15 minute opening range for your ORB strategy. The lines reset with each session start.
Multi-Timeframe Stochastic (4x) z PodświetlaniemStochastic z możliwością paru tfów gdzie jak są w danej strefie to podświetla
Triple EMA strategy by kingtraderthis strategy is purely based on moving everages, ema5, ema50 and ema200, avoid ranging market. in 1 mint your tp should 15-20pips, in 3mint tp should be 25pips, in 5mint tp should not above 50pips, in 15mints make tp 60 to 80 pips, in 30 mints tp 150 and 1h and h4 ur tp above 200pips, when target achieves have partial closing and keep ur trade breakeven. this indicator is for educational purpose only any loss by using this indicator, the author will not be responsible.
Tristan's Devil Mark (Short)"Devil's Mark" in trading refers to a specific candlestick pattern where a candle opens and moves significantly in one direction without creating a wick on that side. This creates an "inefficiency" in the market, and traders use this as a signal that price will likely return to that level to "rebalance" the imbalance and print the missing wick.
This strategy marks every green candle with no bottom wick using a purple downward wedge above the candle. This is highlighting a candle where buyers dominated from the open, but creating inefficiency below.
The purple wedge marks candles that opened at their lowest point and closed higher.
These candles indicate buyer dominance from the start of the period. In downtrends, a green candle with no bottom wick may indicate a potential short-term reversal.
Wait for the candle to close, and short it. Wait for the price to go below the bottom of the body of the marked candle.
Combine with Trend Analysis
Look for these candles in uptrends to confirm continuation momentum.
In downtrends, a green candle with no bottom wick may indicate a potential short-term reversal.
Support/Resistance Filters
Use horizontal support/resistance levels or moving averages to filter trades.
A green no-wick candle bouncing off support is a stronger bullish signal.
Timeframe Consideration
Works on any timeframe; adjust your strategy accordingly.
For intraday scalping, use 1–15 minute charts; for swing trades, use daily or 4-hour charts.
Backtesting and Pattern Recognition
Since the indicator works on historical bars, review past setups to identify patterns where this candle type reliably predicts price movement.
Candle Color Difference Marker (PSP)This indicator shows when the colors of the candles on two or three charts are different.
Indicateur d'executionThis indicator is based on a 50-period RSI and a 50-period SMA. It allows you to visualize the rebounds between the different curves. These rebounds have proven to be relevant for execution.
Le vrai parmi les trois
5/15-Min-ORB-Trend-Finder-WiPIndicator Features:
> "Open" flag for each market day.
> Toggleable 5-min and 15-min High/Low markings.
> Horizontal support (red) and resistance (blue) lines.
> EMA-based trend line: green for long/buy, purple for short/sell.
> Recommended to use with my other indicator: Buy-or-Sell-WiP.
Strategy:
> Use with 1-min chart with 5-min High/Low or 5-min chart with 15-min High/Low
> After a breakout, wait for confirmation before placing a trade, which is:
- Two confirming candles (green for long/buy, red for short/sell)
and
- Buy-or-Sell-WiP histogram: green for long/buy, red for short/sell
多周期趋势动量面板(Multi-Timeframe Trend Momentum Panel - User Guide)多周期趋势动量面板(Multi-Timeframe Trend Momentum Panel - User Guide)(english explanation follows.)
📖 指标功能详解 (精简版):
🎯 核心功能:
1. 多周期趋势分析 同时监控8个时间周期(1m/5m/15m/1H/4H/D/W/M)
2. 4维度投票系统 MA趋势+RSI动量+MACD+布林带综合判断
3. 全球交易时段 可视化亚洲/伦敦/纽约交易时间
4. 趋势强度评分 0100%量化市场力量
5. 智能警报 强势多空信号自动推送
________________________________________
📚 重要名词解释:
🔵 趋势状态 (MA均线分析):
名词 含义 信号强度
强势多头 快MA远高于慢MA(差值≥0.35%) ⭐⭐⭐⭐⭐ 做多
多头倾向 快MA略高于慢MA(差值<0.35%) ⭐⭐⭐ 谨慎做多
震荡 快慢MA缠绕,无明确方向 ⚠️ 观望
空头倾向 快MA略低于慢MA ⭐⭐⭐ 谨慎做空
强势空头 快MA远低于慢MA ⭐⭐⭐⭐⭐ 做空
简单理解: 快MA就像短跑运动员(反应快),慢MA是长跑运动员(稳定)。短跑远超长跑=强势多头,反之=强势空头。
________________________________________
🟠 动量状态 (RSI力度分析):
名词 含义 操作建议
动量上攻↗ RSI>60且快速上升 强烈买入信号
动量高位 RSI>60但上升变慢 警惕回调,可减仓
动量中性 RSI在4060之间,平稳 等待方向明确
动量低位 RSI<40但下跌变慢 警惕反弹,可止盈
动量下压↘ RSI<40且快速下降 强烈卖出信号
简单理解: RSI就像汽车速度表。"动量上攻"=油门踩到底加速,"动量高位"=已经很快但不再加速了。
________________________________________
🟣 辅助信号:
MACD:
• MACD多头 = 柱状图>0 = 买方力量强
• MACD空头 = 柱状图<0 = 卖方力量强
布林带(BB):
• BB超买 = 价格在布林带上轨附近 = 可能回调
• BB超卖 = 价格在布林带下轨附近 = 可能反弹
• BB中轨 = 价格在中间位置 = 平衡状态
________________________________________
💡 快速上手 3步看懂面板:
第1步: 看"综合结论标签" (K线上方)
• 绿色"多头占优" → 可以做多
• 红色"空头占优" → 可以做空
• 橙色"震荡/均衡" → 观望
第2步: 看"票数 多/空" (面板最下方)
• 多头票数远大于空头 (差距>2) → 趋势强
• 票数接近 (差距<1) → 震荡市
第3步: 看"趋势强度" (综合标签中)
• 强度>70% → 强势趋势,可重仓
• 强度5070% → 中等趋势,正常仓位
• 强度<50% → 弱势,轻仓或观望
________________________________________
🎨 时段背景色含义:
• 紫色背景 = 亚洲时段 (东京交易时间) 波动较小
• 橙色背景 = 伦敦时段 (欧洲交易时间) 波动增大
• 蓝色背景 = 纽约凌晨 美盘准备阶段
• 红色背景 = 纽约关键5分钟 (09:3009:35) ⚠️ 最重要! 市场最活跃,趋势易形成
• 绿色背景 = 纽约上午后段 延续早盘趋势
交易建议: 重点关注红色关键时段,这5分钟往往决定全天方向!
________________________________________
⚙️ 三大市场推荐设置
🥇 黄金: Hull MA 12/EMA 34, 阈值0.250.35%
₿ 比特币: EMA 21/EMA 55, 阈值0.801.20%
💎 以太坊: TEMA 21/EMA 55, 阈值0.600.80%
参数优化建议
黄金 (XAUUSD)
快速MA: Hull MA 12 (超灵敏捕捉黄金快速波动)
慢速MA: EMA 34 (斐波那契数列)
RSI周期: 9 (加快反应)
强趋势阈值: 0.25%
周期: 5, 15, 60, 240, 1440
比特币 (BTCUSD)
快速MA: EMA 21
慢速MA: EMA 55
RSI周期: 14
强趋势阈值: 0.8% (波动大,阈值需提高)
周期: 15, 60, 240, D, W
外汇 EUR/USD
快速MA: TEMA 10 (快速响应)
慢速MA: T3 30, 因子0.7 (平滑噪音)
RSI周期: 14
强趋势阈值: 0.08% (外汇波动小)
周期: 5, 15, 60, 240, 1440
📖 Indicator Function Details (Concise Version):
🎯 Core Functions:
1. MultiTimeframe Trend Analysis Monitors 8 timeframes simultaneously (1m/5m/15m/1H/4H/D/W/M)
2. 4Dimensional Voting System Comprehensive judgment based on MA trend + RSI momentum + MACD + Bollinger Bands
3. Global Trading Sessions Visualizes Asia/London/New York trading hours
4. Trend Strength Score Quantifies market strength from 0100%
5. Smart Alerts Automatically pushes strong bullish/bearish signals
📚 Key Term Explanations:
🔵 Trend Status (MA Analysis):
| Term | Meaning | Signal Strength |
| | | |
| Strong Bull | Fast MA significantly > Slow MA (Diff ≥0.35%) | ⭐⭐⭐⭐⭐ Long |
| Bullish Bias | Fast MA slightly > Slow MA (Diff <0.35%) | ⭐⭐⭐ Caution Long |
| Ranging | MAs intertwined, no clear direction | ⚠️ Wait & See |
| Bearish Bias | Fast MA slightly < Slow MA | ⭐⭐⭐ Caution Short |
| Strong Bear | Fast MA significantly < Slow MA | ⭐⭐⭐⭐⭐ Short |
Simple Understanding: Fast MA = sprinter (fast reaction), Slow MA = longdistance runner (stable). Sprinter far ahead = Strong Bull, opposite = Strong Bear.
🟠 Momentum Status (RSI Analysis):
| Term | Meaning | Trading Suggestion |
| | | |
| Momentum Up ↗ | RSI >60 & rising rapidly | Strong Buy Signal |
| Momentum High | RSI >60 but rising slower | Watch for pullback, consider reducing position |
| Momentum Neutral | RSI between 4060, stable | Wait for clearer direction |
| Momentum Low | RSI <40 but falling slower | Watch for rebound, consider taking profit |
| Momentum Down ↘ | RSI <40 & falling rapidly | Strong Sell Signal |
Simple Understanding: RSI = car speedometer. "Momentum Up" = full throttle acceleration, "Momentum High" = already fast but not accelerating further.
🟣 Auxiliary Signals:
MACD:
MACD Bullish = Histogram >0 = Strong buyer power
MACD Bearish = Histogram <0 = Strong seller power
Bollinger Bands (BB):
BB Overbought = Price near upper band = Possible pullback
BB Oversold = Price near lower band = Possible rebound
BB Middle = Price near middle band = Balanced state
💡 Quick Start 3 Steps to Understand the Panel:
Step 1: Check "Composite Conclusion Label" (Above the chart)
Green "Bulls Favored" → Consider Long
Red "Bears Favored" → Consider Short
Orange "Ranging/Balanced" → Wait & See
Step 2: Check "Votes Bull/Bear" (Bottom of the panel)
Bull votes significantly > Bear votes (Difference >2) → Strong Trend
Votes close (Difference <1) → Ranging Market
Step 3: Check "Trend Strength" (In the composite label)
Strength >70% → Strong Trend, consider heavier position
Strength 5070% → Moderate Trend, normal position size
Strength <50% → Weak Trend, light position or wait & see
🎨 Trading Session Background Color Meanings:
Purple = Asian Session (Tokyo hours) Lower volatility
Orange = London Session (European hours) Increased volatility
Blue = NY Early Morning US session preparation phase
Red = NY Critical 5 Minutes (09:3009:35) ⚠️ Most Important! Market most active, trends easily form
Green = NY Late Morning Continuation of early session trend
Trading Tip: Focus on the red critical period; these 5 minutes often determine the day's direction!
⚙️ Recommended Settings for Three Major Markets
🥇 Gold (XAUUSD):
Fast MA: Hull MA 12 (Highly sensitive for gold's fast moves)
Slow MA: EMA 34 (Fibonacci number)
RSI Period: 9 (Faster reaction)
Strong Trend Threshold: 0.25%
Timeframes: 5, 15, 60, 240, 1440
₿ Bitcoin (BTCUSD):
Fast MA: EMA 21
Slow MA: EMA 55
RSI Period: 14
Strong Trend Threshold: 0.8% (High volatility, requires higher threshold)
Timeframes: 15, 60, 240, D, W
💎 Ethereum (ETHUSD):
Fast MA: TEMA 21
Slow MA: EMA 55
RSI Period: 14
Strong Trend Threshold: 0.600.80%
Timeframes: 15, 60, 240, D, W
💱 Forex EUR/USD:
Fast MA: TEMA 10 (Fast response)
Slow MA: T3 30, Factor 0.7 (Smooths noise)
RSI Period: 14
Strong Trend Threshold: 0.08% (Forex has low volatility)
Timeframes: 5, 15, 60, 240, 1440
ADX +DI/-DI with Buy/Sell Signals//@version=5
indicator("ADX +DI/-DI with Buy/Sell Signals", overlay=true)
// Inputs
adxLength = input.int(14, "ADX Length")
threshold = input.float(25.0, "ADX Threshold")
// Directional Movement
upMove = ta.change(high)
downMove = -ta.change(low)
plusDM = (upMove > downMove and upMove > 0) ? upMove : 0.0
minusDM = (downMove > upMove and downMove > 0) ? downMove : 0.0
// True Range and Smoothed Values
tr = ta.rma(ta.tr, adxLength)
plusDI = 100 * ta.rma(plusDM, adxLength) / tr
minusDI = 100 * ta.rma(minusDM, adxLength) / tr
dx = 100 * math.abs(plusDI - minusDI) / (plusDI + minusDI)
adx = ta.rma(dx, adxLength)
// Buy/Sell Conditions
buySignal = ta.crossover(plusDI, minusDI) and adx > threshold
sellSignal = ta.crossover(minusDI, plusDI) and adx > threshold
// Plot Buy/Sell markers
plotshape(buySignal, title="BUY", location=location.belowbar,
color=color.new(color.lime, 0), style=shape.triangleup, size=size.large, text="BUY")
plotshape(sellSignal, title="SELL", location=location.abovebar,
color=color.new(color.red, 0), style=shape.triangledown, size=size.large, text="SELL")
// Optional ADX + DI lines (hidden by default)
plot(adx, title="ADX", color=color.yellow, linewidth=2, display=display.none)
plot(plusDI, title="+DI", color=color.green, display=display.none)
plot(minusDI, title="-DI", color=color.red, display=display.none)
hline(threshold, "ADX Threshold", color=color.gray, linestyle=hline.style_dotted)
// Alerts
alertcondition(buySignal, title="BUY Alert", message="ADX Buy Signal Triggered")
alertcondition(sellSignal, title="SELL Alert", message="ADX Sell Signal Triggered")