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

Thư viện Pine

Với tinh thần TradingView thực sự, tác giả đã xuất bản mã Pine này như một thư viện mã nguồn mở để các lập trình viên Pine khác từ cộng đồng của chúng tôi có thể sử dụng lại nó. Chúc mừng tác giả! Bạn có thể sử dụng thư viện này một cách riêng tư hoặc trong các ấn phẩm mã nguồn mở khác, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy chung.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng thư viện này?

Sao chép văn bản vào khay nhớ tạm và dán nó vào tập lệnh của bạn.