TradingView
BacktestRookies
1 Th03 2018 05:32

Correlate 3 - Correlation Indicator 

WPP PLC ORD GBP0.10LSE

Mô tả

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
  • Multi-instrument:
Bình luận
mohamed.o.sharif
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?

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.
practicalCode9722
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?
Thêm nữa