Library "FibRatios"
Library with calculation logic for fib retracement, extension and ratios

retracement(a, b, ratio, logScale, precision)
  Calculates the retracement for points a, b with given ratio and scale
  Parameters:
    a: Starting point a
    b: Second point b
    ratio: Ratio for which we need to calculate retracement c
    logScale: Flag to get calculations in log scale. Default is false
    precision: rounding precision. If set to netagive number, round_to_mintick is applied. Default is -1
  Returns: retracement point c for points a,b with given ratio and scale

retracementRatio(a, b, c, logScale, precision)
  Calculates the retracement ratio for points a, b, c with given scale
  Parameters:
    a: Starting point a
    b: Second point b
    c: Retracement point. c should be placed between a and b
    logScale: Flag to get calculations in log scale. Default is false
    precision: rounding precision. If set to netagive number, round_to_mintick is applied. Default is 3
  Returns: retracement ratio for points a,b,c on given scale

extension(a, b, c, ratio, logScale, precision)
  Calculates the extensions for points a, b, c with given ratio and scale
  Parameters:
    a: Starting point a
    b: Second point b
    c: Retracement point. c should be placed between a and b
    ratio: Ratio for which we need to calculate extension d
    logScale: Flag to get calculations in log scale. Default is false
    precision: rounding precision. If set to netagive number, round_to_mintick is applied. Default is -1
  Returns: extensoin point d for points a,b,c with given ratio and scale

extensionRatio(a, b, c, d, logScale, precision)
  Calculates the extension ratio for points a, b, c, d with given scale
  Parameters:
    a: Starting point a
    b: Second point b
    c: Retracement point. c should be placed between a and b
    d: Extension point. d should be placed beyond a, c. But, can be with b,c or beyond b
    logScale: Flag to get calculations in log scale. Default is false
    precision: rounding precision. If set to netagive number, round_to_mintick is applied. Default is 3
  Returns: extension ratio for points a,b,c,d on given scale

Perpustakaan Pine

Di dalam semangat sebenar TradingView, pengarang telah menerbitkan kod Pine ini sebagai perpustakaan sumber terbuka, jadi pengaturcara-pengaturcara Pine yang lain dari komuniti kami boleh menggunakannya semula. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara peribadi atau pada penerbitan-penerbitan sumber terbuka lain, tetapi penggunaan semula kod ini di dalam penerbitan adalah ditadbir oleh Peraturan Dalaman.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Mahu gunakan perpustakaan ini?

Salin garisan ini dan tampalkan ia di dalam skrip anda.