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):
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.
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.
Rename
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.
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.
So there's no Commentary equivalent in System.IO, System.Windows.Forms or WealthLab.WPF?
What is/was a CommentaryWindow?
Basically, write strings in Rows & Columns, apply appropriate formatting, then open in a browser for easy viewing.
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.
I'm stuck here. Apparently I'm supposed to add some assembly references, can't find them:
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
Sorry to be such a baby but can you please post the *complete* code, including all assembly references? TIA.
That's the complete code. You'll find assembly references by searching Google!
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: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.
using System; using System.Diagnostics; using Community.Components; using System.Windows.Forms; using System.IO; using System.Reflection;
I switched to using DataTable. Thanks all, anyway.
@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.
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.
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
174: The type or namespace name 'Datatable' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
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?)
Mind the case, that's all: you have a syntax error here in DataTable.
shame on me - thank you so much Eugene
Your Response
Post
Edit Post
Login is required