robbatt

lib_priceaction

robbatt Cập nhật   
Library "lib_priceaction"
a library for everything related to price action, starting off with displacements

displacement(len, min_strength, o, c)
  calculate if there is a displacement and how strong it is
  Parameters:
    len (int): The amount of candles to consider for the deviation
    min_strength (float): The minimum displacement strength to trigger a signal
    o (float): The source series on which calculations are based
    c (float): The source series on which calculations are based
  Returns: a tuple of (bool signal, float displacement_strength)
Phát hành các Ghi chú:
v2 tweaked formula

Updated:
displacement(len, min_strength, o, c)
  calculate if there is a displacement and how strong it is
  Parameters:
    len (int): The amount of candles to consider for the deviation
    min_strength (float): The minimum displacement strength to trigger a signal
    o (float): The source series on which calculations are based
    c (float): The source series on which calculations are based
  Returns: a tuple of (bool signal, float displacement_strength)
Phát hành các Ghi chú:
v3, removed rounding
Phát hành các Ghi chú:
v4
Phát hành các Ghi chú:
v5 added functions to calculate retracement ratio AND target price for given ratio

Added:
retracement_ratio(price_start, price_end, price_retracement)
  calculate a ratio how far a price has retraced compared to a move between two reference levels
  Parameters:
    price_start (float): The start price level of the reference move
    price_end (float): The end price level of the reference move
    price_retracement (float): The retraced price level
  Returns: the retracement ratio (float, always positive) or na if one of the inputs was na

target_ratio_price(price_start, price_end, target_ratio)
  calculate a ratio how far a price has retraced compared to a move between two reference levels
  Parameters:
    price_start (float): The start price level of the reference move
    price_end (float): The end price level of the reference move
    target_ratio (float): The target retracement ratio (must be positive)
  Returns: the retracement target ratio price level (float) or na if one of the inputs was na
Phát hành các Ghi chú:
v6

Added:
in_range(x, a, b)
  check if a price is in a certain range, e.g. to check if price reached a target zone
  Parameters:
    x (float): the price variable
    a (float): one range limit (sign agnostic)
    b (float): other range limit (sign agnostic)
  Returns: true if x is between a and b (inclusive)

range_overlap(a1, b1, a2, b2)
  check if two price ranges overlap, e.g. to check if a target is price is possible that fits both target zones
  Parameters:
    a1 (float): one limit of range 1
    b1 (float): other limit of range 1
    a2 (float): one limit of range 2
    b2 (float): other limit of range 2
  Returns: true if x is between a and b (inclusive
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.