Check the correlation of different assets on your preferred timeframe to find trends, patterns, new strategies or to minimize the exposure in correlated assets
Hey, nice work. Can you send pinescript code for comparing XAUUSD and DXY? Thanks.
gianfranco60
⋅
Can I change the asset (es, XAUUSD, XAGUSD etc.)
AleksanderThor
⋅
@gianfranco60, Sure, just type the tickers in field instead of "EURUSD", "USOIL" etc. Otherwise if you want to check the correlation of only Gold and Silver while checking another asset you can use the following script:
study("Correlation")
res=input(defval="D",type=resolution, title="Timeframe")
length=input(defval=20,minval=2,type=integer,step=1, title = "Number of bars back")