OPEN-SOURCE SCRIPT

Binance Perp Premium/Discount

This TradingView Pine Script indicator calculates and displays the premium or discount percentage between a cryptocurrency's spot price and its corresponding perpetual futures (perp) price on Binance. It automatically detects whether the current chart symbol represents a spot or perp market by checking for the ".P" suffix. The script then retrieves the closing prices for both the spot and perp symbols using the request.security function. If valid data is available for both markets, it computes the premium or discount as a percentage and visualizes this difference as a histogram below the main chart. Green bars indicate a premium (perp price above spot), while red bars signify a discount (perp price below spot). The indicator includes error handling to display 'n/a' when data for the required symbols is unavailable, ensuring robustness across various chart applications.
sentimentVolume Indicatorvolumedelta

開源腳本

在真正的TradingView精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?

免責聲明