The code in contains a simple correlation indicator that can be used as an alternative to Tradingview’s built-in “Correlation Coefficient” indicator. The indicator allows users to correlate up to 3 separate instruments on the same subplot. This allows you, for example, to easily see the correlation of your instrument with stocks, bonds and FX. Alternatively, a user can also see the correlation with sector, industry peers or any other data available in Tradingview.
Features
Level Guides to easily see the key correlation coefficient levels
hey, i was trying to find the correlation between 3 different ETF's. i'm using the same code you have above, but when i try to get the three i'm interested in (SPY, HYG, JNK), it's not working.
I notice you're using LSE and OANDA -- the 3 i'm interested in are on ARCA, not sure if that changes everything. Any thoughts?
thanks for sharing this! do you have any recommendations on what the correlation-period needs to be set to for eg: on a minute chart, 5min, 1 hour, 4 hours, daily & weekly timeframes?
I notice you're using LSE and OANDA -- the 3 i'm interested in are on ARCA, not sure if that changes everything. Any thoughts?
inst1 = input(defval='ARCA:SPY', type=symbol, title='ETF')
inst2 = input(defval='ARCA:HYG', type=symbol, title='ETF')
inst3 = input(defval='ARCA:JNK', type=symbol, title='ETF')
i simply get an error.