FundingRate (Binance USDT)

b4bd1002 已更新   
This script emulates the funding rate for Binance USDT pairs. The funding rate is calculated based on the premium index. However, as the precise method for averaging the premium index is unclear, this calculation is based on an estimation and may contain some discrepancies.

If a non-Binance USDT pair is selected, the script automatically calculates and displays the funding rate for a corresponding Binance USDT pair.

By default, the funding rate for the chart's pair is displayed, but you can change this to a different pair if needed. To enhance the accuracy of the calculations, the script uses 1-minute interval data by default. If you wish to broaden the display range of the funding rate, either stop using lower timeframe data or select a larger interval than 1 minute.
- Fixed a bug that occurred when lower timeframe was not used.
- adjusted the calculation process to accommodate a certain level of missing data in the premium index
I've added the following modes in addition to the existing FR (Funding Rate) display mode.
Please note that these are only supported for USDT-based pairs on Binance:

Avg Premium: This represents the Time-Weighted Average Price (TWAP) of the premium index, showing the moving average of the divergence between perpetual futures and the index price. When this value exceeds 0.06%, the FR increases above 0.01% by the exceeded amount. Conversely, if it falls below -0.04%, the FR decreases below 0.01% by the exceeded amount. This metric can be used to predict potential deviations of the FR from 0.01%.

Premium Index: This displays the closing value of the premium index, which is used in the calculation of the FR. If this value consistently shows significant deviations, the FR tends to shift in the direction of these deviations from its standard 0.01%.

Avg Prem + PI: This mode displays both the Avg Premium and the Premium Index simultaneously, providing a comprehensive view of the market conditions that influence the FR.
- added FR candle mode


本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。