OPEN-SOURCE SCRIPT
Two assets correlation tracker

Hi, I made this simple script to see how two correlated assets are actually performing short-term. The idea comes from correlation between BTC and ETH that that usually stands 0.9 (Pearson's correlation). However Pearson's correlation doesn't indicate the relative price difference and cannot be used trading correlation when used alone.
My approach is simple - we can select the date/time from which we will start tracking the price change, and instead of tracking the price, we track 100 USD worth of BTC and ETH and how this investment perform. This gives us the price difference relative to a point in the near future, I would suggest using latest trend shift, for example.
On example of how this can be used: If we see that BTC is falling slower than ETH since trend shift, we can long BTC and short ETH in equal parts and expect to gain from the difference while hedging potential loss.
My approach is simple - we can select the date/time from which we will start tracking the price change, and instead of tracking the price, we track 100 USD worth of BTC and ETH and how this investment perform. This gives us the price difference relative to a point in the near future, I would suggest using latest trend shift, for example.
On example of how this can be used: If we see that BTC is falling slower than ETH since trend shift, we can long BTC and short ETH in equal parts and expect to gain from the difference while hedging potential loss.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.