Take the square root of the selected value (lowest and or highest point).
Add (for up or subtract for down) 0.25 for every 45 degrees of rotation to the desired calculation.
Square this. Round to two decimal places.
For example: $65,000 will be scaled down to 650 for Gann calculations, and then the outputs will be rescaled (multiplied by 100 in this instance) before being drawn on the chart.
- Take the logarithm of the highest price visible on the chart. Divide this by the logarithm of 10 and subtract 3, stopping at 0. This gives the scaling magnitude.
magnitude = math.max(0, math.ceil(math.log(high_vis) / math.log(10)) - 3)- Divide the highest (or lowest) visible price on the chart by 10 raised to magnitude (10^magnitude).
high_vis / math.pow(10, magnitude)
low_vis / math.pow(10, magnitude)- Perform regular Gann calculations with these as the high and low inputs (see indicator description above for details).
- Scale up the Gann calculation outputs by multiplying by10^magnitude and draw to chart.
gann * math.pow(10, magnitude)
Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.