davidqqq//@version=5
indicator('CD', overlay=false, max_bars_back=500)
// 输入参数
S = input(12, title='Short EMA Period')
P = input(26, title='Long EMA Period')
M = input(9, title='Signal Line Period')
// 计算DIFF, DEA和MACD值
fastEMA = ta.ema(close, S)
slowEMA = ta.ema(close, P)
DIFF = fastEMA - slowEMA
DEA = ta.ema(DIFF, M)
MACD = (DIFF - DEA) * 2
// 计算N1和MM1
N1 = ta.barssince(ta.crossunder(MACD, 0))
MM1 = ta.barssince(ta.crossover(MACD, 0))
// 确保长度参数大于0
N1_safe = na(N1) ? 1 : math.max(N1 + 1, 1)
MM1_safe = na(MM1) ? 1 : math.max(MM1 + 1, 1)
// 计算CC和DIFL系列值
CC1 = ta.lowest(close, N1_safe)
CC2 = nz(CC1 , CC1)
CC3 = nz(CC2 , CC2)
DIFL1 = ta.lowest(DIFF, N1_safe)
DIFL2 = nz(DIFL1 , DIFL1)
DIFL3 = nz(DIFL2 , DIFL2)
// 计算CH和DIFH系列值
CH1 = ta.highest(close, MM1_safe)
CH2 = nz(CH1 , CH1)
CH3 = nz(CH2 , CH2)
DIFH1 = ta.highest(DIFF, MM1_safe)
DIFH2 = nz(DIFH1 , DIFH1)
DIFH3 = nz(DIFH2 , DIFH2)
// 判断买入条件
AAA = CC1 < CC2 and DIFL1 > DIFL2 and MACD < 0 and DIFF < 0
BBB = CC1 < CC3 and DIFL1 < DIFL2 and DIFL1 > DIFL3 and MACD < 0 and DIFF < 0
CCC = (AAA or BBB) and DIFF < 0
LLL = not CCC and CCC
XXX = AAA and DIFL1 <= DIFL2 and DIFF < DEA or BBB and DIFL1 <= DIFL3 and DIFF < DEA
JJJ = CCC and math.abs(DIFF ) >= math.abs(DIFF) * 1.01
BLBL = JJJ and CCC and math.abs(DIFF ) * 1.01 <= math.abs(DIFF)
DXDX = not JJJ and JJJ
DJGXX = (close < CC2 or close < CC1) and (JJJ or JJJ ) and not LLL and math.sum(JJJ ? 1 : 0, 24) >= 1
DJXX = not(math.sum(DJGXX ? 1 : 0, 2) >= 1) and DJGXX
DXX = (XXX or DJXX) and not CCC
// 判断卖出条件
ZJDBL = CH1 > CH2 and DIFH1 < DIFH2 and MACD > 0 and DIFF > 0
GXDBL = CH1 > CH3 and DIFH1 > DIFH2 and DIFH1 < DIFH3 and MACD > 0 and DIFF > 0
DBBL = (ZJDBL or GXDBL) and DIFF > 0
DBL = not DBBL and DBBL and DIFF > DEA
DBLXS = ZJDBL and DIFH1 >= DIFH2 and DIFF > DEA or GXDBL and DIFH1 >= DIFH3 and DIFF > DEA
DBJG = DBBL and DIFF >= DIFF * 1.01
DBJGXC = not DBJG and DBJG
DBJGBL = DBJG and DBBL and DIFF * 1.01 <= DIFF
ZZZZZ = (close > CH2 or close > CH1) and (DBJG or DBJG ) and not DBL and math.sum(DBJG ? 1 : 0, 23) >= 1
YYYYY = not(math.sum(ZZZZZ ? 1 : 0, 2) >= 1) and ZZZZZ
WWWWW = (DBLXS or YYYYY) and not DBBL
// plot买入和卖出信号
if DXDX
label.new(bar_index, low, text='抄底', style=label.style_label_up, color=color.red, textcolor=color.white, size=size.small)
if DBJGXC
label.new(bar_index, high, text='卖出', style=label.style_label_down, color=color.green, textcolor=color.white, size=size.small)
指標和策略
Rotating Messages (Rules or Motivational)This lightweight utility indicator allows you to display rotating custom text messages directly on your TradingView chart — perfect for reminders, trading rules, motivational quotes, or session notes.
You can define multiple messages separated by semicolons (;) or new lines, and the indicator will automatically cycle through them based on time or bar count. Ideal for traders who want visual cues without cluttering the chart.
⚙️ Main Features
⏱ Time-based or bar-based rotation — switch messages every X seconds (real-time) or X bars (historical/backtest mode).
📍 Flexible positioning — choose between Top Right, Bottom Right, or Bottom Center.
📏 Vertical offset — move text up or down for perfect placement on your chart.
🎨 Custom styling — set text color, background color, border visibility, and text size.
✍️ Simple message input — enter your rules or quotes in a text box with support for multi-line messages.
Trend (5m & 1h) by Ben2010🧭 What it does:
✅ Checks 5 min and 1 hour timeframes (you can change them).
✅ Evaluates:
RSI: momentum
MACD: direction
VWAP: price vs fair value
Volume: buyers vs sellers
Price structure: Higher High or Lower Low
✅ Combines all into a qualitative strength label (Very Bullish → Very Bearish).
✅ Displays everything in a neat table at the top-right corner.
Volume growthVolume Spike vs Previous Day
Description:
This indicator highlights moments of unusually high trading activity by comparing the current bar’s volume to the previous one.
Whenever the current volume exceeds the previous bar’s volume by a specified multiple, the candle is highlighted, and a visual marker appears on the chart.
It’s a simple yet powerful tool to instantly spot sudden spikes in market participation — often signaling key moments of accumulation, distribution, or breaking news activity.
How it works:
Compares the current volume to the previous bar’s volume.
If the increase exceeds your chosen multiplier (for example, 10×), the bar is highlighted.
A green “VOL↑” marker is displayed below the bar for quick visual recognition.
Optional alert conditions allow you to get notified whenever a spike occurs.
Inputs:
Multiplier — sets how many times larger the current volume must be compared to the previous one (default: 10).
Best for:
Spotting sudden surges in interest or liquidity.
Identifying potential breakout or reversal zones.
Works on any asset and any timeframe.
Trend & Strength Detector TSDTrend Strength Detector (TSD)
*Objective Trend Quality Measurement for Educational Market Analysis*
Note: This mathematical framework is a proprietary quantitative model developed by Ario Pinelab, inspired by classical EMA, ADX, RSI and MACD principles, yet not documented in any public technical or academic publication.
## 🎯 Purpose & Design Philosophy
The ** Trend Strength Detector- TSD ** is an educational research tool that provides **quantitative measurement of trend quality** through two independent scoring systems (0-100 scale). It answers the analytical question: *"How strong and aligned is the current market trend environment?"*
This indicator is designed with a **modular, complementary approach** to work alongside various analysis methodologies, particularly pattern-based recognition systems.
## 🔗 Complementary Research Framework
### Designed to Work With Pattern Detection Systems
This indicator provides **environmental context measurement** that complements qualitative pattern recognition tools. It works particularly well alongside systems like:
- **RMBS Smart Detector - Multi-Factor Momentum System**
- Traditional chart pattern analyzers
- Any momentum-based pattern identification tools
🔍 **To find RMBS Smart Detector:**
- Search in TradingView Indicators Library: `" RMBS Smart Detector - Multi-Factor Momentum System"`
- Look for: *Multi-Factor Momentum System*
- By author: ` `
### Why This Complementary Approach?
**Trend Quality Measurement** (TSD - this tool) provides:
- ✅ Structural trend alignment (0-100 score)
- ✅ Momentum intensity levels (0-100 score)
- ✅ Environment classification (Strong/Moderate/Weak)
- 📌 **Answers:** *"HOW STRONG is the underlying trend environment?"*
### Educational Research Value
When used together in a research context, these tools enable systematic study of questions like:
- How do reversal patterns behave when Strength Score is above 70 vs below 30?
- Do continuation patterns in weakening environments (declining scores) show different characteristics?
- What is the correlation between high Alignment Scores and pattern "success rates"?
- Can environment classification help identify genuine trend initiation vs false starts?
⚠️ **Important Note:** Both tools are **independent and work standalone**. TSD provides value whether used alone or with other analysis methods. The relationship with RMBS (or any pattern tool) is **complementary for research purposes**, not dependent.
---
###Mathematical Foundation
##TSA Formula: scoring method developed by Ario
-Trend Model (0 – 100)
TAS = EMA Alignment (0–40) + Price Position (0–30) + Trend Consistency (0–30)
EMA Alignment checks EMA_fast vs EMA_slow vs EMA_trend structure.
Price Position evaluates if Close is above/below all EMAs.
Consistency = 3 × max(bullish,bearish bars within 10 candles).
-Strength Model (0 – 100)
Strength = ADX (0–50) + EMA Slope (0–25) + RSI (0–15) + MACD (0–10)
ADX measures trend energy; Slope shows EMA momentum %;
RSI assesses zone positioning; MACD confirms directional agreement.
Note: This formula represents a proprietary quantitative model by Ario_Pinelab, inspired by classical technical concepts but not published in any external reference.________________________________________
📊 Environment Classification
Based on Total Strength Score:
🟢 Strong Environment: Score ≥ 60
→ Well-defined momentum, clear directional bias
🟡 Moderate Environment: 40 ≤ Score < 60
→ Mixed signals, transitional conditions
🔴 Weak Environment: Score < 40
→ Ranging, choppy, low conviction movement
Color Coding:
• Green background: Strong (≥60)
• Yellow background: Moderate (40-59)
• Red background: Weak (<40)
________________________________________
📈 Visual Components
Main Chart Display
Score Labels (Top-Right Corner):
┌─────────────────────────────────┐
│ 📊 Alignment: 75 | Strength: 82 │
│ Environment: Strong 🟢 │
└─────────────────────────────────┘
Color-Coded Background:
• Environment strength visually indicated via background color
• Helps quick identification of market regime
• Customizable transparency (default: 90%)
Reference Lines:
• Dotted line at 60: Strong/Moderate threshold
• Dotted line at 40: Moderate/Weak threshold
• Mid-line at 50: Neutral reference
________________________________________
🔧 Customization Settings
Input Parameters
The best setting is the default mode.
🚫 Important Disclaimers & Limitations
What This Indicator IS:
✅ Educational measurement tool for trend quality research
✅ Quantitative assessment of current market environment
✅ Complementary analysis tool for pattern-based systems
✅ Historical data analyzer for systematic study
✅ Multi-factor scoring system based on technical calculations
What This Indicator IS NOT:
❌ NOT a trading system or signal generator
❌ NOT financial advice or trade recommendations
❌ NOT predictive of future price movements
❌ NOT a guarantee of pattern success/failure
❌ NOT a substitute for comprehensive risk management
________________________________________
Known Limitations
1. Lagging Nature:
⚠️ All components (EMA, ADX, RSI, MACD) are calculated
from historical price data
→ Scores reflect CURRENT and RECENT conditions
→ Cannot predict sudden reversals or black swan events
→ Trend measurements lag actual price turning points
2. Whipsaw Risk:
⚠️ In choppy/ranging markets, scores may fluctuate rapidly
→ Moderate zone (40-60) can see frequent transitions
→ Low timeframes more susceptible to noise
→ Consider higher timeframes for stable measurements
3. Component Conflicts:
⚠️ Individual components may disagree
→ Example: Strong ADX but weak RSI alignment
→ Scores average these conflicts (may hide nuance)
→ Check individual components for deeper insight
4. Not Predictive:
⚠️ High scores do NOT guarantee continuation
⚠️ Low scores do NOT guarantee reversal
→ Measurement ≠ Prediction
→ Use for CONTEXT, not SIGNALS
→ Combine with comprehensive analysis
________________________________________
Risk Acknowledgments
Market Risk:
• All trading involves substantial risk of loss
• Past performance (even systematic studies) does not guarantee future results
• No indicator, system, or methodology can eliminate market risk
Measurement Limitations:
• Scores are mathematical calculations, not market predictions
• Environmental classification is descriptive, not prescriptive
• Strong measurements can deteriorate rapidly without warning
Educational Purpose:
• This tool is designed for LEARNING about market structure
• Not designed, tested, or validated as a standalone trading system
• Any trading decisions are user’s sole responsibility
No Warranty:
• Indicator provided “as-is” for educational purposes
• No guarantee of accuracy, reliability, or profitability
• Users must verify calculations and apply critical thinking
Open Source
Full Pine Script code available for educational study and modification. Feedback and improvement suggestions welcome.
“All logic is presented for research and educational visualization.”
---
Daily Pivot Breakout Strategy IndicatorTagline:
A pivot-based breakout system that identifies confirmed daily breakouts with momentum and volume filters, with precise entry timing across all timeframes.
How It Works:
This indicator detects strict pivot high breakouts on daily data, filtered by Rate of Change (ROC ≥30%) and Relative Volume (RVOL >1). It displays both the breakout confirmation signal and the next-day entry signal directly on your chart, regardless of timeframe.
Visual Signals:
Orange Pivot Line: The most recent confirmed pivot high (within 250-day lookback)
Day-0 Label (Teal): Appears on the breakout confirmation day (when price closes above daily pivot with filters met)
Entry Banner (Green): Appears on the next trading day at market open - your actual entry point
Cross-Timeframe Consistency:
Daily Chart: View the big picture - Day-0 on breakout bar, Entry on next bar
Any Timeframe: Logic remains consistent to daily pivots and data, signals adapt to show at the correct time
Built-in Alert Conditions:
5PivotBreakout_Scan (Day-0): Fires when breakout is confirmed. Use this for after-hours scanning to build watchlists of confirmed breakouts
5PivotBreakout_Strategy (Next): Fires at market open the next day. Use this to automate entries on confirmed breakouts
Typical Workflow:
Set up Day-0 alerts on your watchlist to catch breakouts as they happen
Review confirmed breakouts each evening
Set up Entry alerts on selected tickers to automate next-day execution (fires at market open)
Optional: Convert to strategy() for backtesting with custom exits (20% trail is good)
Key Features:
Strict pivot detection: No ties allowed - center must be highest point
Momentum filter: 100-day ROC ensures trending strength
Volume confirmation: 20-day RVOL validates participation
No repainting: Uses lookahead_off for realistic, tradeable signals
Customizable Inputs:
Pivot strength parameters (left/right bars)
Pivot lookback period
ROC period and minimum threshold
RVOL period
Toggle visibility of pivot line and labels
Note: This indicator is for educational purposes only and does not constitute financial advice. Past performance does not guarantee future results. Always test thoroughly before live trading.
Elliott Wave Expert AdvisorElliott Wave Expert Advisor - Professional Wave Analysis Tool
OVERVIEW
--------
The Elliott Wave Expert Advisor is a comprehensive Pine Script indicator designed for TradingView that automates Elliott Wave analysis and generates high-probability trading signals. Built on Ralph Nelson Elliott's Wave Principle, this indicator identifies impulse wave patterns, validates them against strict Elliott Wave rules, and provides precise entry points with calculated risk management levels.
CORE FUNCTIONALITY
------------------
1. TREND DETECTION
- Dual Moving Average system (Fast/Slow MA)
- MACD confirmation for trend strength
- Automatic trend classification (Uptrend/Downtrend/Sideways)
- Only generates signals aligned with main trend
2. SWING POINT DETECTION
- Automatic pivot high/low identification
- Configurable sensitivity (lookback periods)
- Minimum swing size filtering to reduce noise
- ZigZag visualization connecting swing points
3. WAVE IDENTIFICATION
- 5-wave impulse pattern recognition (1-2-3-4-5)
- 3-wave corrective pattern detection (A-B-C)
- Wave labels displayed on chart
- Color-coded validation status (Blue = Valid, Orange = Pending)
4. ELLIOTT WAVE RULES VALIDATION
Strictly enforces three cardinal rules:
- Rule 1: Wave 2 never retraces more than 100% of Wave 1
- Rule 2: Wave 3 is never the shortest impulse wave
- Rule 3: Wave 4 never overlaps Wave 1 price territory
5. FIBONACCI ANALYSIS
- Automatic Fibonacci retracement calculations (23.6%, 38.2%, 50%, 61.8%, 78.6%)
- Fibonacci extension projections (100%, 161.8%, 261.8%)
- Wave 3 and Wave 5 target projections
- Fibonacci-based Take Profit levels
6. SIGNAL GENERATION
- Entry signals at Wave 2 completion (catch Wave 3)
- Entry signals at Wave 4 completion (catch Wave 5)
- Automatic Stop Loss placement below/above pivot points
- Multiple Take Profit targets (TP1 at 1.618 extension, TP2 at Wave 5 projection)
- Risk/Reward ratio calculation and filtering
- Minimum R:R threshold (default 1.5:1)
7. VISUAL ELEMENTS
- Pivot markers (H/L) showing swing highs and lows
- ZigZag lines connecting swing points
- Wave number labels (1-2-3-4-5) with validation colors
- Entry signal arrows (Green = BUY, Red = SELL)
- Stop Loss lines (Red dashed)
- Take Profit lines (Green dashed and dotted)
- Real-time status dashboard showing:
* Number of pivots detected
* Wave count progress (X/5)
* Pattern validation status
* Market trend direction
* Signal active status
* Helpful tips and guidance
OPTIMAL USAGE
-------------
• Timeframes: H1, H4, D1 (avoid M1-M5 due to noise)
• Markets: Forex majors (EUR/USD, GBP/USD), Gold (XAU/USD), Major Cryptocurrencies
• Market Conditions: Strong trending markets (avoid ranging/sideways conditions)
• Risk Management: Never risk more than 1-2% per trade
• Position Sizing: Based on calculated Stop Loss distance
CONFIGURATION PARAMETERS
------------------------
Trend Detection:
- MA Fast Period (default: 20)
- MA Slow Period (default: 50)
- MACD settings (12/26/9)
Swing Detection:
- Pivot Lookback Left/Right (default: 10/10, reduce to 5/5 for M15)
- Min Swing Size % (default: 0.1%, reduce to 0.05% for M15)
Wave Detection:
- Min Wave Size % (default: 0.5%, reduce to 0.2-0.3% for smaller timeframes)
Risk Management:
- SL Buffer % (default: 0.1%)
- TP1 Fibonacci Ratio (default: 1.618)
- Min Risk/Reward (default: 1.5)
Visualization:
- Toggle visibility for MAs, ZigZag, Wave Labels, Signals, SL/TP
- Customizable colors for all elements
- Optional trend background coloring
IMPORTANT NOTES
---------------
• Elliott Wave analysis is subjective - this indicator implements one specific interpretation
• Works best in trending markets; automatically suppresses signals in sideways conditions
• Signals are NOT repainting after pivot confirmation
• Not a "holy grail" - combine with other analysis and proper risk management
• Requires patience - quality setups are infrequent but high-probability
• Always backtest on historical data before live trading
ELLIOTT WAVE THEORY BACKGROUND
------------------------------
Elliott Wave Theory, developed by Ralph Nelson Elliott in the 1930s, proposes that market prices move in predictable wave patterns driven by investor psychology. An impulse wave consists of five sub-waves (three in the trend direction, two corrections), followed by a three-wave correction. This indicator automates the identification of these patterns and validates them against Elliott's original rules.
DISCLAIMER
----------
This indicator is for educational and informational purposes only. Past performance does not guarantee future results. Always conduct your own analysis and never trade with money you cannot afford to lose. The indicator provides signals based on technical analysis patterns and does not constitute financial advice.
VERSION
-------
v1.0 - Initial Release
Pine Script v5
Created: 2024
SUPPORT
-------
For detailed usage instructions, refer to the included documentation:
- usage_guide.md - Complete user manual with examples
- elliott_rules.md - Elliott Wave theory reference and implementation details
Multi-TF RSI Consolidation (15M) - PepEnhanced view of rsi levels across multiple timeframes in unison.
Victoria Smart Overlay – EMA1/SMA3/SMA1Core Components:
EMA 1 (Micro): fastest trend trigger
SMA 3 (Short): trend confirmation
SMA 1 (Base): structure guide
Conditions and Actions:
EMA1 crosses above SMA3 → Uptrend starting → Consider Calls / Long
EMA1 crosses below SMA3 → Downtrend starting → Consider Puts / Short
Price hugging SMA1 → Neutral zone → Wait for breakout
Background Green → Confirmed Uptrend → Stay long or scalp Calls
Background Red → Confirmed Downtrend → Stay short or scalp Puts
Micro EMA + Heikin Ashi (Refined Swing Map)
Purpose: Filters fake moves and identifies strong momentum runs.
Use on 5m / 15m charts for intraday clarity.
Signals and Actions:
EMA1 > EMA3 > EMA5 → Micro-uptrend forming → Enter / hold Calls
EMA1 < EMA3 < EMA5 → Micro-downtrend forming → Enter / hold Puts
EMA lines tangled → No conviction → Wait
200-Day SMA rising → Macro bullish → Favor long trades
200-Day SMA falling → Macro bearish → Favor shorts
EMA 20/50/100/200 Trader IkkaEMA 20/50/100/200 📊 + Crossover Alerts 🔔 Trader Ikka
This indicator plots four key Exponential Moving Averages (EMA 20, 50, 100, and 200) to help identify trends.
It also detects and marks bullish 🟢 and bearish 🔴 crossovers between the EMA 20 and EMA 50, signaling potential trend reversals or continuations.
✨ Features:
📊 Plots EMA 20, 50, 100, and 200 with color-coded lines
🟢🔴 Highlights bullish and bearish crossovers between EMA 20 & EMA 50
🔔 Built-in alert conditions for automated notifications
⚡ Useful for identifying momentum shifts and entry/exit zones
chart Pattern & Candle sticks Strategy# **XAUUSD Pattern & Candle Strategy - Complete Description**
## **Overview**
This Pine Script indicator is a comprehensive multi-factor trading system specifically designed for **XAUUSD (Gold) scalping and swing trading**. It combines classical technical analysis methods including candlestick patterns, chart patterns, moving averages, and volume analysis to generate high-probability buy/sell signals with automatic stop-loss and take-profit levels.
***
## **Core Components**
### **1. Moving Average System (Triple MA)**
**Purpose:** Identifies trend direction and momentum
- **Fast MA (20-period)** - Short-term price action
- **Medium MA (50-period)** - Intermediate trend
- **Slow MA (200-period)** - Long-term trend direction
**How it works:**
- **Bullish alignment**: MA20 > MA50 > MA200 (all pointing up)
- **Bearish alignment**: MA20 < MA50 < MA200 (all pointing down)
- **Crossover signals**: When Fast MA crosses Medium MA, it triggers buy/sell signals
- **Choice of SMA or EMA**: Adjustable based on preference
**Visual indicators:**
- Blue line = Fast MA
- Orange line = Medium MA
- Light red line = Slow MA
- Green background tint = Bullish trend
- Red background tint = Bearish trend
---
### **2. Candlestick Pattern Recognition (13 Patterns)**
**Purpose:** Identifies reversal and continuation signals based on price action
#### **Bullish Patterns (Signal potential upward moves):**
1. **Hammer** 🔨
- Long lower wick (2x body size)
- Small body at top
- Indicates rejection of lower prices (buyers stepping in)
- Best at support levels
2. **Inverted Hammer**
- Long upper wick
- Small body at bottom
- Shows buying pressure despite initial selling
3. **Bullish Engulfing** 📈
- Green candle completely engulfs previous red candle
- Strong reversal signal
- Body must be 1.2x larger than previous
4. **Morning Star** ⭐
- 3-candle pattern
- Red candle → Small indecision candle → Large green candle
- Powerful reversal at bottoms
5. **Piercing Line** ⚡
- Green candle closes above 50% of previous red candle
- Indicates strong buying interest
6. **Bullish Marubozu**
- Almost no wicks (95% body)
- Very strong bullish momentum
- Body must be 1.3x average size
#### **Bearish Patterns (Signal potential downward moves):**
7. **Shooting Star** 💫
- Long upper wick
- Small body at bottom
- Indicates rejection of higher prices (sellers in control)
- Best at resistance levels
8. **Hanging Man**
- Similar to hammer but appears at top
- Warning of potential reversal down
9. **Bearish Engulfing** 📉
- Red candle completely engulfs previous green candle
- Strong reversal signal
10. **Evening Star** 🌙
- 3-candle pattern (opposite of Morning Star)
- Green → Small → Large red candle
- Powerful top reversal
11. **Dark Cloud Cover** ☁️
- Red candle closes below 50% of previous green candle
- Indicates strong selling pressure
12. **Bearish Marubozu**
- Almost no wicks, pure red body
- Very strong bearish momentum
#### **Neutral Pattern:**
13. **Doji**
- Open and close nearly equal (tiny body)
- Indicates indecision
- Often precedes major moves
**Detection Logic:**
- Compares body size, wick ratios, and position relative to previous candles
- Uses 14-period average body size as reference
- All patterns validated against volume confirmation
***
### **3. Chart Pattern Recognition**
**Purpose:** Identifies major support/resistance and reversal patterns
#### **Patterns Detected:**
**Double Bottom** 📊 (Bullish)
- Two lows at approximately same level
- Indicates strong support
- Breakout above neckline triggers buy signal
- Most reliable at major support zones
**Double Top** 📊 (Bearish)
- Two highs at approximately same level
- Indicates strong resistance
- Breakdown below neckline triggers sell signal
- Most reliable at major resistance zones
**Support & Resistance Levels**
- Automatically plots recent pivot highs (resistance)
- Automatically plots recent pivot lows (support)
- Uses 3-bar strength for validation
- Levels shown as dashed horizontal lines
**Price Action Patterns**
- **Uptrend detection**: Higher highs + higher lows
- **Downtrend detection**: Lower highs + lower lows
- Confirms overall market structure
***
### **4. Volume Analysis**
**Purpose:** Confirms signal strength and filters false signals
**Metrics tracked:**
- **Volume MA (20-period)**: Baseline average volume
- **High volume threshold**: 1.5x the volume average
- **Volume increase**: Current volume > previous 2 bars
**How it's used:**
- All buy/sell signals **require volume confirmation**
- High volume = institutional participation
- Low volume signals are filtered out
- Prevents whipsaw trades during quiet periods
**Visual indicator:**
- Dashboard shows "High" volume in orange when active
- "Normal" shown in gray during low volume
***
### **5. Signal Generation Logic**
**BUY SIGNALS triggered when ANY of these occur:**
1. **Candlestick + Volume**
- Bullish candle pattern detected
- High volume confirmation
- Price above Fast MA
2. **MA Crossover + Volume**
- Fast MA crosses above Medium MA
- High volume confirmation
3. **Double Bottom Breakout**
- Price breaks above support level
- Volume confirmation present
4. **Trend Continuation**
- Uptrend structure intact (higher highs/lows)
- All MAs in bullish alignment
- Price above Fast MA
- Volume confirmation
**SELL SIGNALS triggered when ANY of these occur:**
1. **Candlestick + Volume**
- Bearish candle pattern detected
- High volume confirmation
- Price below Fast MA
2. **MA Crossunder + Volume**
- Fast MA crosses below Medium MA
- High volume confirmation
3. **Double Top Breakdown**
- Price breaks below resistance level
- Volume confirmation present
4. **Trend Continuation**
- Downtrend structure intact (lower highs/lows)
- All MAs in bearish alignment
- Price below Fast MA
- Volume confirmation
***
### **6. Risk Management System**
**Automatic Stop Loss Calculation:**
- Based on ATR (Average True Range) - 14 periods
- **Formula**: Entry price ± (ATR × SL Multiplier)
- **Default multiplier**: 1.5 (adjustable)
- Adapts to market volatility automatically
**Automatic Take Profit Calculation:**
- **Formula**: Entry price ± (ATR × TP Multiplier)
- **Default multiplier**: 2.5 (adjustable)
- **Default Risk:Reward ratio**: 1:1.67
- Higher TP multiplier = more aggressive targets
**Position Management:**
- Tracks ONE position at a time (no pyramiding)
- Automatically closes position when:
- Stop loss is hit
- Take profit is reached
- Opposite MA crossover occurs
- Prevents revenge trading and over-leveraging
**Visual Representation:**
- **Red horizontal line** = Stop Loss level
- **Green horizontal line** = Take Profit level
- Lines remain on chart while position is active
- Automatically disappear when position closes
***
### **7. Visual Elements**
**On-Chart Displays:**
1. **Moving Average Lines**
- Fast MA (Blue, thick)
- Medium MA (Orange, thick)
- Slow MA (Red, thin)
2. **Support/Resistance**
- Green crosses = Support levels
- Red crosses = Resistance levels
3. **Buy/Sell Arrows**
- Large GREEN "BUY" label below bars
- Large RED "SELL" label above bars
4. **Pattern Labels** (Small markers)
- "Hammer", "Bull Engulf", "Morning Star" (green, below bars)
- "Shooting Star", "Bear Engulf", "Evening Star" (red, above bars)
- "Double Bottom" / "Double Top" (blue/orange)
5. **Signal Detail Labels** (Medium size)
- Shows signal reason (e.g., "Bullish Candle", "MA Cross Up")
- Displays Entry, SL, and TP prices
- Color-coded (green for long, red for short)
6. **Background Coloring**
- Light green tint = Bullish MA alignment
- Light red tint = Bearish MA alignment
***
### **8. Information Dashboard**
**Top-right corner table showing:**
| Metric | Description |
|--------|-------------|
| **Position** | Current trade status (LONG/SHORT/None) |
| **MA Trend** | Overall trend direction (Bullish/Bearish/Neutral) |
| **Volume** | Current volume status (High/Normal) |
| **Pattern** | Last detected candlestick pattern |
| **ATR** | Current volatility measurement |
**Purpose:**
- Quick at-a-glance market assessment
- Real-time position tracking
- No need to check multiple indicators
***
### **9. Alert System**
**Complete alert coverage for:**
✅ **Entry Alerts**
- "Buy Signal" - Triggers when buy conditions met
- "Sell Signal" - Triggers when sell conditions met
✅ **Exit Alerts**
- "Long TP Hit" - Take profit reached on long position
- "Long SL Hit" - Stop loss triggered on long position
- "Short TP Hit" - Take profit reached on short position
- "Short SL Hit" - Stop loss triggered on short position
**How to use:**
1. Click "Create Alert" button
2. Select desired alert from dropdown
3. Set notification method (popup, email, SMS, webhook)
4. Never miss a trade opportunity
***
## **Recommended Settings**
### **For Scalping (Quick trades):**
- **Timeframe**: 5-minute
- **Fast MA**: 9
- **Medium MA**: 21
- **Slow MA**: 50
- **SL Multiplier**: 1.0
- **TP Multiplier**: 2.0
- **Volume Threshold**: 1.5x
### **For Swing Trading (Longer holds):**
- **Timeframe**: 1-hour or 4-hour
- **Fast MA**: 20
- **Medium MA**: 50
- **Slow MA**: 200
- **SL Multiplier**: 2.0
- **TP Multiplier**: 3.0
- **Volume Threshold**: 1.3x
### **Best Trading Hours for XAUUSD:**
- **Asian Session**: 00:00 - 08:00 GMT (lower volatility)
- **London Session**: 08:00 - 16:00 GMT (high volatility) ⭐
- **New York Session**: 13:00 - 21:00 GMT (highest volume) ⭐
- **London-NY Overlap**: 13:00 - 16:00 GMT (BEST for scalping) 🔥
***
## **How to Use This Strategy**
### **Step 1: Setup**
1. Open TradingView
2. Load XAUUSD chart
3. Select timeframe (5m, 15m, 1H, or 4H)
4. Add indicator from Pine Editor
5. Adjust settings based on your trading style
### **Step 2: Wait for Signals**
- Watch for GREEN "BUY" or RED "SELL" labels
- Check the signal reason in the detail label
- Verify dashboard shows favorable conditions
- Confirm volume is "High" (not required but preferred)
### **Step 3: Enter Trade**
- Enter at market or limit order near signal price
- Note the displayed Entry, SL, and TP prices
- Set your broker's SL/TP to match indicator levels
### **Step 4: Manage Position**
- Watch for SL/TP lines on chart
- Monitor dashboard for trend changes
- Exit manually if opposite MA crossover occurs
- Let SL/TP do their job (don't move them!)
### **Step 5: Review & Learn**
- Track win rate over 20+ trades
- Adjust multipliers if needed
- Note which patterns work best for you
- Refine entry timing
***
## **Key Advantages**
✅ **Multi-confirmation approach** - Reduces false signals significantly
✅ **Automatic risk management** - No manual calculation needed
✅ **Adapts to volatility** - ATR-based SL/TP adjusts to market conditions
✅ **Volume filtered** - Ensures institutional participation
✅ **Visual clarity** - Easy to understand at a glance
✅ **Complete alert system** - Never miss opportunities
✅ **Pattern education** - Learn patterns as they appear
✅ **Works on all timeframes** - Scalping to swing trading
***
## **Limitations & Considerations**
⚠️ **Not a holy grail** - No strategy wins 100% of trades
⚠️ **Requires practice** - Demo trade first to understand signals
⚠️ **Market conditions matter** - Works best in trending or volatile markets
⚠️ **News events** - Avoid trading during major economic releases
⚠️ **Slippage on 5m** - Fast markets may have execution delays
⚠️ **Pattern subjectivity** - Some patterns may trigger differently than expected
***
## **Risk Management Rules**
1. **Never risk more than 1-2% per trade**
2. **Maximum 3 positions per day** (avoid overtrading)
3. **Don't trade during major news** (NFP, FOMC, etc.)
4. **Use proper position sizing** (0.01 lot per $100 for micro accounts)
5. **Keep trade journal** (track patterns, win rate, mistakes)
6. **Stop trading after 3 consecutive losses** (psychological reset)
7. **Don't move stop loss further away** (accept losses)
8. **Take partial profits** at 1:1 R:R if desired
***
## **Expected Performance**
**Realistic expectations:**
- **Win rate**: 50-65% (depending on market conditions and timeframe)
- **Risk:Reward**: 1:1.67 default (adjustable to 1:2 or 1:3)
- **Signals per day**: 3-8 on 5m, 1-3 on 1H
- **Best months**: High volatility periods (news events, economic uncertainty)
- **Drawdowns**: Expect 3-5 losing trades in a row occasionally
***
## **Customization Options**
All inputs are adjustable in settings panel:
**Moving Averages:**
- Type (SMA or EMA)
- All three period lengths
**Volume:**
- Volume MA length
- High volume multiplier threshold
**Chart Patterns:**
- Pattern strength (bars for pivot detection)
- Show/hide pattern labels
**Risk Management:**
- ATR period
- Stop loss multiplier
- Take profit multiplier
**Display:**
- Toggle pattern labels
- Customize colors (in code)
***
## **Conclusion**
This is a **professional-grade, multi-factor trading system** that combines the best of classical technical analysis with modern risk management. It's designed to give clear, actionable signals while automatically handling the complex calculations of stop loss and take profit levels.
**Best suited for traders who:**
- Understand basic technical analysis
- Can follow rules consistently
- Prefer systematic approach over gut feeling
- Want visual confirmation before entering trades
- Value proper risk management
**Start with demo trading** for at least 20-30 trades to understand how the signals work in different market conditions. Once comfortable and profitable on demo, transition to live trading with minimal risk per trade.
Happy trading! 📈🎯
Stoch PRO + Dynamic EMA (EMA cross)Stoch PRO + Dynamic EMA Documentation
Overview:
- Pine Script v6 overlay indicator combining a trend-colored EMA with a Stochastic oscillator to highlight midline momentum shifts.
- Designed for TradingView charts (Indicators → Import) as a visual aid for timing entries within trend-following setups.
- Crafted and optimized around BTCUSDT on the 4h timeframe; adapt inputs before applying to other markets or intervals.
Inputs:
- EMA Length (default 50): smoothing window for the dynamic EMA; lower values respond faster but whipsaw more.
- Stochastic K Length (20): lookback for the raw %K calculation.
- Stochastic K Smoothing (3): SMA applied to %K to reduce noise.
- Stochastic D Smoothing (3): SMA over %K to produce the companion %D line.
Visual Elements:
- EMA plotted on price with linewidth 3; teal when close > EMA, fuchsia otherwise.
- Background tinted teal/fuchsia at high transparency (≈92) to reinforce the current trend bias without obscuring price bars.
Oscillator Logic:
- %K = ta.stoch(high, low, close, kLength); smoothed with ta.sma(kRaw, kSmooth).
- %D = ta.sma(k, dSmooth).
- Focus is on the midline (50) rather than traditional 20/80 extremes to emphasize rapid momentum flips.
Signals:
- Buy: %K crossing above 50 while close > EMA (teal state). Plots tiny teal circle below the bar.
- Sell: %K crossing below 50 while close < EMA (fuchsia state). Plots tiny purple circle above the bar.
Trading Workflow Tips:
- Use EMA/background color for directional bias, then confirm with %K 50-cross to refine entries.
- Consider higher-timeframe trend filters or price-action confirmation to avoid range chop.
- Stops often sit just beyond the EMA; adjust thresholds (e.g., 55/45) if too many false positives occur.
- Always plan risk/reward upfront—define TP/SL levels that fit your strategy and backtest them thoroughly before trading live.
Alerts & Extensions:
- Wrap crossUp/crossDown in alertcondition() if TradingView alerts are needed.
- For automation/backtesting, convert logic to a strategy() script or add position management rules.
Inter-symmetric Forecast (ISF)Concept:
The Inter-Symmetric Forecast (ISF) is a physics-inspired price projection tool that visualizes both trend-continuation and mean-reversion scenarios in one dynamic structure. It extends the classic ADAM Projection by introducing a regime-sensitive weighting based on the Market Reynolds Number (Reₘ), a dimensionless ratio of market momentum × liquidity to volatility-derived “viscosity.”
Mechanism:
ISF mirrors past price action around the current close (the continuation path) while also forward-pasting the same pattern unreflected (the anti-trend path). It then blends these paths bar-by-bar using time-reflected Reₘ values — meaning the liquidity-momentum regime of each past segment determines how much its future mirror leans toward continuation or reversion.
Interpretation:
High Reₘ → strong inertia/liquidity, favors trend continuation.
Low Reₘ → high friction/volatility, favors mean reversion.
The yellow blended forecast shows the regime-weighted midpoint between both outcomes.
Use:
ISF offers traders a visual probability corridor rather than a fixed prediction — illustrating how far a move might extend if momentum persists, or fade if conditions become viscous. It’s best used as a contextual forecasting overlay for discretionary or systematic analysis.
Nifty Futures Momentum ScalperNifty Futures Momentum Scalper
Backtesting
VPA , RSI, momentum trades with EMA crossover
Predicta Futures – Scalping Predictor with Confidence FilterPredicta Futures is an advanced short-term forecasting indicator that combines historical pattern similarity analysis with weighted technical signals to predict price movements 1–10 minutes ahead.
**Core Functionality**
The script scans up to 5,000 historical bars to identify structurally similar price patterns. It aggregates forward outcomes from matched patterns and integrates real-time signals from RSI, MACD, Bollinger Bands, volume momentum, and volatility. A composite confidence score filters signals, displaying only those meeting the user-defined threshold (default ≥68%).
**Key Outputs**
- Buy/sell triangles with text labels
- Dashed projection line to predicted price
- Dotted target and ATR-based stop lines
- Info panel showing forecast direction, confidence %, expected move %, pattern count, order book status, and data access details
**Customization & Performance**
- Execution modes: Fast, Balanced, Accurate
- Adaptive sampling with recency bias option
- Filters for volatility and market hours
- Adjustable weights, lookback period, and prediction horizon
**Use Cases**
Scalping, intraday trading, futures, cryptocurrencies, equities.
*Order book metrics are simulated (platform limitation). Technical analysis tool; not financial advice.*
Midnight ET + Daily H/L (vertical midnight + HL lines)This script provides midnight EST dividers for each day and marks each daily high and low during each True day. Credits go to my mentor ICT for the idea behind this script.
Multi MA SystemMulti-timeframe moving average indicator with 6 customizable MAs.
Each MA supports 7 types (SMA/EMA/WMA/DEMA/TEMA/HMA/ZLEMA), custom periods, timeframes, colors, and line styles.
Perfect for multi-timeframe analysis and trend identification.
ROC + dROC + d2ROC (with z-scores & percentiles)This indicator measures how price momentum is changing — not just whether it’s rising or falling, but how quickly that change itself is accelerating or slowing. It starts with the Rate of Change (ROC), which shows how much price has moved over a set period. The first derivative (ΔROC) tracks how ROC is changing from bar to bar, and the second derivative (Δ²ROC) shows whether that change is speeding up or fading — essentially the “acceleration” of momentum. Positive Δ²ROC means momentum is strengthening; negative means it’s weakening. The script also quantifies how extreme those shifts are using z-scores and percentiles, helping spot Druckenmiller-style turning points where trends often begin or end.
Level LinesThis indicator displays levels in close proximity to the current price, enabling users to identify psychological levels on charts that serve as support/resistance zones or key reference points for price action.
In the settings, you can customize the number of lines shown above and below the current price, along with the interval size for rendering them.
As the price moves higher or lower, the lines dynamically adjust to reflect the most relevant levels.
In settings you can fully customize the style of lines (color, width, style) with separate settings available for lines above & below the current price.
Multi-Reversal + MA50/200 + MACD + BJ (Tilson) Combo//@version=5
indicator(title="Multi-Reversal + MA50/200 + MACD + BJ (Tilson) Combo", overlay=true)
// --- Moving Averages (MA50, MA200) ---
ma_50 = ta.sma(close, 50)
ma_200 = ta.sma(close, 200)
plot(ma_50, color=color.blue, linewidth=1, title="MA50")
plot(ma_200, color=color.red, linewidth=2, title="MA200")
// --- MACD ---
fast_length = input(12, title="MACD Fast")
slow_length = input(26, title="MACD Slow")
signal_length = input(9, title="MACD Signal")
= ta.macd(close, fast_length, slow_length, signal_length)
macd_cross_up = ta.crossover(macdLine, signalLine)
macd_cross_down = ta.crossunder(macdLine, signalLine)
// --- Tilson MA (BJ reversal) ---
tilson_length = input(20, title="Tilson MA Length (BJ reversal)")
tilson_ma = ta.ema(ta.ema(close, tilson_length), tilson_length)
bj_cross_up = close > tilson_ma and close < tilson_ma
bj_cross_down = close < tilson_ma and close > tilson_ma
plot(tilson_ma, color=color.orange, linewidth=2, title="Tilson MA (BJ reversal)")
// --- Đảo chiều tổng hợp ---
bull_reversal = macd_cross_up and bj_cross_up and close > ma_50 and close > ma_200
bear_reversal = macd_cross_down and bj_cross_down and close < ma_50 and close < ma_200
// --- Plot tín hiệu trên chart ---
plotshape(bull_reversal, location=location.belowbar, style=shape.triangleup, size=size.large, color=color.lime, title="Bullish Reversal", text="STRONG UP")
plotshape(bear_reversal, location=location.abovebar, style=shape.triangledown, size=size.large, color=color.red, title="Bearish Reversal", text="STRONG DN")
// --- BJ riêng lẻ ---
plotshape(bj_cross_up, location=location.belowbar, color=color.yellow, style=shape.circle, size=size.tiny, title="BJ Up Only")
plotshape(bj_cross_down, location=location.abovebar, color=color.yellow, style=shape.circle, size=size.tiny, title="BJ Down Only")
// --- Alert conditions ---
alertcondition(bull_reversal, title="Bullish Strong Reversal", message="Buy opportunity: MA bullish + MACD + BJ reversal!")
alertcondition(bear_reversal, title="Bearish Strong Reversal", message="Sell warning: MA bearish + MACD + BJ reversal!")
ATR/ADX Trend Table - Compact & Positionable (Fixed init)Table to determine qualified ATR & ADX DI for follow trend entry
TTM Squeeze MTF DashboardThis indicator is a multi-timeframe (MTF) powerhouse for spotting breakout trades: It blends TTM Squeeze volatility, momentum oscillator (MOM), EMA trend stacks, MACD histogram expansion, and a "Green Count" (GC) tracker for post-squeeze timing. Perfect for day traders hunting confluence across TFs (e.g., 5m/15m/1H) to enter longs on lower timeframes (LTF) when signals align bullish.1. Quick OverviewCore Features:Dashboard Table: Real-time status for 3 user-defined TFs (defaults: 5m, 15m, 1H).
Rows: MOM (momentum), EMA (trend stack), MACD (histogram expansion), SQZ (volatility), GC (breakout counter), + optional GC MOM.
Plots: MOM histogram + GC line below price for visual confirmation.
Alerts: Triggers on full bullish/bearish alignment (positive/negative MOM + EMA stack + GC ≤3).
Edge: Filters noise with MTF alignment—wait for the table to "light up" (2+ TFs green/aqua) for high-conviction entries.
Best Use: Liquid markets (stocks, forex, crypto). Chart on LTF (e.g., 5m) for entries, use HTF for bias.
2. Installation & AccessOpen TradingView > Load a chart (e.g., AAPL on 5m).
Click Indicators (top toolbar) > Search "TTM Squeeze MTF Dashboard".
Add to chart—table appears top-right (customizable).
Pro Tip: Pin to favorites for quick access. Save chart layouts to preserve settings.
If editing: Right-click indicator > "Edit Pine Script" (open-source code available).3. Customizing SettingsGear icon (next to indicator name) > Adjust groups:Multi-Timeframe SettingsTF1/2/3: Set your scales (e.g., 1m/5m/15m for scalps; 15m/1H/4H for swings).
EMA SettingsLengths: 8/21/55/200 (Fib-tuned for trend).
Colors: Green (bull stack), Red (bear), Gray (neutral).
MACD SettingsLengths: 12/26/9 (standard).
Colors: Green (up-expansion: bull building), Red (down: bear building), Gray (retracting: pause).
Table Colors & DisplayGC Colors: Customize highlights for low GC + momentum.
Histogram Color: MOM shades (aqua/blue positive; red/yellow negative).
Squeeze Dot Color: Green (no squeeze), Black (low), Red/Orange (compression).
Toggles: Show/hide rows (e.g., disable SQZ for cleaner view).
Position/Size: Top-right default; tweak text color/size.
OtherSqueeze Length: 20 (BB/KC base).
Multipliers: BB=2.0, KC=1.0/1.5/2.0 (vol bands).
Hit OK—updates live. Defaults work great out-of-box.4. Reading the Table5 columns: Label | TF1 | TF2 | TF3 | Spacer.
Colors = signals; text = TF labels or GC numbers. Default order: MOM > EMA > MACD > SQZ > GC MOM > GC.Row
Purpose
Bullish (Green/Aqua)
Bearish (Red/Yellow)
Neutral (Gray)
MOM
Momentum flow.
Aqua (rising positive: strong bull).
Blue (falling positive: bull slowing).
Red (rising negative: bear easing).
Yellow (falling negative: deep bear).
N/A.
EMA
Trend stack (short > long EMAs).
Green: Ascending (with trend).
Red: Descending (against).
Mixed.
MACD
Histogram expansion.
Green: Positive & growing (momentum surge).
Red: Negative & shrinking (bear surge).
Flat/retracting (avoid).
SQZ
Volatility compression.
Green: No squeeze (expanding).
Black: Low (mild coil).
N/A.
Red: Medium.
Orange: High (wait).
GC MOM (Opt.)
GC ≤3 + positive MOM.
Aqua/Blue: Entry sweet spot.
N/A.
No match.
GC
Bars since last red squeeze.
MOM color if ≤3 (breakout now!). Text: Count (e.g., "2").
N/A.
>3 (wait).
Bullish Light-Up: 2+ TFs green/aqua on MOM/EMA/MACD + SQZ green/black + GC ≤3 = Long setup.5. Chart PlotsMOM Histogram: Colored bars (aqua = buy pressure)—confirms table.
GC Line: Purple, rising from 0—≤3 signals volatility release.
6. Alerts SetupRight-click chart > Add Alert > Select indicator.
Pick: "Bullish Alignment TF1" (e.g., for 5m).
Message: "Long {{ticker}}—MOM+/EMA Up/GC≤3 on TF1!"
Once Per Bar to avoid noise.
Bullish: Positive MOM + up EMA + low GC (long entry).
Bearish: Negative MOM + down EMA + low GC (short).
7. Trading FrameworkBias Check: HTF EMA green + SQZ release.
Confluence: Table aligns bullish (alert fires).
LTF Entry: On 5m, buy close above EMA8 (or dip to it). SL below swing low (1-2% risk).
Manage: Trail on MACD gray or GC reset. TP: 1.5-2:1 RR.
Avoid: Choppy news; <2 TF alignment.
Example: Alert on TF2 (15m). Switch to 5m: MOM aqua, price bounces EMA—long.Backtest Tip: Convert to strategy script for stats (55-65% win rate on aligns).






















