- ago
I'm converting an informational, non-trading strategy from WL6 to WL7. It calculates the Beta for all symbols in a dataset and outputs that to a CommentaryWindow which is stored as an html file at a specified location, as so (WL6 code):

CODE:
CommentaryWindow cw = new CommentaryWindow(filepath);


Unable to figure out how to create a CommentaryWindow in WL7.
If that's not possible perhaps creating a DataTable may work; having difficulty with that, too.
0
574
Solved
16 Replies

Reply

Bookmark

Sort
- ago
#1
You can output to the built-in Debug log or develop a custom performance visualizer.

Also I recall you have developed the "Correlation Matrix" utility script for WL6:
https://wl6.wealth-lab.com/Strategy/Details/93
The legacy CommentaryWindow code is open source, you can get it from the Wiki:
http://www2.wealth-lab.com/WL5WIKI/CommunityComponentsMain.ashx
As it's a dozen lines long it should be trivial to adapt and use in a WL7 strategy.
0
- ago
#2
So there's no Commentary equivalent in System.IO, System.Windows.Forms or WealthLab.WPF?
0
Glitch8
 ( 8.38% )
- ago
#3
What is/was a CommentaryWindow?
0
- ago
#4
@Glitch:

https://www2.wealth-lab.com/WL5WIKI/CommentaryWindow.ashx
0
- ago
#5
Basically, write strings in Rows & Columns, apply appropriate formatting, then open in a browser for easy viewing.
0
Glitch8
 ( 8.38% )
- ago
#6
Ok, like Eugene suggested why not try adapting this old WL6 community component to WL7? We could then add it to the WL7 Community library.
0
- ago
#7
I'm stuck here. Apparently I'm supposed to add some assembly references, can't find them:


0
- ago
#8
Didn't I provide you the references in Post #1 ?
CODE:
#region Commentary window private static string _path = Path.Combine( Application.UserAppDataPath, @"Data\CommentaryWindow.html"); private static StreamWriter html; public static void AddCommentary(this WealthScript obj, string line) { if( html == null ) html = new StreamWriter(_path); html.WriteLine(line + " "); } public static void DisplayCommentary(this WealthScript obj) { if (html != null) { html.Close(); html = null; System.Diagnostics.Process.Start(_path); } } #endregion
0
- ago
#9
Sorry to be such a baby but can you please post the *complete* code, including all assembly references? TIA.
0
- ago
#10
That's the complete code. You'll find assembly references by searching Google!
0
- ago
#11
I think he means he doesn't want to download the library source file. Anyway, the relevant using statements are in the UtilEx.cs file in the Community.Components library. Most of these using statements have nothing to do with the AddCommentary() code anyway. Rather, they are for other routines in that UtilEx.cs file.
CODE:
using System; using System.Diagnostics; using Community.Components; using System.Windows.Forms; using System.IO; using System.Reflection;
Personally, I don't like the way the AddCommentary() method works. I would prefer if it simply pulled up some ActiveX control that displayed the HTML without getting the web browser involved.
0
- ago
#12
I switched to using DataTable. Thanks all, anyway.
1
Best Answer
- ago
#13
@superticker

It's not the references, I realized that nothing else is required when answering. I rather think he's confused by that WealthScript obj of an extension method that won't compile no matter what because it's WL6 specific. So to port this code to V7, evidently the WealthScript should be replaced with UserStrategyBase.
1
- ago
#14
I am following this chat with interest as similarly was trying to collect some data to summarize and report at the end of the strategy. Sammy_G mentions he is using a Datatable. My WL7 doesn't appear to accept datatable. I have tried using System.Data without success. I have checked WL7's reference library and there is no System.Data to be included

Any advise here on using datatable? Many thanks
Michael

code

CODE:
         Datatable table= new DataTable("Eventlog");          table.Columns.Add("idx", typeof(int));          table.Columns.Add("symbol", typeof(string));


174: The type or namespace name 'Datatable' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)

0
- ago
#15
Mind the case, that's all: you have a syntax error here in DataTable.
1
- ago
#16
shame on me - thank you so much Eugene
1

Reply

Bookmark

Sort