TradingView
Besumetz
2022年8月6日午後9時44分

Future's spread with base contract (MOEX) 

Euro-Ruble Futures (Sep 2022)MOEX

詳細

English:
Indicator calculates spread between future and it's theoretical price baased on base contract, number of days to expiration and central bank key rate.
I didn't find any means of getting base contract of security on chart so I hardcoded futures and corresponding base contracts.
Hardcoded futures are MOEX (Moscow Exchange) only and key rate used in script is Russian Central Bank's key rate from 2013, but I believe you can easily adapt it to any other key rate history. I can share source code of tiny C++20 utility for easy generation of get_rate(time) function from more human-readable date format rather then UNIX timestamp used in PineScript.
Only quarterly futures are supported. Only in "SIU2022" like notation. "SI1!" like aliases are not supported.

Русский:
Индикатор отображает спред фьючерса к его теоретической цене с учётом усыхания на каждый день.
Не нашёл, как определить базовый актив фьючерса средствами TradingView - поэтому это соответствие захардкожено вручную.
Поддерживаются только квартальные фьючерсы, только MOEX, только хардкор.
Поддерживается история ключевой ставки ЦБ РФ с 2013 года.
Используйте коды фьючерсов вида "SIU2022".
Не поддерживаются альясы вроде "SI1!", "EU1!".

リリースノート

Syntactic changes in title and short title/

リリースノート

Refactored days_to_exp calculation

リリースノート

Added barstate.islastconfirmedhistory check before painting table

リリースノート

Updated get_rate function according to Russia's Central Bank decision

リリースノート

Updated get_rate function according to Russia's Central Bank decision(8.5% since 24.07.2023)
詳細