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)
W prawdziwym duchu TradingView autor tego skryptu opublikował go jako open source, aby inwestorzy mogli go zrozumieć i zweryfikować. Pozdrowienia dla autora! Możesz go używać bezpłatnie, ale ponowne użycie tego kodu w publikacji podlega Zasadom Regulaminu. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.