Page 1 of 1

How can I use the ta.correlation function in PineScript (Tradingview) to show the correlation of two different symbols?

Posted: Wed Jul 20, 2022 2:05 pm
by TheGereon
I am new to Pine and my problem is that when using the ta.correlation function, I can't figure out how to define two different symbols for which the correlation is displayed.

I only manage to load in as input the price data (with close, open etc. ) from the same symbol, which of course makes little sense.

How do I have to proceed further? Do I have to load another symbol with request.security first?

Thanks in advance :)

Re: How can I use the ta.correlation function in PineScript (Tradingview) to show the correlation of two different symbo

Posted: Sun Feb 05, 2023 10:30 pm
by processingclouds
Hey,

You need to use request.security(.......... to get the other symbol source value and than use that with ta.correlation