Core Strategy Logic

PART 1: STRATEGY DOCUMENTATION

OVERVIEW & TRADING PHILOSOPHY

The TradersAlly Trendline Breaker Strategy combines four distinct trading methodologies into one comprehensive system. Each methodology can operate independently or in compound mode (requiring multiple confirmations). The strategy supports both fully automated trading and discretionary one-shot trades that bypass filters.

Core Trading Methodologies:

  1. Trendline Breaks: Trades breakouts of automatically drawn trendlines

  2. Flag Patterns: Identifies bull/bear flag continuations

  3. Volume Tipping: Two-bar volume reversal patterns

  4. Congestion Breakouts: Range breakout trades


1. HOW THE TRADING LOGIC WORKS

1.1 Entry Signal Flow

For Automated Trades:

  1. Signal detection (trendline break, flag, volume spike, or congestion breakout)

  2. Apply enabled filters in sequence:

    • Time filter (if enabled)

    • HTF bar direction check (trendline breaks ONLY)

    • HTF wick rejection check (trendline breaks ONLY)

    • Volume histogram filter (trendline breaks ONLY)

    • Momentum filter (if enabled - applies to ALL trade types)

    • Signal bar size check (minimum body points)

    • Wick-to-body ratio check

    • Distance from trendline check (trendline breaks only)

    • Previous bar breakout confirmation

  3. If ALL filters pass → Submit trade

For Discretionary Trades:

  1. Arm the specific trade type via addon

  2. Wait for signal

  3. Skip ALL filters except:

    • Basic signal validity

    • Stop loss calculation feasibility

    • Max risk check

  4. Submit trade immediately

1.2 Position Management Logic

Entry Execution:

  • Market Orders: Used for confirmed signals and discretionary trades

  • Stop Orders: Used for pending flag entries (when CF=OFF)

  • Two-Part Entry: Base + Runner positions enter simultaneously

Exit Management:

  • Protective stops placed immediately after fill

  • Target orders placed based on R:R or fixed ticks

  • Runner stop trails to breakeven after base target hit (if enabled)

  • All exits cancelled if position goes flat unexpectedly


2. TRADE MANAGEMENT PARAMETERS (DETAILED)

2.1 Position Sizing & Risk

Base Order Quantity (Default: 1)

  • Your primary position size

  • This position targets the closer profit level

  • Always enters if quantity > 0

Enable Runner Position (Default: OFF)

  • Adds a second position for extended targets

  • Useful for trending markets

  • Runner can trail to breakeven for risk-free trade

Runner Quantity (Default: 1)

  • Size of the secondary position

  • Often kept smaller than base for risk management

  • Only active when "Enable Runner" is ON

Max Risk In Points (Default: 20, 0=disabled)

  • CRITICAL SAFETY FEATURE

  • Calculates distance from entry to stop in points

  • Rejects ANY trade exceeding this threshold

  • Applies to ALL trade types (automated and discretionary)

  • Example: With 20 points max risk on ES, rejects trades risking >$1000 per contract

2.2 Stop Loss Modes (CRITICAL TO UNDERSTAND)

Signal Bar Extreme + Buffer (Default mode)

  • Logic: Places stop at the high (for shorts) or low (for longs) of the ENTRY bar

  • Buffer: Adds X ticks beyond the extreme as safety margin

  • Best for: Tight stops on strong directional bars

  • Risk: Can be stopped out quickly on volatile bars

Previous Bar Extreme + Buffer

  • Logic: Uses the bar BEFORE the signal bar for stop placement

  • Buffer: Same tick buffer concept

  • Best for: Giving trades more room to breathe

  • Common use: When signal bar is inside previous bar's range

Fixed Ticks

  • Logic: Always places stop X ticks from entry

  • Consistency: Same risk on every trade

  • Downside: Ignores market structure

  • Note: Enables fixed take profit option

Signal Bar SL Buffer (Default: 2 ticks)

  • Extra safety margin beyond bar extremes

  • Prevents stops at exact highs/lows where stops cluster

  • Increase in volatile markets

2.3 Profit Targets

Base Reward:Risk Ratio (Default: 1:2)

  • Multiplies your risk to set target

  • Example: Risk 10 ticks → Target 20 ticks at 1:2

  • Only applies when NOT using fixed tick mode

