OPEN-SOURCE SCRIPT

CandleSignalADXEMA

580
CandleSignalADXEMA — Description, How to Use, and Financial Disclaimer

⚡ INITIAL NOTE ON OPTIMAL SETTINGS
"Optimal historical performance is achieved when scalping the 5-minute timeframe with a Risk/Reward (R:R) ratio of 1.5."

However, these settings are not universal and depend heavily on the asset, market session, and volatility conditions. Experimentation is strongly encouraged with:

Different timeframes (5m, 15m, 30m, 1H)

Different R:R ratios

Stricter ADX thresholds (20–25) to better filter false signals

Session windows adapted to the market being traded

Always perform a thorough backtest on your asset and timeframe before trading with real money.

📌 DESCRIPTION
CandleSignalADXEMA is an advanced indicator for TradingView (Pine Script v6) designed to identify 3-candle reversal/continuation patterns based on liquidity sweeps and reclaims, filtered by trend (EMA/SMA), trend strength (ADX), session time, and Order Blocks.

The indicator is built for intraday trading — with its best historical performance on the 5-minute timeframe — but it can also be used on higher or lower timeframes, provided you experiment and adapt the parameters.

It combines several professional methodologies into a single visual tool:

Smart Money Concepts (SMC) → liquidity sweeps, reclaims, Order Blocks

Trend Following → EMA 9 / SMA 20 filter

Trend Strength → ADX filter (avoids signals in sideways markets)

Risk Management → automatic SL/TP with configurable R:R ratio (optimal default 1.5)

Visual Backtesting → monthly statistics panel with weekly win rate

🎯 What it does in short
Identifies a reference candle (C1) and marks its high and low.

Waits for a sweep candle (C2) that breaks one extreme of C1 but closes back inside the range → absorption signal.

Waits for the confirmation breakout (C3) beyond C1 → generates a BUY or SELL signal.

Draws SL, TP, and entry lines with realistic intrabar management (no lookahead bias).

Checks whether the signal occurred near a fresh Order Block → high-probability "springboard".

Logs every trade in a monthly statistics panel with weekly win rate.

🛠️ HOW TO USE IT
1️⃣ Installing on TradingView
Open TradingView → chart of an asset (e.g., EURUSD, ES, NQ, BTCUSDT).

At the bottom, open Pine Editor.

Paste the indicator code.

Click "Add to chart".

The indicator will appear on the main pane with lines, boxes, labels, and info panels.

2️⃣ Recommended timeframes
Timeframe Recommended use
1m Aggressive scalping (more noise, more false signals)
5m ✅ Historically optimal — best balance between frequency and reliability
15m Standard intraday
30m Intraday with less noise
1H Intraday swing
4H – Daily Swing trading (filters more significant, fewer signals)
💡 The indicator automatically uses a lower timeframe (1m or 5m) to resolve the intrabar order of TP/SL hits.

3️⃣ Initial configuration (key parameters)
🔹 C1 Lines
Show C1 high/low lines: displays the reference lines.

Confirmed setups to keep: how many past setups to keep on the chart (default 50).

🔹 Pattern Signals
Show BUY / SELL signals: enables/disables the stars.

Breakout buffer beyond C1 (ATR): breakout tolerance. 0 = exact touch; 0.02 = small buffer to avoid false breakouts.

🔹 Session Time Filter
Enable session time filter: enable if you want to trade only within a time window.

Session start / end (HHMM): e.g., 930 and 1730 for the US stock session.

🔹 Moving Average Trend Filter
Enable MA trend filter: enables the directional filter.

Use EMA 9 (ON) or SMA 20 (OFF).

Dynamic color: the MA changes color based on price position.

🔹 ADX Trend Strength Filter
Enable ADX filter: blocks signals in weak trends.

ADX minimum value: threshold (default 14). Raise it to 20–25 for more selective signals (recommended during experimentation).

🔹 Order Block
Enable OB detection: detects Order Blocks.

Require displacement: requires an impulsive candle (> ATR × multiplier).

Mitigation on close: OB is invalidated on a close beyond the box.

🔹 Trade Levels (SL/TP)
Take Profit ratio (R:R): default 1.5 → TP = 1.5 × risk. (Historically optimal setting on the 5m TF)

Stop Loss distance (ATR): minimum SL distance beyond C1.

Box extension to the right: how far to extend the boxes to the right (in bars).

🔹 Panels
Last Trade Panel: shows Entry / SL / TP of the last signal.

Monthly Stats Panel: weekly statistics (Long, Short, TP, SL, WR%, blocked).

