Trendline Breaks with Multi Fibonacci Supertrend Strategy by FibonacciFlux

By FibonacciFlux

Performance Metrics

Description

Mar 24TMFS Strategy: Advanced Trendline Breakouts with Multi-Fibonacci SupertrendElevate your algorithmic trading with institutional-grade signal confluenceStrategy Genesis & EvolutionThis advanced trading system represents the culmination of a personal research journey, evolving from my custom "Multi Fibonacci Supertrend with Signals" indicator into a comprehensive trading strategy. Built upon the exceptional trendline detection methodology pioneered by LuxAlgo in their "Trendlines with Breaks" indicator, I've engineered a systematic framework that integrates multiple technical factors into a cohesive trading system.Core Fibonacci PrinciplesAt the heart of this strategy lies the Fibonacci sequence application to volatility measurement:Pine Script®// Fibonacci-based factors for multiple Supertrend calculationsfactor1 = input.float(0.618, 'Factor 1 (Weak/Fibonacci)', minval = 0.01, step = 0.01)factor2 = input.float(1.618, 'Factor 2 (Medium/Golden Ratio)', minval = 0.01, step = 0.01)factor3 = input.float(2.618, 'Factor 3 (Strong/Extended Fib)', minval = 0.01, step = 0.01)These precise Fibonacci ratios create a dynamic volatility envelope that adapts to changing market conditions while maintaining mathematical harmony with natural price movements.Dynamic Trendline DetectionThe strategy incorporates LuxAlgo's pioneering approach to trendline detection:Pine Script®// Pivotal swing detection (inspired by LuxAlgo)pivot_high = ta.pivothigh(swing_length, swing_length)pivot_low = ta.pivotlow(swing_length, swing_length)// Dynamic slope calculation using ATRslope = atr_value / swing_length * atr_multiplier// Update trendlines based on pivot detectionif bool(pivot_high) upper_slope := slope upper_trendline := pivot_highelse upper_trendline := nz(upper_trendline) - nz(upper_slope)Expand 8 linesThis adaptive trendline approach automatically identifies key structural market boundaries, adjusting in real-time to evolving chart patterns.Breakout State ManagementThe strategy implements sophisticated state tracking for breakout detection:Pine Script®// Track breakouts with state variablesvar int upper_breakout_state = 0var int lower_breakout_state = 0// Update breakout state when price crosses trendlinesupper_breakout_state := bool(pivot_high) ? 0 : close > upper_trendline ? 1 : upper_breakout_statelower_breakout_state := bool(pivot_low) ? 0 : close upper_breakout_state[1]bool new_lower_breakout = lower_breakout_state > lower_breakout_state[1]Expand 6 linesThis state-based approach enables precise identification of the exact moment when price breaks through a significant trendline.Multi-Factor Signal ConfluenceEntry signals require confirmation from multiple technical factors:Pine Script®// Define entry conditions with multi-factor confluencelong_entry_condition = enable_long_positions and upper_breakout_state > upper_breakout_state[1] and // New trendline breakout di_plus > di_minus and // Bullish DMI confirmation close > smoothed_trend // Price above Supertrend envelope// Execute trades only with full confirmationif long_entry_condition strategy.entry('L', strategy.long, comment = "LONG")Expand 4 linesThis strict requirement for confluence significantly reduces false signals and improves the quality of trade entries.Advanced Risk ManagementThe strategy includes sophisticated risk controls with multiple methodologies:Pine Script®// Calculate stop loss based on selected methodget_long_stop_loss_price(base_price) => switch stop_loss_method 'PERC' => base_price * (1 - long_stop_loss_percent) 'ATR' => base_price - long_stop_loss_atr_multiplier * entry_atr 'RR' => base_price - (get_long_take_profit_price() - base_price) / long_risk_reward_ratio => na// Implement trailing functionalitystrategy.exit( id = 'Long Take Profit / Stop Loss', from_entry = 'L', qty_percent = take_profit_quantity_percent, limit = trailing_take_profit_enabled ? na : long_take_profit_price, stop = long_stop_loss_price, trail_price = trailing_take_profit_enabled ? long_take_profit_price : na, trail_offset = trailing_take_profit_enabled ? long_trailing_tp_step_ticks : na, comment = "TP/SL Triggered")Expand 14 linesThis flexible approach adapts to varying market conditions while providing comprehensive downside protection.Performance CharacteristicsRigorous backtesting demonstrates exceptional capital appreciation potential with impressive risk-adjusted metrics:Remarkable total return profile (1,517%+)Strong Sortino ratio (3.691) indicating superior downside risk controlProfit factor of 1.924 across all trades (2.153 for long positions)Win rate exceeding 35% with balanced distribution across varied market conditionsInstitutional ConsiderationsThe strategy architecture addresses execution complexities faced by institutional participants with temporal filtering and date-range capabilities:Pine Script®// Time Filter settings with flexible timezone supportimport jason5480/time_filters/5 as time_filtersrc_timezone = input.string(defval = 'Exchange', title = 'Source Timezone')dst_timezone = input.string(defval = 'Exchange', title = 'Destination Timezone')// Date range filtering for precise execution windowsuse_from_date = input.bool(defval = true, title = 'Enable Start Date')from_date = input.time(defval = timestamp('01 Jan 2022 00:00'), title = 'Start Date')// Validate trading permission based on temporal constraintsdate_filter_approved = time_filter.is_in_date_range( use_from_date, from_date, use_to_date, to_date, src_timezone, dst_timezone)Expand 9 linesThese capabilities enable precise execution timing and market session optimization critical for larger market participants.AcknowledgmentsSpecial thanks to LuxAlgo for the pioneering work on trendline detection and breakout identification that inspired elements of this strategy. Their innovative approach to technical analysis provided a valuable foundation upon which I could build my Fibonacci-based methodology.This strategy is shared under the same Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license as LuxAlgo's original work.Past performance is not indicative of future results. Conduct thorough analysis before implementing any algorithmic strategy.Apr 4Release NotesAddressing Moderation Feedback: Enhanced Clarity and RealismThis addendum clarifies key aspects of the TMFS Strategy in response to TradingView Moderation feedback, focusing on demonstrating originality beyond a simple indicator combination and providing context for realistic strategy application.Originality: Synergistic Integration, Not Just CombinationTMFS's originality lies in its *synergistic integration* of components, not just their aggregation. Key aspects include:Harmonic Volatility Context: Specific Fibonacci ratios (0.618, 1.618, 2.618) are intentionally used in the multi-level Supertrend, aiming for a volatility analysis potentially more attuned to market harmonics. The averaged and smoothed result creates a *unique dynamic filter* for breakouts.Multi-Stage Confluence Validation: The core innovation is the *strict three-tiered validation*: a Trendline Break *must* be confirmed by both the price's interaction with the Fibonacci Supertrend dynamic zone *and* by DMI momentum. This engineered confluence represents a distinct methodology designed to significantly enhance signal reliability over simpler approaches.This purpose-built system prioritizes higher signal quality through rigorous, multi-factor validation.Realistic Strategy Settings and Performance ContextTo align with responsible trading practices and moderation guidelines, the strategy defaults have been updated:Pine Script®strategy('TMFS Strategy', ..., initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=4, commission_value=0.03, slippage=2, pyramiding=2) // Key DefaultsRealistic Defaults: Settings now reflect more practical parameters: $10k initial capital, 0.03% commission, 2 ticks slippage. The default risk is set at 4% equity per initial trade (`default_qty_value=4`), a level requiring careful user consideration and adjustment based on individual risk tolerance.Historical Snapshot (Example): Backtesting with these defaults ([Specify Asset/Timeframe/Date Range]) showed an overall Profit Factor of 1.376 and a Max Drawdown of 1.16%. Long performance (PF 1.616) historically outperformed short performance (PF 0.965). Other metrics like Sortino (0.262) and Sharpe (0.129) reflect the specific test period. These are historical metrics, not future guarantees.Risk Management is Crucial: Past results don't predict future outcomes. Market dynamics change. The included risk management tools (stops, targets, trails) *must* be actively used. The `pyramiding = 2` setting increases potential but also risk, demanding careful management.The focus is on providing a robust analytical tool; profitability depends on numerous factors including user implementation and market conditions.Updated Disclaimer Addendum: Risk and ResponsibilityTrading involves substantial risk. TMFS is an analytical tool, not a guaranteed profit system. Past performance is not indicative of future results. Users are solely responsible for their decisions. Thorough testing and risk management are essential. Deploy at your own considered risk.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView