* In this example I'm showing Okex Quarterly contract vs Okex spot index price because it showcases it better.
* If you are using this after 2019 the default setting will not work because I set it to Bitmex which does not currently have a "current contract in front" ticker available.
It should be fairly self explanatory, but just ask below if you have any questions.
Updated default tickers to okex spot and futures.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.