any help will be appreciated.
Size:
Color:
Size:
Color:
I tried to use the Correlation Inidicator, but the problem is the Correlation indicator doesn't have a Correlation.Value() function, it can only get DataSeries (Correlation.Series). Is there any practical or easy way to check the rolling correlation of Securiters to its own historical data within a For Loop?
Size:
Color:
Calculate the correlation series and get its value at a bar like you would do for any other series inside the bar loop e.g. CorrelationSeries[bar].
Post back if you have any more questions.
Size:
Color:
Here is the code. It was fine when checking 10-year SPX, but I got "System.outofMemoeryExpection" when it was running on the whole history of SPX since 1928. I got 4G RAM and the highest level memory usage was 70% when the strategy was running. Thanks for any help.
CODE:
Please log in to see this code.
Size:
Color:
Re: 4Gb RAM - do you have a 64-bit CPU? a 64-bit operating system? with 64-bit WLP6 running?
Size:
Color:
Shourui,
Not sure what you are trying to do in that code. But one thing's evident - you are calculating series inside the bar loop which probably accounts for your memory issues.
If I understand your code correctly, you are trying to correlate the price to 1-year ago price. The following code will do the same, and plot all series so you get a good grasp of everything:
CODE:
Please log in to see this code.
Lastly, search for correlation and auto-correlation (which is what you seem to be doing) in the WL4 forums; there's a ton of wisdom there.
Size:
Color:
Eugene.
No. Everything is 32-bit in my coputer.
Sammy_G,
What I really want to do is finding the highest correlated periods in the history to the most recent Data (such as Last 6 Months/12 months). For example, 2/2/1955 to 8/3/1955 is the highest correlated period to the recent 6 months (5/12/2010 - 11/12/2010).
Your code is calcualting correlation to 12 months ago at any historical data point, which is different than what I need.
To make it simple and straightfoward, Can you help me plot the correlation of recent 12 month data to any historical 12-month data on SPX Index? I hope my explanation is clear this time. Thanks.
Size:
Color:
Just a general advice: consider upgrading to everything 64-bit if you're into any high memory consumption stuff. 4Gb in a 32-bit and 64-bit system aren't quite the same thing.
Size:
Color:
I think I understand now what you are trying to do - namely, what historical time period was most similar to current period in terms of price action, right?
Size:
Color:
Shourui,
If you want to move forward with this thread, I would like you to answer my previous question; if the answer to that is yes, I have a solution.
Because I really don't know what you meant by "...plot the correlation of recent 12 month data to any historical 12-month data on SPX Index".
Size:
Color: