TradingView
giancarlopagliaroli
17 okt 2022 21:34

gCorrelations 

Dow Jones FXCM Dollar IndexFXCM

Beskrivning




My layout of correlations. US Dollar and SP500 as references. My list of tickets consists of several subsets: Indices, Commodities, Financials and Currencies.

is 1x5

  • Correlation Frame 1x1 --> Daily perspective (timeframe 4h, lenght for calculation of correlation = 6)
  • Correlation Frame 1x2 --> Weekly perspective (timeframe 4h, lenght for calculation of correlation = 30)
  • Correlation Frame 1x3 --> Monthly perspective (timeframe 1D, lenght for calculation of correlation = 20)
  • Correlation Frame 1x4 --> 2-Monthly perspective (timeframe 1D, lenght for calculation of correlation =40)
  • Correlation Frame 1x5 --> 3-Monthly perspective (timeframe 1D, lenght for calculation of correlation = 60)

Versionsinformation

Updated to fix an invalid symbol in the script
Kommentarer
VittorioJoosten
Saluti da Singapore Giancarlo!
Thank you for the Great correlation tool.
Is there any way to edit the 'Ticket' to match a different instrument as 'input'?
Currently I can edit an instrument in input - say Han Seng Index Hong Kong instead of the Russell 2000, but the ticket still reflects the Russell.

Grazie Mille!
Vittorio Joosten
giancarlopagliaroli
@VittorioJoosten, Ciao, I suggest to copy the code creating your own new indicator and changing the code directly.
Following are the 2 lines to change replacing with your new ticker:

line 25 need to change defval and title parameters:
string US2000 = input(defval='FX:US2000', type=input.symbol, title='RUSSEL2000', group='TICKETS INDICES', inline='T0')
line 202 need to change text parameter:
table.cell(table_id=T, column=0, row=3, text='RUSSEL2000', width=0, height=0, text_color=c_text_color, text_size=i_text_size, bgcolor=c_bg_title)

If you change only the input, data is automatically updated but not the label on the table.
With my code/indicator as is you can change ticker on input, on the same asset and different broker, but I suggest to edit the code if you want a new list of tickers.
Mer