# Pattern Detection Guide

Automatically identify trading opportunities with AI-powered pattern recognition.

---

## Overview

The platform detects multiple types of patterns:

- **Fair Value Gaps (FVG)** — Price inefficiencies
- **Candlestick Patterns** — Classic candle formations
- **Chart Patterns** — Technical analysis patterns
- **Support/Resistance** — Key price levels
- **Market Anomalies** — Unusual activity signals

---

## Fair Value Gaps (FVG)

A Fair Value Gap occurs when price moves so quickly that it leaves a "gap" in the chart — an area where no trading occurred.

### How They Appear on Charts
- **Bullish FVG** — Gap below price (potential support)
- **Bearish FVG** — Gap above price (potential resistance)
- Shown as shaded zones on your charts

### Trading FVGs
- Price often returns to "fill" the gap
- Unfilled gaps can act as support/resistance
- Gap size indicates strength of the move

### Viewing FVGs
1. Open any chart
2. Click the **Overlays** button
3. Enable **Fair Value Gaps**
4. Gaps appear as colored zones

---

## Candlestick Patterns

The platform detects 18 candlestick patterns:

### Bullish Patterns
| Pattern | Signal Strength | Description |
|---------|-----------------|-------------|
| Hammer | Strong | Long lower wick, small body at top |
| Bullish Engulfing | Strong | Large green candle engulfs prior red |
| Morning Star | Very Strong | Three-candle reversal pattern |
| Three White Soldiers | Very Strong | Three consecutive green candles |
| Dragonfly Doji | Moderate | Long lower wick, no upper wick |

### Bearish Patterns
| Pattern | Signal Strength | Description |
|---------|-----------------|-------------|
| Shooting Star | Strong | Long upper wick, small body at bottom |
| Bearish Engulfing | Strong | Large red candle engulfs prior green |
| Evening Star | Very Strong | Three-candle reversal pattern |
| Three Black Crows | Very Strong | Three consecutive red candles |
| Gravestone Doji | Moderate | Long upper wick, no lower wick |

### Neutral Patterns
| Pattern | Meaning |
|---------|---------|
| Doji | Indecision — watch for next move |
| Spinning Top | Indecision — consolidation likely |

### Viewing Candlestick Patterns
1. Open a chart
2. Detected patterns show as labels/icons
3. Hover for pattern name and details
4. Click for trading suggestions

---

## Chart Patterns

### Reversal Patterns
| Pattern | What It Means | Action |
|---------|---------------|--------|
| Double Bottom | Bullish reversal | Consider long after neckline break |
| Double Top | Bearish reversal | Consider short after neckline break |
| Head & Shoulders | Bearish reversal | Watch for neckline break |
| Inverse H&S | Bullish reversal | Watch for neckline break |

### Continuation Patterns
| Pattern | What It Means | Action |
|---------|---------------|--------|
| Bull Flag | Uptrend pause | Long on breakout above flag |
| Bear Flag | Downtrend pause | Short on breakdown below flag |
| Higher Lows | Uptrend strength | Trend likely to continue |
| Lower Highs | Downtrend strength | Trend likely to continue |

### Breakout Patterns
| Pattern | What It Means |
|---------|---------------|
| Support Bounce | Price respected support level |
| Resistance Rejection | Price rejected at resistance |
| Breakout Continuation | Clean break of key level |
| False Breakout | Failed break — potential reversal |

---

## Pattern Hunter

Scan multiple markets simultaneously for patterns.

### Accessing Pattern Hunter
1. Go to **Patterns > Hunter** tab
2. Or use the Console widget

### Setting Up a Scan

**Step 1: Select Symbols**
- Choose a preset: US Tech, Crypto, Forex, etc.
- Or enter custom symbols (up to 50)

**Step 2: Choose Pattern Types**
Select which patterns to scan for:
- Reversal patterns
- Continuation patterns
- Candlestick patterns
- Fair Value Gaps

**Step 3: Set Filters**
- Time filter (market hours, pre-market, 24/7)
- Minimum confidence level
- Minimum volume

**Step 4: Run Scan**
Click **Start Scan** to begin real-time monitoring.

### Understanding Results

**Live Detection Feed**:
- Real-time pattern triggers
- Symbol, pattern type, confidence
- Current price vs. trigger price

**Warming Patterns**:
- Patterns approaching trigger
- Proximity percentage shown
- Get ahead of the signal

