TradingView
jason5480
10 Th05 2023 19:47

biased_price_target 

BTCUSDT Perpetual ContractBybit

Mô tả

Library "biased_price_target"
Collection of functions that can be used for the calculation of biased price targets like stop loss and
take profit from a reference price using several methods that are already provided by the "distance_ratio" library plus
the 'HHLL'. Methods supported are percentagewise (PERC), atr-based (ATR), fixed profit (PROF), tick-based (TICKS),
risk reward ratio (RR), and highest high/lowest low (HHLL)

Phát hành các Ghi chú

v2
  • Add use case examples
  • Pump distance_ratio library version

Phát hành các Ghi chú

v3
Fix highest high and lowest low use for margin that might result in na value when HHLL was not been used

Phát hành các Ghi chú

v4
Added a more generic 'CUST' method that can embed the HHLL and even more user-defined price targets.
Bình luận
budzap
Impressive... What would you recommend one do if the objective is to identify moments when price exceeds a distance ordinarily observed between two indicators? And to know this before the candle closes on one's chosen trading time-frame? Could this library be adapted to function based upon a user-defined distance (e.g., between a slow ema and a fast one)? Also, why does this example not have "both" as option for the direction (instead of only above or below)?
budzap
@budzap, ...or, more simply, instead of looking at a separate metric (such as distance between two indicators--which would be great), just looking at distance of price from a single price indicator?
jason5480
Hello @budzap, thank you for the feedback. While the 'CUST' distance method might look very similar to your needs, I think that if you want exactly that (get an alert when the distance between two prices change above/below a threshold) it is an overkill to use that library. The main reason is that this was designed to calculate the target price given a distance from a reference price using many different methods (check a real use case on m "Template Trailing Strategy (Backtester)" script.
Thêm nữa