Runner Reward:Risk Ratio (Default: 1:3)

  • Typically set higher than base for trending captures

  • Same calculation method as base

Fixed Take Profit (Only with Fixed SL mode)

  • Overrides R:R calculation

  • Sets exact tick distance for target

  • Provides consistent profit targets

Trail Runner to Breakeven

  • Activated AFTER base position hits target

  • Moves runner stop to entry price + buffer

  • Creates risk-free opportunity for extended gains

  • Buffer prevents premature stops at exact breakeven


3. AUTOMATED TRADING STRATEGIES (DETAILED LOGIC)

3.1 TRENDLINE BREAK TRADING

How It Works:

  1. Trendline Drawing: System identifies swing highs/lows based on "Strength" parameter

  2. Trend Detection: Connects pivot points to form up/down trendlines

  3. Break Signal: Triggered when price closes beyond trendline

  4. Direction: Break of downtrend = LONG, Break of uptrend = SHORT

Specific Filters (ONLY apply to trendline breaks):

  • HTF Bar Filter: Requires higher timeframe bar to align with trade direction

  • HTF Wick Filter: Blocks trades if HTF bar shows rejection (large wicks)

  • Volume Filter: Requires momentum histogram above/below threshold

  • Max Breakout Distance: Prevents chasing extended moves

  • Min Open Distance: Ensures bar opened with room from trendline

Trendline Compound Mode:

  • When ON: Requires trendline break + another signal (flag/volume/congestion)

  • Dramatically reduces trade frequency

  • Increases win rate potential

  • All signals must occur on SAME bar

Key Parameters:

  • Strength (1-20): Higher = fewer, more significant trendlines

  • Trendline Distance Threshold: Minimum points from current price for consideration

3.2 FLAG PATTERN TRADING

How It Works:

  1. Pole Detection: Identifies strong directional move

  2. Flag Formation: Spots consolidation against trend

  3. Stochastic Filter: Confirms overbought/oversold condition

  4. Entry Signal: Break of flag boundary in trend direction

Entry Methods:

  • CF OFF: Places pending stop order above/below flag

  • CF ON: Waits for close beyond flag level, enters at market

Critical Parameters:

  • Flag Buffer: Ticks beyond flag high/low for entry

  • Flag Lookback: Bars to identify pole (larger = major flags only)

  • Bull Flag Level (Default: 75): Stochastic must exceed for bull flag

  • Bear Flag Level (Default: 25): Stochastic must be below for bear flag

Important Notes:

  • Flags are continuation patterns (trade WITH prior trend)

  • Dynamic adjustment: Pending orders update if flag boundaries move

  • Expiry: Pending orders cancel after X bars (PendingOrderExpiryBars)

3.3 VOLUME TIPPING TRADING

Two-Part Pattern Recognition:

For LONG:

  1. Part 1: DOWN volume spike (first signal)

  2. Part 2: UP volume spike within lookback window

  3. Condition: Part 2 close > Part 1 open

  4. Distance: Price movement < VT Max Distance

  5. Confirmation: Requires additional signal OR in congestion zone

For SHORT:

  1. Part 1: UP volume spike (first signal)

  2. Part 2: DOWN volume spike within lookback window

  3. Condition: Part 2 close < Part 1 open

  4. Distance & Confirmation: Same as long

VT Congestion Variation (When enabled):

  • Allows VT completion INSIDE congestion zones

  • Replaces need for additional signal

  • Logic: Congestion zones often precede breakouts

Key Parameters:

  • VT Lookback Bars (3-10): Window for opposite signal

  • VT Max Distance: Maximum point spread between signals

  • Arrow Sensitivity: Threshold for volume spike detection

3.4 CONGESTION BREAKOUT TRADING

How It Works:

  1. Zone Formation: X consecutive bars within prior bar's range

  2. Boundaries Set: Highest high and lowest low of congestion

  3. Breakout Signal: Close beyond zone boundaries

  4. Entry: At close of breakout bar

Congestion-Specific Features:

  • Stop Placement: Uses opposite zone boundary (not bar extreme)

  • Max Breakout Distance: Prevents late entries after explosive moves

  • Visual Zones: Shaded areas on chart when indicator enabled

Compound Mode:

  • Requires congestion breakout + another signal type

  • Particularly effective with volume confirmation


4. FILTER SYSTEM (DETAILED APPLICATION)

