INVITE-ONLY SCRIPT

FeraTrading Pattern Recognition Engine

49
🧠 Overview:
The FeraTrading Pattern Recognition Engine (PRE) is a real-time lightweight pattern recognition model that identifies repeatable market features and turns them into actionable directional signals. By encoding market behavior through configurable feature sets and tracking their historical outcomes, this engine isolates high-probability bull and bear patterns that have consistently reached a specified profit target within a set timeframe.

Unlike traditional indicators that rely on static rules or hardcoded patterns, this system adapts to live market conditions by learning from what has actually worked before—making it ideal for traders who want evolving, data-backed entries that are specific to the current behavior of the market.

⚙️ How It Works:

🔹 Pattern Encoding:
The engine transforms recent bar data into a unique pattern ID using up to five configurable features:
- Candle Type: Bullish, Bearish, or Doji
- RSI Filter: Whether RSI is above or below 50
- High/Low Behavior: Higher highs or lower lows
- Volume Spike: Whether volume exceeds 1.5× the 20-bar average
- Relative Range: If bar range is greater than the 5-bar average
-More features will be added later along with a custom feature option

These features are encoded over a rolling lookback window (1–60 bars), producing a distinct pattern signature. Each bullish and bearish pattern is evaluated separately.

🔹 Pattern Evaluation & Learning:
Each time a new pattern is detected, the engine:
1. Records the pattern’s ID.
2. Checks if price moves the required percentage (e.g. +0.25% or -0.25%) within the specified number of forward bars.
3. Marks the pattern as a win if the move occurs, and logs the outcome.
4. Tracks how often each pattern has occurred and how successful it has been.

Only patterns with 10 or more past occurrences are considered for live signals, reducing noise from random coincidences.

🔹 Live Signal Generation:
The engine constantly scans for the highest-accuracy bullish and bearish patterns that meet the minimum sample size. If today’s market matches one of these top performers, a live signal is triggered:

- Green Triangle (below bar): Match with best bullish pattern
- Red Triangle (above bar): Match with best bearish pattern

Signals are shown one bar after pattern completion, ensuring they are confirmed and not subject to repainting.

🧮 Inputs & Customization:

🔧 Learning Settings:
- Target Move %: How far price must move for a pattern to be counted as successful.
- Lookback Bars: Number of bars used to define the pattern signature.
- Bars Forward: Number of bars ahead in which price must reach the target move.

🧩 Feature Toggles:
Each of the following features can be toggled on/off independently:

🔹 Feature 1: Candle Type
- Classifies each candle as Bullish, Bearish, or Doji.
- A candle is a Doji if the body is less than 25% of the total range.
- Purpose: Captures directional intent and indecision.

🔹 Feature 2: RSI > 50 < RSI
- Returns if RSI is greater or less than 50.
- Purpose: Adds momentum bias into pattern context.

🔹 Feature 3: Higher High / Lower Low
- Bullish: current high > previous high.
- Bearish: current low < previous low.
- Purpose: Tracks breakout structure or trend continuation.

🔹 Feature 4: Volume Spike
- Returns if volume is greater than 1.5 × 20-bar volume average.
- Purpose: Filters for general aggressive participation.

🔹 Feature 5: Relative Range
- Returns if current range > 5-bar average range.
- Purpose: Highlights bars with above-average volatility.

Fewer features = faster learning, broader generalization.
More features = greater precision, but slower pattern sample growth (may lead to overfitting/ we recommend only using 2 or 3 features at once).

🔄 Signal Toggles:
- Enable Long Signals: Turn bullish pattern signals on or off.
- Enable Short Signals: Turn bearish pattern signals on or off.

🎯 What Makes It Original:
- Real-time learning engine that evolves as it sees more data.
- Automatically identifies top-performing patterns with high statistical accuracy.
- One-bar delayed confirmation ensures signals are stable and non-repainting.
- Capable of scaling across instruments, timeframes, and market types.

✅ How to Use:
1. Ideal on 1m–30m timeframes
2. Watch for green/red triangles that represent the top-performing bullish and bearish patterns.
3. Combine signals with your own strategy, structure, or volume analysis for additional confluence.
4. Ideal for breakout traders, pattern-based systems, or data-driven confirmation overlays.

As time goes on, the engine becomes more selective and intelligent—allowing traders to benefit from true price behavior, not fixed formulas. You can observe this taking place by looking at the beginning of your chart: The beginning should show more signals than the current market. This also helps reveal market structure changes.

Fun Fact: This engine can recognize up to 2.56 × 10¹⁴³ unique pattern combinations — that’s a number with 144 digits! However, this is limited by Pine Script Limitations.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.