OPEN-SOURCE SCRIPT
ATR Trailing SL Fibonacci

ATR Trailing SL Fibonacci Indicator
This indicator combines ZigZag pattern detection with Fibonacci analysis to identify potential support and resistance levels for setting trailing stop losses.
Core Components:
ZigZag Pattern Detection
Uses imported ZigZag library to identify significant price swings
Configurable parameters:
depth: Minimum price movement threshold
deviation: Minimum deviation between swing points
backstep: Number of bars required for reversal confirmation
Fibonacci Analysis
Two display modes:
Retracements: Horizontal Fibonacci levels between ZigZag points
Timezone: Vertical Fibonacci time projections
Customizable Fibonacci levels with individual color settings
Customizable Fibonacci Levels:
Fib 0 (0%) - White
Fib A (23.6%) - Blue
Fib B (38.2%) - Green
Fib C (50%) - Gray (Default: ON)
Fib D (61.8%) - Orange
Fib E (78.6%) - Red
Fib F (100%) - White (Default: ON)
Display Features:
Visual Elements:
ZigZag line connecting swing points (toggleable)
Fibonacci level lines with colored labels
Price level labels at each Fibonacci line
Background color indicating trend direction
Customization Options:
Adjustable label sizes for Fibonacci levels and price labels
Timeframe selection for analysis
Source price selection (High/Low)
Technical Implementation:
Dynamic Updates: Automatically redraws Fibonacci levels when new ZigZag points are detected
Memory Management: Cleans up previous lines and labels to maintain chart cleanliness
Multi-timeframe Analysis: Uses request.security() for higher timeframe analysis
Trading Applications:
Stop Loss Placement: Use Fibonacci levels as dynamic trailing stop levels
Support/Resistance Identification: Key Fibonacci levels act as potential reversal zones
Trend Analysis: ZigZag direction helps identify overall market structure
Risk Management: ATR-based approach to setting stop losses relative to volatility
Usage Tips:
The 50% and 100% levels are enabled by default as they represent key psychological levels
Combine with other indicators for confirmation of Fibonacci level reactions
Use the background color as a quick visual reference for trend direction
Adjust the ZigZag parameters based on market volatility and timeframe
This indicator is particularly useful for traders who employ Fibonacci-based trading strategies and want a systematic approach to setting trailing stop losses based on market structure and key retracement levels.
This indicator combines ZigZag pattern detection with Fibonacci analysis to identify potential support and resistance levels for setting trailing stop losses.
Core Components:
ZigZag Pattern Detection
Uses imported ZigZag library to identify significant price swings
Configurable parameters:
depth: Minimum price movement threshold
deviation: Minimum deviation between swing points
backstep: Number of bars required for reversal confirmation
Fibonacci Analysis
Two display modes:
Retracements: Horizontal Fibonacci levels between ZigZag points
Timezone: Vertical Fibonacci time projections
Customizable Fibonacci levels with individual color settings
Customizable Fibonacci Levels:
Fib 0 (0%) - White
Fib A (23.6%) - Blue
Fib B (38.2%) - Green
Fib C (50%) - Gray (Default: ON)
Fib D (61.8%) - Orange
Fib E (78.6%) - Red
Fib F (100%) - White (Default: ON)
Display Features:
Visual Elements:
ZigZag line connecting swing points (toggleable)
Fibonacci level lines with colored labels
Price level labels at each Fibonacci line
Background color indicating trend direction
Customization Options:
Adjustable label sizes for Fibonacci levels and price labels
Timeframe selection for analysis
Source price selection (High/Low)
Technical Implementation:
Dynamic Updates: Automatically redraws Fibonacci levels when new ZigZag points are detected
Memory Management: Cleans up previous lines and labels to maintain chart cleanliness
Multi-timeframe Analysis: Uses request.security() for higher timeframe analysis
Trading Applications:
Stop Loss Placement: Use Fibonacci levels as dynamic trailing stop levels
Support/Resistance Identification: Key Fibonacci levels act as potential reversal zones
Trend Analysis: ZigZag direction helps identify overall market structure
Risk Management: ATR-based approach to setting stop losses relative to volatility
Usage Tips:
The 50% and 100% levels are enabled by default as they represent key psychological levels
Combine with other indicators for confirmation of Fibonacci level reactions
Use the background color as a quick visual reference for trend direction
Adjust the ZigZag parameters based on market volatility and timeframe
This indicator is particularly useful for traders who employ Fibonacci-based trading strategies and want a systematic approach to setting trailing stop losses based on market structure and key retracement levels.
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。