Is there a way to calculate correlation between 2 series using their log returns? Corr indicator doesn't allow.
Rename
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)
Thank you!!
Hi, cannot find the compute function in TimeSeries class, any idea?
As mentioned in Post #1, it's part of the Corr indicator - not TimeSeries.
got it, thanks a lot
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: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?
TimeSeries corr = Corr.Compute(bars.High,bars.Low,20); public static TimeSeries Compute(TimeSeries s1, TimeSeries s2, int period); //prototype definition within Corr
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.
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.
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.
Is it possible to calculate the correlation of the changes in a timeseries using building blocks?
For example, you could create a custom indicator (Tools menu) to calculate the correlation of changes and use it in Blocks then.
Your Response
Post
Edit Post
Login is required