TradingView
fikira
2021년 4월 3일 오후 2시 7분

Correlation [array's] 

Bitcoin all time history indexINDEX

설명

This script isn't about creating a correlation script with labels, there is a perfect working example of @Mango2Juice
(Correlation Matrix, which was inspired by @Daveatt's Correlation Matrix)

The intention was making it with the use of as less code as possible, looping through array's

The Pine correlation function doesn't work consistently in a local scope (loop), so I had to work around it

Inspired by @ZenAndTheArtOfTrading's Correlation Meter (using array.covariance and array.stdev) and
especially with the help of @RicardoSantos and @LonesomeTheBlue I've managed to do this

Symbols, timeframe, look-back period, colors and limits can be changed

There is always room for improvement, but I think it shows what is possible.

Many thanks to the people who I've mentioned, and of course to Tradingview!
(Without the Earth nothing can grow)

Cheers!

코멘트
PineCoders
Arun_K_Bhaskar
Solved the limitation of scaling a table. Thanks.
mpoyser
Iam also getting max_bars_back error any fix for this really appreciated
mpoyser
FYI : I added max_bars_back=5000 at the study level to fix it i.e. study("Correlation [array's]", overlay=false,max_bars_back=5000,max_lines_count=500)
fikira
@mpoyser, Great!
stakeprophet
I am intermittently getting a 'Pine cannot determine the referencing length of a series. Try using max_bars_back' error, even after I add max_bars_back = 300 to the study call.

I have read this may have something to do with how you are using bar_index. Is there a fix for this?
rbower
"barstateIsReallyLast"
nice lol
fikira
@rbower, Glad it is noticed :)
Sometimes it happens the data remains on the screen after a bar close, there are several solutions,
but this one does the trick in some occasions
:) ;)
RaimundoHenrique
Nice!
더보기