Gann FanHello All,
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 Gann Fan 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 Pivot Points in last 280 bars.( by default it's 280 bars, you can change it and pivot period )
- It checks the location of highest/lowest Pivot Points
- After the calculation of the Gann Fan 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 ;)
Options:
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)
- Pivot Period (by default it's 5)
- Enable/disable Labels
- Label location (by default it's 50
Tradingview Gann Fan page : The Gann Fan is a technical analysis tool created by WD Gann. The tool is comprised of 9 diagonal lines (extending indefinitely) designed to show different support and resistance 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 support and resistance, 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....
Enjoy!
Degrees
Reference Angle Function - for developers█ OVERVIEW
This function should give you a correct output in a circle of 360°. It is meant to be used by developers/pine-script-coders to figure out reference angles.
Conditions :
1. If the angle given to this function is in between 0-360 then it would give you the same angle without any modifications
2. If the angle given is greater than 360° - for example : 540°, - then it would output 180° which is the angle after a complete revolution.
3. If the angle given is negative, then it would go counter clockwise and give you the angle.
4. If the angle is negative and less than -360°, then it would also give you the actual correct degree after counting the revolution and flipping it to positive.
Feel free to play with it or use it if you need to. I already included some test inputs to show you how it would work.
MouN1R - Price NormalizerPrice normalize through slope on premium / non-premium Exchanger using slope and not direct valuation.
Be careful need understanding of slope degree :)
Have fun