OPEN-SOURCE SCRIPT

Two assets correlation tracker

152
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.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。