4️⃣ Reading the chart
Visual element Meaning
🟦 Gray line C1 waiting for C2
🟪 Fuchsia line Valid C2 → waiting for C3 breakout
⭐ Yellow star below bar BUY signal confirmed
⭐ Red star above bar SELL signal confirmed
🟩 Green box Take Profit
🟥 Red box Stop Loss
⚪ Dashed white line Entry
🔷 Teal box Bullish Order Block
🔶 Orange box Bearish Order Block
🏷️ "OB" label Touch of an important Order Block
✔️ / ✘ Trade outcome (TP or SL)
5️⃣ Recommended operating procedure
Step 1 — Check the context

Verify price is above the EMA 9 (for BUY) or below (for SELL).

Verify ADX ≥ threshold (trend present).

Verify you are inside the configured session.

Step 2 — Wait for the pattern

C1 appears (gray lines).

C2 appears → lines turn fuchsia = setup pending.

Step 3 — Entry on C3

When the star appears, the signal is confirmed.

If the "OB" label also appears, the signal is an Order Block springboard (higher reliability).

Step 4 — Trade management

Entry: break of C1 high (BUY) or C1 low (SELL).

SL: beyond the opposite extreme of C1 + ATR buffer.

TP: calculated on the configured R:R (default 1.5).

The trade remains locked until TP or SL.

Step 5 — Monitoring statistics

The bottom-left panel shows weekly win rate.

Useful to evaluate the real performance of the strategy on your asset/timeframe.

6️⃣ Recommended alerts
You can configure TradingView alerts on:

✅ Buy Confirmed → notification when the pattern is complete

✅ Sell Confirmed

✅ Buy + Order Block → high-probability signal

✅ Sell + Order Block

✅ Buy Setup Pending → early warning (C2 formed)

✅ Sell Setup Pending

⚠️ OB Touch alerts in the current version trigger on every bar: consider not using them or fixing the code.

7️⃣ Best practices
Start from the 5m TF with R:R 1.5 as the historically strongest baseline configuration.

Experiment: change timeframe, R:R, ADX threshold, and session until you find the best setup for your asset.

Do not trade against the trend: respect the MA filter.

Avoid sideways markets: raise the ADX threshold to 20–25.

Avoid high-impact news: disable the session filter only in controlled cases.

Backtest first: use TradingView's Bar Replay to validate the logic on your market.

Respect the R:R: do not manually modify SL/TP during the trade.

Combine with market analysis: the indicator is a tool, not a crystal ball.

⚠️ FINANCIAL DISCLAIMER
IMPORTANT NOTICE — READ CAREFULLY

This indicator (CandleSignalADXEMA) is provided for informational and educational purposes only. It does not constitute in any way:

Financial advice

Investment advice

Personalized trading recommendation

Solicitation to invest

Guaranteed trading signal

🚨 Trading risks
Trading financial instruments (forex, stocks, futures, cryptocurrencies, CFDs, options) involves high risk of capital loss, including the possibility of losing your entire invested capital and, with leveraged instruments, even more than your deposited capital.

Past performance is not indicative of future results.

No strategy, indicator, or system guarantees profits.

Most retail traders lose money.

📊 Indicator limitations
Generated signals are the result of algorithmic calculations based on historical prices and may not reflect real market conditions (slippage, spread, liquidity, commissions).

The statistics panel is an approximate visual backtest and does not account for transaction costs, spread, slippage, or broker execution differences.

Exchange sessions and time zones can affect results on different assets.

The indicator may repaint in real time on a forming bar if obRealtimeDraw is enabled.

Results optimized on one asset/timeframe do not automatically transfer to others. The "optimal" settings (5m TF, R:R 1.5) are indicative and do not guarantee similar performance under different market conditions.

🧠 User responsibility
The user is solely responsible for:

Any trading decision made using this indicator.

Fully understanding the logic of the C1-C2-C3 pattern and its filters.

Performing an adequate backtest and demo testing before trading with real money.

Evaluating their own risk tolerance and financial situation.

Consulting a licensed financial advisor before investing.

📜 No warranty
The author/provider of the indicator:

Provides no warranty, express or implied, regarding accuracy, reliability, completeness, or fitness for a specific purpose.

Is not liable for any direct, indirect, incidental, or consequential losses arising from the use of the indicator.

Does not provide personalized advice nor manage third-party capital.

🌍 Regulations
The use of this tool may be subject to local regulations. It is the user's responsibility to verify compliance with the laws of their country.

By using this indicator you declare that you have read, understood, and fully accepted this disclaimer and that you assume all risks arising from trading in financial markets.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.