Fracture Threshold Strategy [JOAT] by officialjackofalltrades

By officialjackofalltrades

Performance Metrics

Description

Fracture Threshold Strategy [JOAT]IntroductionFracture Threshold Strategy (FTS) is an open-source, automated Pine Script v6 trading strategy that combines three independent filters — a seven-condition MasterTrend EMA alignment score, a relative volume regime gate, and a session time restriction — into a single, unified entry system. Entry is triggered by an EMA 4/5 crossover when all three filters are simultaneously satisfied. Stop loss is placed at 1.5× ATR from entry. Take profit is set at a 3:1 reward-to-risk ratio by default. All orders are executed on bar close (process_orders_on_close=false), and signals are gated on barstate.isconfirmed to eliminate intrabar repainting.FTS is designed to demonstrate how institutional-grade filtering layers can be combined into a programmatic strategy with realistic, auditable results. It is not a black box — every condition is visible in the dashboard and the source code is fully open. The strategy description explains the exact logic, the default backtesting parameters, and the limitations of any backtesting approach.Core Concepts1. MasterTrend Seven-EMA Alignment ScoreSeven trend conditions are evaluated on each bar. Each satisfied condition contributes one point to a bull or bear score (0–7):EMA 4 above/below EMA 5 — fast momentum directionRSI above/below 50 — momentum confirmationPrice above/below EMA 21 — short-term trendEMA 21 above/below SMA 50 — medium-term structureSMA 50 above/below EMA 55 — medium-to-intermediate trendEMA 55 above/below EMA 89 — intermediate trendPrice above/below EMA 750 — long-term macro trendEntry requires the bull or bear score to equal or exceed the configurable minimum (default: 5 out of 7). This prevents entries during low-conviction, mixed-alignment market conditions.2. Relative Volume Regime GateVolume regime is measured as the ratio of a short-term volume MA to a long-term volume MA, smoothed by an EMA:Pine Script®float volRatio = ta.ema(volShort / math.max(volLong, 1.0), i_volSmth)bool volOK = volRatio >= i_volMinThe default minimum ratio is 0.90 — entries are blocked when recent volume is more than 10% below the long-term average. This prevents the strategy from entering trades during dead, low-participation conditions where institutional order flow is absent.3. Session FilterTrading is restricted to the London session (08:00–17:00) and New York session (14:00–21:00) in the selected timezone, with both independently toggleable. Entries outside the active sessions are blocked. This keeps the strategy focused on the highest-liquidity periods of the trading day.4. EMA 4/5 Crossover Entry TriggerThe entry trigger is an EMA 4 crossover above EMA 5 (for longs) or crossunder (for shorts), evaluated on confirmed bar closes. The crossover is a fast momentum signal — it fires at the beginning of a new short-term directional move. Combined with the full filter stack, it identifies the specific bar where momentum begins aligning with the broader structural trend.5. ATR Stop Loss and 3:1 Take ProfitStop loss is placed at 1.5× ATR from entry. Take profit is placed at 3× the stop distance (configurable). Both levels are computed at entry and fixed — they do not trail. The strategy uses Pine Script's strategy.exit() function with explicit stop and limit prices for clean, non-discretionary execution.Default Backtesting PropertiesThe strategy has been published with the following default Properties settings. These values are used in all performance metrics shown on the chart:Initial Capital: $10,000 (realistic for an individual trader)Position Size: 2% of equity per trade (risk-managed sizing)Commission: 0.05% per side (representative of standard exchange or broker fees)Slippage: 2 ticksPyramiding: 0 (one trade open at a time)process_orders_on_close: false (orders execute on the next bar open, not at the signal bar close)Using 2% of equity per trade with a 1.5× ATR stop means the maximum percentage of equity at risk per trade scales with position size dynamically — at a 3:1 RR ratio, three losing trades in a row lose approximately 6% of equity, which is within the TradingView recommended range. A dataset that generates at least 100 trades is recommended for meaningful statistical evaluation. On lower timeframes (5m, 15m) on major equity indices or forex pairs with London and NY sessions active, the default settings typically produce sufficient trade counts.FeaturesThree-Layer Entry Filter: MasterTrend score, volume regime, and session — all three must be satisfied simultaneouslyConfigurable Minimum Score: Adjustable minimum MasterTrend alignment score threshold (1–7, default: 5)EMA 4/5 Crossover Trigger: Fast momentum crossover as entry signal within aligned conditionsATR Stop Loss: Dynamic stop placement based on current ATR — adapts to instrument volatilityFixed Ratio Take Profit: 3:1 default reward-to-risk — adjustableSession Restriction: London and New York sessions independently configurable with timezone settingVolume Regime Gate: Minimum volume ratio filter blocks entries during low-participation conditionsTP/SL Visualization: Active trade TP and SL boxes drawn from entry and extended on each bar — color changes on outcomeEntry Markers: Triangle plotshapes at long and short entry bars for clear chart identificationEMA Reference Plots: EMA 4, EMA 5, EMA 21, and EMA 750 plotted as referenceNon-Repainting: process_orders_on_close=false; all entry conditions gated on barstate.isconfirmedDashboard (Top Right): Live MasterTrend state, volume regime, session, current position, net P&L, win rate, profit factor, max drawdown, average win/loss, and RR ratioEntry Context Labels: Each entry label now shows the MasterTrend score and volume regime tag at the moment of entry in the format "L 6/7 | V:HI" — full entry context visible on the chart without needing to consult the dashboardPosition Candle Tint: Candles colored green while a long position is open, red while a short position is open — provides an immediate visual record of all trade durations across the full chart historyPer-Session Performance Breakdown: London and New York win rates tracked and displayed separately in the dashboard — identifies which session produces the strongest historical edge for the current instrument and timeframeExpanded Dashboard (15 Rows): Dashboard expanded to 15 rows — now includes a full session performance section with London and NY win rates alongside the existing strategy performance metricsInput ParametersMasterTrend EMA Stack:EMA 4, EMA 5, EMA 21, SMA 50, EMA 55, EMA 89, EMA 750: All periods individually configurableRSI Length: RSI period for momentum condition (default: 14)Volume Regime Filter:Short Vol MA / Long Vol MA: Volume baseline calculation periods (default: 10, 40)Vol Smooth: EMA smoothing for ratio (default: 3)Min Vol Ratio: Minimum ratio threshold for entry permission (default: 0.90)Session Filter:Timezone: Session evaluation timezone (default: America/New_York)Session Filter: Master toggle (default: enabled)Allow London / Allow NY: Independent session toggles (both default: enabled)Entry Trigger:EMA4/5 Cross Entry: Use crossover as trigger (default: enabled)Min MasterTrend Score: Minimum score required for entry (default: 5)Risk Management:ATR Length: ATR period (default: 14)ATR SL Multiplier: Stop distance as ATR multiple (default: 1.5)Reward:Risk Ratio: TP multiple (default: 3.0)How to Use This StrategyStep 1: Verify the Filter Stack is ActiveThe dashboard shows MasterTrend state, volume regime, and current session at all times. Before a trade can occur, all three must be aligned — a bull score ≥ 5, volume ratio ≥ 0.90, and an active London or NY session window.Step 2: Observe the EMA 4/5 CrossoverThe entry trigger is the EMA 4 crossing EMA 5. With all filters active, the next crossover in the trend direction will generate an entry. The entry is executed at the open of the following bar (process_orders_on_close=false), which is the realistic execution point.Step 3: Manage the Open TradeThe TP/SL boxes extend from the entry bar and update on each subsequent bar. The strategy's exit function manages the trade automatically — no manual management is required. The dashboard shows the current position state (LONG / SHORT / FLAT) at all times.Step 4: Evaluate Backtesting Results CriticallyPast results do not predict future performance. Before drawing conclusions from any backtest, ensure the trade count is at least 100. A small sample (under 50 trades) produces unreliable win rate and profit factor estimates. Test across multiple instruments and timeframes — a strategy that performs well on one asset in one period may not generalize.Strategy LimitationsThe EMA 750 requires 750 bars of chart history. On timeframes or instruments with limited bar history, the 750-period EMA will be inaccurate for the first 750 bars — backtest results including those bars should be discountedBacktesting does not account for liquidity, market impact, or partial fills on real orders. The 2-tick slippage setting is an approximation — on illiquid instruments or during news events, actual slippage may be significantly higherThe EMA 4/5 crossover is a fast signal. In choppy, sideways markets where EMAs cross frequently, the strategy may enter multiple trades quickly that all exit at stop loss before the filter stack re-assesses. The session and volume filters reduce but do not eliminate this behaviorA fixed 3:1 RR ratio requires the market to travel 3× the initial risk without reversing. On short timeframes or on instruments with narrow average ranges relative to ATR, achieving the full TP target may be less frequent than on smoother-trending assetsCommissions, taxes, and regulatory fees vary by broker, instrument, and jurisdiction. The 0.05% commission default is a general estimate — actual trading costs should be substituted with broker-specific values before drawing performance conclusionsThis strategy is one specific configuration of the underlying filter system. Adjusting the minimum MasterTrend score, volume threshold, session windows, or RR ratio will produce different results. Any configuration change constitutes a separate strategy with its own performance characteristicsOriginality StatementFTS implements a programmatic entry system by combining a seven-condition quantitative trend score, a relative volume regime gate, and a session time restriction into a unified, fully transparent open-source strategy. This is original for the following reasons:The MasterTrend alignment score functions as a structural quality gate — rather than entering on any EMA crossover, the strategy explicitly requires a minimum number of the seven structural conditions to be simultaneously satisfied, producing a much stricter entry criterion than a standard crossover systemThe volume regime gate uses a normalized ratio (not a raw volume level) to block entries during low-participation conditions — making the filter relevant across instruments and timeframes without requiring instrument-specific volume threshold calibrationThe combination of structural alignment (EMA stack), activity quality (volume regime), and time context (session filter) as three independent prerequisites creates a compounding selectivity effect — the strategy only enters the specific intersection of all three conditions, which is a smaller, higher-conviction subset than any single filter aloneThe live dashboard displaying all filter states, position context, and key performance metrics simultaneously provides full transparency into why any given bar does or does not produce a signal, making the strategy auditable in real timeDisclaimerThis strategy is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Backtesting results shown are based on historical data and do not guarantee or predict future performance. Past results are not indicative of future results. Commission and slippage values used in backtesting are estimates — actual trading costs will vary. The strategy does not account for all real-world execution factors. Always use proper risk management and consult a qualified financial professional before making trading decisions. The author is not responsible for any trading losses resulting from the use of this strategy.-Made with passion by jackofalltrades

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView