Correlation Matrix
Author: Sammy_G
Creation Date: 2/17/2011 9:33 PM
profile picture

Sammy_G

#1
Trying to develop a correlation matrix table; code so far:
CODE:
Please log in to see this code.

Would like assistance in printing the array/table to commentary window. Suggestions to improve the code also welcome.
profile picture

Eugene

#2
Please see the Wealth-Lab Wiki FAQ | "Missing" features > Can't seem to find the Commentary window.
profile picture

Sammy_G

#3
OK. [I also reviewed the only script that I could find that uses commentary - Best and Worst Ind Grps.]

Unfortunately, b/c of my general lack of familiarity with arrays and the commands for creating/displaying html tables (and I don't have Front Page), it would be appreciated if you can help me with the coding required for displaying the array contents to a commentary window.
profile picture

Eugene

#4
Not sure why you mentioned FrontPage. It's not required altogether. The CommentaryWindow class works with plain text as well.

Its .AddLine() method accepts strings. Every onbject in .NET has a ToString() method, including double values in an array. While looping over your array, depending on what you would like to output, pass the result of string conversion (e.g. some_double_value.ToString()) to .AddLine(). Appended strings will build the output line by line. Finally when looping is done, send the result to an instance of the CommentaryWindow class using .Display().
profile picture

Sammy_G

#5
Thanks for those useful tips, Eugene. One more Q: I want the output to look like a table/matrix (e.g. as at http://www.assetcorrelation.com/); how do I achieve that? (be advised, when it comes to arrays, I am still a newbie!)
profile picture

Eugene

#6
Remember those fancy colorful scripts by fundtimer rendering tables in WL4's Commentary Window? Same principle applies: you build/write raw HTML line by line, and insert those double values from arrays converted into strings. Pure HTML.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).