- ago
Is there a way to calculate correlation between 2 series using their log returns? Corr indicator doesn't allow.
0
1,024
Solved
10 Replies

Reply

Bookmark

Sort
- ago
#1
If you pass on two instances of LogReturn'ed series as the source to "Corr" (correlation) indicator's Compute method it would return a correlation between those series:
CODE:
public static LogReturn Series(TimeSeries source, int period)

CODE:
//compute correlation between two TimeSeries public static TimeSeries Compute(TimeSeries s1, TimeSeries s2, int period)
0
Best Answer
- ago
#2
Thank you!!
0
johnliang8
 ( 7.74% )
- ago
#3
Hi, cannot find the compute function in TimeSeries class, any idea?
0
- ago
#4
As mentioned in Post #1, it's part of the Corr indicator - not TimeSeries.
1
johnliang8
 ( 7.74% )
- ago
#5
got it, thanks a lot
0
- ago
#6
QUOTE:
As mentioned in Post #1, it's part of the Corr indicator

It would be clarified better if the "Corr." was included in an example rather than just saying it's a static method of Corr. It confused me too until a read it again. (And a nonprogrammer would follow the example better than the prototype definition.)
CODE:
TimeSeries corr = Corr.Compute(bars.High,bars.Low,20); public static TimeSeries Compute(TimeSeries s1, TimeSeries s2, int period); //prototype definition within Corr
And I didn't even know Corr had Compute and ComputeCoeff methods until I check the Object Browser in VS. Is this documented somewhere else?
0
Glitch8
 ( 8.38% )
- ago
#7
Although the call in the Corr indicator is still there, we moved that method implementation into a MathUtils class, which Corr calls. We need to document MathUtils and I added this to our internal issue tracking list.
0
- ago
#8
And searching "MathUtils" in both the QuickRef and Help documents yields no hits, Build 25.

Hmm. The VS Object Browser does find MathUtils in WealthLab.Core Build 25. I'm not sure what "unknown-type" is for the Correlation method.
0
mjj38
- ago
#9
Is it possible to calculate the correlation of the changes in a timeseries using building blocks?
0
- ago
#10
For example, you could create a custom indicator (Tools menu) to calculate the correlation of changes and use it in Blocks then.
0

Reply

Bookmark

Sort