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.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.