Hi!
I am trying to provide some diversification in a Rotation Strategy but my limited C# knowledge is showing.;)
I am looking to only add new positions which are poorly correlated to one another, however I am stumped at how to refer to the Series of an existing ActivePosition.
CODE:
Please log in to see this code.
rocSeries refers to the Series of a Symbol being pointed to by Set Context. Am I referring to the Series of an ActivePosition in the ROC.Series above correctly?
Thanks!
Vince
Edit: There appears to be no construct for Correlation.Value, only Correlation.Series. Is there any way to avoid the calculation of the whole correlation series?
V
Size:
Color:
QUOTE:
Am I referring to the Series of an ActivePosition in the ROC.Series above correctly?
Yes!
QUOTE:
There appears to be no construct for Correlation.Value, only Correlation.Series. Is there any way to avoid the calculation of the whole correlation series?
There's always a way, but there's no way to do it using the Correlation (or CorrelationXL) indicator. Let me see if I can find a reference to the source code and you can create your own function for this.
Size:
Color:
Thanks Cone!
BTW, is there any particular reason the the Value construct was not included for Correlation? It appears that would be a case when that construct would be particularly useful.
Vince
Size:
Color:
Hi Vince,
QUOTE:
BTW, is there any particular reason the the Value construct was not included for Correlation?
No particular reason. If you wish to add it, you're welcome! The source code is open.
Size:
Color:
QUOTE:
No particular reason.
Hi Eugene!
I thought that the WL Team had tried to get the original submitters of the functions to provide complete rather than partial code before adding them to the libraries.
Vince
Size:
Color:
Why wasn't the Value method included? Maybe just lack of interest at the time.
This should work for you. It's the Correlation Series function adapted for ad-hoc values.
CODE:
Please log in to see this code.
Size:
Color:
Thanks Cone! MUCH appreciated!!
Vince
Edit: I figured it out.
Size:
Color:
Size:
Color:
Thanks Cone and Eugene for all of your help!
Vince
Size:
Color:
Vince, I'm going to include Cone's code in C.Indicators 2017.06.
Size:
Color:
QUOTE:
I'm going to include Cone's code in C.Indicators 2017.06.
Good to hear, Eugene.
Vince
Size:
Color:
Vince, the change is checked in - you may update C.Indicators now.
P.S. The
Correlation Wiki page has been updated.
Size:
Color:
Thanks Eugene!
Vince
Size:
Color: