"Fib Speed Resistance Fan," automatically draws Fibonacci Speed Resistance Fan lines based on the first and third candles of the trading session. Here’s a breakdown of its functionality:
Functionality Session Start Time Identification
The script identifies the first candle at 9:15 AM using timestamp(), which ensures it captures the market's opening candle. Candle Indexing
It determines the index of the first candle (firstCandleIndex) using ta.barssince(time >= sessionStart). The third candle is found by adding two bars to the first candle's index (thirdCandleIndex = firstCandleIndex + 2). Ensuring Single Execution
A boolean flag hasDrawn ensures that the lines are drawn only once and do not update on future candles. Validating Data
It checks if the firstCandleIndex and thirdCandleIndex are valid (validSession). If conditions are met, it extracts the highs and lows of the first and third candles. Fibonacci Calculation
The script calculates a 0.75 level price between the first candle high/low and third candle low/high. This level helps in drawing intermediate Fibonacci fan lines. Drawing the Fibonacci Speed Resistance Fan
If conditions are valid and hasDrawn is false, the script draws: Main fan lines from: First candle high → Third candle low (Blue line) First candle low → Third candle high (Blue line)
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publications is governed by House rules. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.
هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.