4.1 UNIVERSAL FILTERS (Apply to ALL trade types)

Time Filter

  • Restricts ALL trades to specified hours

  • Useful for session-specific strategies

  • Example: Trade only RTH (9:30-16:00)

Momentum Filter

  • Requires momentum indicator above/below thresholds

  • Different thresholds for long/short

  • Period adjustable for sensitivity

Signal Bar Requirements

  • Min Body Points: Filters out doji/small bars

  • Max Wick Ratio: Rejects bars with excessive wicks

  • Example: 0.6 ratio = wick can't exceed 60% of body

Max Risk Filter

  • Universal safety net

  • Applies AFTER stop calculation

  • Protects account from outsized losses

4.2 TRENDLINE-SPECIFIC FILTERS

HTF Bar Direction (ONLY for trendline breaks)

  • Checks higher timeframe bar color

  • Long trades need bullish HTF bar

  • Short trades need bearish HTF bar

  • Prevents counter-trend trades

HTF Wick Rejection (ONLY for trendline breaks)

  • Calculates wick percentage of HTF bar

  • Blocks trades showing rejection

  • Threshold typically 30-50%

Volume Histogram Filter (ONLY for trendline breaks)

  • Uses TradersAllyVolume momentum histogram

  • Longs need positive histogram

  • Shorts need negative histogram

4.3 CLOSE FILTERS (CF) - TIMING CONTROL

Understanding Close Filters:

  • CF OFF: Immediate pending order at signal detection

  • CF ON: Wait for bar close confirmation, then market entry

Application by Trade Type:

  • Breakout CF: Affects discretionary trendline trades

  • Flag CF: Affects discretionary flag trades

  • Volume CF: Affects discretionary volume trades

When to Use CF ON:

  • Avoiding false breakouts

  • Reducing whipsaws

  • Trading higher timeframes

When to Use CF OFF:

  • Capturing momentum immediately

  • Scalping strategies

  • Clear breakout levels


5. MARKET HEALTH MONITORING SYSTEM

5.1 What It Measures

Price Structure Analysis:

  • VWAP-EMA Distance: Measures trend strength

  • Threshold: Default 6 points

  • Above threshold = Trending market

  • Below threshold = Consolidating/ranging

Volume Health Analysis:

  • Fast MA - Slow MA: Volume momentum

  • Positive difference = Increasing volume (healthy)

  • Negative difference = Decreasing volume (weak)

HTF Volume Monitoring:

  • Tracks higher timeframe volume histogram

  • States: Consolidating → Trending → Overextended

  • Arrow signals indicate significant spikes

Volatility Metrics:

  • ATR: Average True Range for volatility

  • Stochastics: Overbought/oversold conditions

5.2 How to Use Market Health

These metrics are INFORMATIONAL ONLY - they don't filter trades

Trending Market (VWAP-EMA wide):

  • Favor continuation trades

  • Use wider stops

  • Enable runner positions

Consolidating Market (VWAP-EMA narrow):

  • Favor range trades

  • Reduce position size

  • Consider congestion breakout strategy

Healthy Volume (positive fast-slow):

  • Confirms breakout potential

  • Supports larger positions

Weak Volume (negative fast-slow):

  • Warning of false breakouts

  • Consider reducing activity


6. INDICATOR VISUAL SETTINGS

6.1 Trendline Indicator Display

Show History

  • ON: Displays all historical trendlines

  • OFF: Shows only active/current trendlines

  • Performance: OFF reduces CPU load

Show Flags

  • Displays bull/bear flag markers on chart

  • Visual confirmation of pattern detection

  • Helps understand flag formation criteria

Alert Settings

  • Controls popup alerts (not audio)

  • Audio controlled separately via strategy

6.2 Volume Indicator Display

Show Arrows

  • UP arrows: Bullish volume spikes

  • DOWN arrows: Bearish volume spikes

  • Size indicates strength

Arrow Sensitivity

  • Higher value = fewer arrows

  • 2.0 = 2x previous bar required

  • 3.0 = 3x previous bar required

Color Bars

  • Changes bar colors based on volume

  • Can be distracting for price action traders

6.3 Congestion Zones

Visual Elements:

  • Shaded rectangles for congestion zones

  • Extended borders show historical zones

  • Opacity adjustable for visibility

Last updated