Bull/Bear Extreme Flag
NinjaTrader Strategy Manual
Version 2025-09-09
1. Strategy Overview
The Bull/Bear Extreme Flag is a momentum-reversion hybrid trading strategy designed for NinjaTrader 8. It identifies extreme market conditions using stochastic oscillators and captures mean-reversion opportunities within trending markets defined by exponential moving averages (EMAs).
1.1 Strategy Type
- Momentum/Mean-Reversion Hybrid
- Designed for intraday and swing trading
- Works on any timeframe (recommended: 5-min to 1-hour charts)
- Suitable for futures, stocks, and forex
1.2 Key Features
- Dual stochastic oscillators (fast and slow) for signal confirmation
- Multiple EMA filters to ensure trend alignment
- Split position management: profit targets + runners
- Maximum Favorable Excursion (MFE)-based trailing stops
- Safety net exits to protect against reversals
- Visual feedback with chart markers and labels
2. How the Strategy Works
2.1 Core Concept
The strategy uses a:
- Slow Stochastic (10/60) to identify the overall momentum extremes
- Fast Stochastic (3/9) to pinpoint precise entry timing on short-term reversals
Think of it as waiting for the market to reach an extreme condition (like a rubber band stretched too far), then entering when you see the first sign of snap-back.
2.2 Long Entry Conditions
A long position is triggered when ALL of the following occur:
- Slow Stochastic ≥ Long Overbought Level (default: 85) for at least the specified number of bars (default: 5 bars)
- Fast Stochastic crosses below Long Oversold Level (default: 25) on the current bar
- All enabled EMA filters are satisfied (price above EMA200, EMA50, or EMA20 as configured)
Translation: The market has been in a strong uptrend (slow stochastic high), then experiences a brief pullback (fast stochastic dips), creating a buy opportunity.
2.3 Short Entry Conditions
A short position is triggered when ALL of the following occur:
- Slow Stochastic ≤ Short Oversold Level (default: 15) for at least the specified number of bars (default: 5 bars)
- Fast Stochastic crosses above Short Overbought Level (default: 75) on the current bar
- All enabled EMA filters are satisfied (price below EMA200, EMA50, or EMA20 as configured)
3. Position Management
3.1 Split Entry Strategy
Each entry is automatically split into two components:
- Profit Target Contracts (TP): Designed to capture quick profits at the predefined target level
- Runner Contracts (RUN): Remain in the trade for extended moves using trailing stops
Example: With LotSize = 5 and TargetContracts = 3:
- 3 contracts exit at the profit target
- 2 contracts remain as runners with trailing stops
3.2 Exit Mechanisms
The strategy employs multiple exit methods to protect capital and maximize profits:
| Exit Type |
Applies To |
Description |
| Initial Stop Loss |
TP + RUN |
Fixed stop loss from entry price |
| Profit Target |
TP only |
Fixed profit target for quick gains |
| Trailing Stop |
RUN only |
MFE-based dynamic stop for extended moves |
| Safety Net |
TP + RUN |
Emergency exit on extreme stochastic reversal |
3.2.1 Initial Stop Loss
Protects both TP and RUN contracts from the moment of entry. Set in ticks from entry price. Default: 12 ticks.
3.2.2 Profit Target
Applied only to TP contracts. Exits at a fixed profit level. Default: 30 ticks.
3.2.3 Trailing Stop
The strategy uses an innovative MFE-based trailing stop:
- Maximum Favorable Excursion (MFE) tracking: The strategy tracks the best price achieved since entry
- Trail Activation: When MFE reaches TrailStartTicks (default: 15), the trailing stop is armed
- Dynamic Re-issuing: The trailing stop is re-calculated and re-issued every tick to lock in profits
- Trail Distance: Set by TrailStopTicks (default: 15 ticks from current price)
Visual Indicators: When activated, you'll see an orange "Trailing Stop Active" label and a horizontal line showing the current trailing stop level.
3.2.4 Safety Net
An optional protective mechanism that closes all positions when the fast stochastic reaches an extreme level, signaling potential reversal:
- Long positions: Exit when fast stochastic ≥ 80
- Short positions: Exit when fast stochastic ≤ 20
Safety Net exits are marked with orange labels in smaller font.
4. Strategy Parameters
All parameters are configurable through the NinjaTrader Strategy Analyzer or when adding the strategy to a chart.
4.1 Setup Parameters
| Parameter |
Type |
Default |
Description |
| Enable Longs |
true/false |
true |
Enables long entries when true |
| Enable Shorts |
true/false |
false |
Enables short entries when true |
4.2 Risk Management Parameters
| Parameter |
Type |
Default |
Description |
| LotSize |
Integer |
5 |
Total number of contracts to trade per signal |
| TargetContracts |
Integer |
3 |
Number of contracts allocated to profit target |
| InitialStopTicks |
Integer |
12 |
Initial stop loss distance in ticks from entry |
| TrailStartTicks |
Integer |
15 |
Profit level (in ticks) at which trailing stop activates |
| TrailStopTicks |
Integer |
15 |
Distance in ticks for the trailing stop from current price |
| TakeProfitTicks |
Integer |
30 |
Profit target distance in ticks for TP contracts |
4.3 Long Setup Parameters
| Parameter |
Type |
Default |
Description |
| LongOverbought |
Double |
85 |
Slow stochastic level required for long setup |
| LongOversold |
Double |
25 |
Fast stochastic level that triggers long entry |
| BarsRequiredAbove |
Integer |
5 |
Number of bars slow stochastic must stay above LongOverbought |
4.4 Short Setup Parameters
| Parameter |
Type |
Default |
Description |
| ShortOversold |
Double |
15 |
Slow stochastic level required for short setup |
| ShortOverbought |
Double |
75 |
Fast stochastic level that triggers short entry |
| BarsRequiredBelow |
Integer |
5 |
Number of bars slow stochastic must stay below ShortOversold |
4.5 Filter Parameters
| Parameter |
Type |
Default |
Description |
| UseEMA200Filter |
true/false |
true |
Requires price above EMA200 for longs, below for shorts |
| RequireAboveEMA50 |
true/false |
false |
Requires price above EMA50 for long entries |
| RequireBelowEMA50 |
true/false |
false |
Requires price below EMA50 for short entries |
| RequireAboveEMA20 |
true/false |
false |
Requires price above EMA20 for long entries |
| RequireBelowEMA20 |
true/false |
false |
Requires price below EMA20 for short entries |
| UseSafetyNet |
true/false |
true |
Enables safety net exit mechanism |
5. Visual Chart Indicators
The strategy provides comprehensive visual feedback directly on your chart:
5.1 Entry Markers
- Long Entries: Green rectangle appears below the entry bar
- Short Entries: Red rectangle appears above the entry bar
5.2 Trailing Stop Indicators
- Activation Label: Orange "Trailing Stop Active" text appears when MFE threshold is reached
- Dynamic Line: Orange-red horizontal line shows current trailing stop level, updates each tick
5.3 Exit Labels
All exits are labeled with the reason and P&L amount:
- Profit Target: Green, bold, 12pt font — shows positive P&L
- Initial Stop: Orange-red, bold, 12pt font — shows loss amount
- Trailing Stop: Green or orange-red, bold, 12pt — color depends on P&L
- Safety Net: Orange, regular, 10pt font — smaller to differentiate from other exits
6. Installation and Setup
6.1 Installation
- Open NinjaTrader 8
- Go to Tools > Import > NinjaScript Add-On
- Select the .zip file containing the strategy
- Click Import
- Restart NinjaTrader if prompted
6.2 Adding to a Chart
- Open a chart for your desired instrument
- Right-click the chart and select Strategies
- Click the + button to add a new strategy
- Select "BullFlagExtreme2020" from the list
- Configure your parameters (see Section 4)
- Click OK to apply
6.3 Running Backtests
- Open Tools > Strategy Analyzer
- Click "Add" to add a strategy
- Select "BullFlagExtreme2020"
- Configure instrument, timeframe, and date range
- Set your parameter values
- Click "Run Backtest"
7. Optimization and Best Practices
7.1 Parameter Optimization Guidelines
Stochastic Levels
- For trending markets: Use wider extremes (e.g., LongOverbought = 90, LongOversold = 20)
- For ranging markets: Use tighter extremes (e.g., LongOverbought = 80, LongOversold = 30)
- Test different combinations to match your instrument's volatility
Risk/Reward Settings
- Maintain at least a 2:1 reward-to-risk ratio (TakeProfitTicks / InitialStopTicks)
- Set TrailStartTicks between InitialStopTicks and TakeProfitTicks
- TrailStopTicks should be wide enough to avoid premature exits but tight enough to protect profits
Position Sizing
- Start with smaller LotSize while learning the strategy
- Common split: 60% target contracts, 40% runners (e.g., 3 TP + 2 RUN out of 5 total)
- Never risk more than 1-2% of your account per trade
7.2 Market Considerations
Best Market Conditions
- Trending markets with regular pullbacks
- Markets with defined support and resistance levels
- Sufficient volatility for meaningful profit targets
Challenging Conditions
- Strong trending markets with few pullbacks (too few signals)
- Choppy, sideways markets (frequent whipsaws)
- Low liquidity periods (wide spreads affect exits)
7.3 Timeframe Selection
- 5-minute charts: High frequency, good for scalping (requires constant monitoring)
- 15-minute charts: Balanced approach, suitable for day trading
- 1-hour charts: Fewer signals but higher quality, good for swing trading
- Daily charts: Position trading, lower frequency
8. Risk Disclosure and Disclaimer
IMPORTANT: Please read this section carefully before using this strategy.
8.1 Trading Risks
- Trading futures, stocks, and forex involves substantial risk of loss and is not suitable for all investors
- Past performance is not indicative of future results
- You should carefully consider whether trading is appropriate for you in light of your experience, objectives, financial resources, and other relevant circumstances
- Only risk capital that you can afford to lose
8.2 Strategy Limitations
- This strategy is provided for educational and informational purposes only
- No strategy guarantees profits or prevents losses
- Automated strategies can experience technical failures, connectivity issues, or unexpected market conditions
- Always monitor your automated strategies and have contingency plans
- Thoroughly backtest and forward-test on a demo account before trading live
8.3 No Investment Advice
This strategy and documentation do not constitute investment advice, financial advice, trading advice, or any other sort of advice. You alone are responsible for evaluating the merits and risks of any trades. The developers and distributors of this strategy assume no liability for your trading results.
9. Support and Resources
9.1 Vendor Information
- Vendor: DayTradingRadio
- Product: RockBot1
- Website: www.daytradingradio.com
- Email: ironaction@yahoo.com
9.2 Additional Learning Resources
- NinjaTrader Support: support.ninjatrader.com
- NinjaTrader User Forums: ninjatrader.com/support/forum
- Strategy documentation: NinjaScript section in NinjaTrader Help Guide
9.3 Version History
- Version 2025-09-09: Stable baseline with MFE-based trailing stops, visual indicators, and comprehensive exit labeling
Appendix: Quick Reference Card
Default Settings Summary
| Setting |
Default Value |
| Enable Longs |
True |
| Enable Shorts |
False |
| LotSize |
5 contracts |
| TargetContracts |
3 contracts |
| Initial Stop |
12 ticks |
| Profit Target |
30 ticks |
| Trail Activation |
15 ticks profit |
| Trail Distance |
15 ticks |
| Long Overbought |
85 |
| Long Oversold |
25 |
| Short Oversold |
15 |
| Short Overbought |
75 |
| Bars Required |
5 bars |
| EMA200 Filter |
Enabled |
| Safety Net |
Enabled |
Remember: These are starting points. Optimize for your specific instrument and trading style!
End of Manual
Thank you for using the Bull/Bear Extreme Flag Strategy