For long time I have been getting many requests about Gann Fan indicator. now we have linefill() function in Pine Language and I think it's right time to make Indicator. Many Thanks to Pine Team for adding many new features to the Pine Language!
How this indicator works:
- It calculates midline (1/1)
- By using midline it calculates other lines (1/2, 1/3, 1/4...etc)
- It calculates highest/lowest in last 280 bars.(by default it's 280 bars, you can change it and period)
- It checks the location of highest/lowest
- After the calculation of the lines, it draws lines, puts Labels and paints the zones between the lines according to the colors set by the user
Long time ago I created a special algorithm for calculating the line with 45 degree and I used it for "1/1" line. Anybody who needs it can use this algorithm freely ;)
You can change following items;
- The colors
- Transparency. Possible values for transparency are from 0 (not transparent) to 100 (invisible)
- Line styles
- Loopback Period (by default it's 280)
- Period (by default it's 5)
- Enable/disable Labels
- Label location (by default it's 50
Tradingview page: The is a tool created by WD . The tool is comprised of 9 diagonal lines (extending indefinitely) designed to show different levels on a chart. These angles -drawn from main tops and bottoms- divide time and price into proportionate parts and are often used to predict areas of , key tops and bottoms and future price moves. Please note that the chart needs to be scaled properly to ensure the market has a square relationship....
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 a publication is governed by House Rules. You can favorite it to use it on a chart.