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の精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。