**Stats**:
- Patterns detected today
- Hit rate by pattern type
- Best performing times

### One-Click Alerts
From any detection:
1. Click the **Alert** icon
2. Choose notification method
3. Alert is automatically configured

### Export Data
Click **Export CSV** to download detection history for analysis.

---

## Setting Up Alerts

Never miss a pattern with automated alerts.

### Creating a Pattern Alert

1. Go to **Patterns > Alerts**
2. Click **New Alert**
3. Configure:
   - **Symbol** — Which asset to watch
   - **Pattern Types** — Which patterns to detect
   - **Conditions** — Minimum confidence, etc.
   - **Notifications** — Push, email, or both

### Alert Types

| Type | Triggers When |
|------|---------------|
| Pattern Detection | Specified pattern forms |
| FVG Created | New gap appears |
| Support/Resistance | Price approaches level |
| Breakout | Price breaks key level |
| Warming | Pattern approaching trigger |

### Managing Alerts
- **View Active**: Patterns > Alerts
- **Pause**: Click toggle to disable temporarily
- **Edit**: Click alert to modify
- **Delete**: Click trash icon

### Notification Options
- **Push** — Browser/mobile notifications
- **Email** — Sent to your account email
- **Webhook** — Send to external service

---

## Timing Analysis

Understand when patterns are most reliable.

### Viewing the Heatmap
1. Go to **Patterns > Timing**
2. Select pattern type
3. View hour-by-hour reliability

### Reading the Heatmap
- **Darker colors** = Higher pattern frequency
- **Lighter colors** = Lower frequency
- Look for consistent high-activity periods

### Best Trading Hours
The system shows:
- Best hours for each pattern type
- Worst hours (avoid trading)
- Abnormal timing flags

### Abnormal Timing Badges
When a pattern fires at an unusual time:
- You'll see a warning badge
- Consider whether it's a valid signal
- Unusual ≠ invalid, but exercise caution

---

## Pattern Auto-Trading

Let the system trade patterns automatically.

### Enabling Auto-Trading
1. Go to **Trading > Strategies**
2. Create or select a pattern-based strategy
3. Configure entry/exit rules
4. Enable in paper mode first

### Configuration Options
- Which patterns trigger trades
- Position size per trade
- Stop loss and take profit levels
- Maximum daily trades

### Safety Features
- Paper trading first (required)
- Daily trade limits
- Loss limits
- Manual override always available

---

## Custom Pattern Import

Teach the system your own patterns.

### Upload Options
- **Screenshot** — Upload a chart image
- **Description** — Describe in plain text
- **Drawing** — Use the drawing tool

### How It Works
1. Go to **Patterns > Custom**
2. Click **Import Pattern**
3. Upload or describe your pattern
4. AI analyzes and creates detection rules
5. Review and approve

### Best Practices
- Use clear, high-quality images
- Include multiple examples
- Describe specific characteristics
- Test in paper mode

---

## Using Patterns in Strategies

Incorporate pattern signals into AI trading strategies.

### Available Pattern Signals
| Signal | Description |
|--------|-------------|
| `fvg_detected` | Fair Value Gap present |
| `bullish_candle_pattern` | Bullish candlestick formed |
| `bearish_candle_pattern` | Bearish candlestick formed |
| `support_bounce` | Price at support |
| `resistance_rejection` | Price at resistance |
| `breakout` | Key level broken |

### Example Strategy Logic
"Buy when bullish engulfing pattern AND price above 50-day MA AND RSI below 50"

---

## Tips for Pattern Trading

### Do
- Confirm patterns with other indicators
- Wait for pattern completion
- Use appropriate position sizing
- Set stop losses
- Track your pattern performance

### Don't
- Trade every pattern blindly
- Ignore the broader trend
- Overlever on pattern signals
- Skip confirmation signals

### Pattern Reliability
Not all patterns are equal:

| Reliability | Patterns |
|-------------|----------|
| High | Morning/Evening Star, Engulfing |
| Medium | Hammer, Shooting Star, Double Top/Bottom |
| Lower | Doji, Spinning Top (need confirmation) |

---

## Next Steps

1. **Enable FVG overlay** on your favorite charts
2. **Set up your first alert** for a high-conviction pattern
3. **Try Pattern Hunter** with a preset market scan
4. **Review timing analysis** for your trading hours

---

*Pattern detection is a tool, not a guarantee. Always use proper risk management.*
