XrayTrades

Dynamic Gann Levels [XrayTrades]

XrayTrades 업데이트됨   
This indicator dynamically captures the highest and lowest points visible on the chart and calculates Gann Support and Resistance Levels. The inputs are detailed below.

Why create this indicator?
There is no other indicator with the same functionality on TradingView.
These calculations are time-consuming; the speed at which this indicator calculates any number of rotations and degrees and visually displays them on the chart is invaluable to me, and hopefully others who use/perform these calculations.

Works on any time frame:
Year, month, week, day, etc. Smaller timeframes (intraday) for higher prices may require adjusting the y-axis of the chart after the calculation of levels due to the nature of squaring numbers.

Inputs:
  • Resistance: Up (from pivot low) - This toggles on/off levels calculated from the lowest point visible on the chart’s current view.
  • Support: Down (from pivot high) - This toggles on/off levels calculated from the highest point visible on the chart’s current view.
  • 360 - Toggles on/off the levels of full rotations (360 degrees) from price
  • 180 - Toggles on/off the levels of half rotations (180 degrees) from price
  • 90 - Toggles on/off the levels of quarter rotations (90 degrees) from price
  • 45 - Toggles on/off the levels of eighth rotations (45 degrees) from price
  • Full Rotations Visible - The number of rotations to be displayed on the chart

How to use this indicator:
  1. Adjust chart window to change the highs and lows.
  2. Select the degrees, direction, and number of rotations in the indicator settings.
  3. The colored values beside the indicator represent the values (high and low) used in generating the Gann levels. Should the cursor be on the chart, ensure it is to the right of the high and low pivots, as this is dynamic in TradingView depending upon cursor location. Note: This is only for the user to know which value(s) are used; cursor position does not impact actual calculations and levels displayed.
  4. The levels will be drawn to the right of the most recent price, labeled with the degrees and direction as well as the price value at the level.

About the calculations:
These calculations are derived from the Natural Square Calculator of Gann Theory, also known as the Square of Nines.
  • Details:
    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.
  • Ex: Low of 100. Calculate Gann resistance level for 360 degrees. (√(100)+2)² = 144.
  • Ex: High of 100. Calculate Gann support level for 180 degrees. (√(100)-1)² = 81.
릴리즈 노트:
Added Feature - Scaling Down Large Numbers

Why: Requested by indicator users.
What: Allows the indicator to scale down numbers larger than 1000 (normalize to three digits) for Gann calculations and then rescale (restore) the output to the original magnitude before charting levels.
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.
Toggle: By default, this operation is enabled but can be turned off in the settings.

How: Details on the mathematics behind this feature:
  1. 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)
  2. 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)
  3. Perform regular Gann calculations with these as the high and low inputs (see indicator description above for details).
  4. Scale up the Gann calculation outputs by multiplying by10^magnitude and draw to chart.
    gann * math.pow(10, magnitude)
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?