"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 pieno spirito TradingView, l'autore di questo script lo ha pubblicato open-source, in modo che i trader possano comprenderlo e testarlo. Complimenti all'autore! Puoi usarlo gratuitamente, ma il riutilizzo di questo codice nelle pubblicazioni è disciplinato dal nostro Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.