[Quantproject-developers] QuantProject/b7_Scripts/CallingReportsForRunnedScripts ShowReportFromFile.
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-02-04 00:08:06
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/CallingReportsForRunnedScripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6108/b7_Scripts/CallingReportsForRunnedScripts Added Files: ShowReportFromFile.cs Log Message: Added ShowReportFromFile class to view report from file (containing at the moment only serialized account). The Class Position in scripts project is just temporary --- NEW FILE: ShowReportFromFile.cs --- /* QuantProject - Quantitative Finance Library ShowReportFromFile.cs Copyright (C) 2003 Marco Milletti This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using QuantProject.Scripts; using QuantProject.Business.Timing; using QuantProject.Business.Financial.Accounting; using QuantProject.Business.DataProviders; using QuantProject.ADT.FileManaging; using QuantProject.Presentation.Reporting.WindowsForm; namespace QuantProject.Scripts.CallingReportsForRunnedScripts { public class ShowReportFromFile { public ShowReportFromFile() { } public static void ShowReportFromSerializedAccount(string serializedAccountFullPath) { try { Account account = (Account)ObjectArchiver.Extract(serializedAccountFullPath); Report report = new Report(account, new HistoricalAdjustedQuoteProvider()); report.Show("CtcPortfolio",3, new EndOfDayDateTime(new DateTime(2000,1,20), EndOfDaySpecificTime.MarketClose), "^MIBTEL"); } catch(System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.ToString()); } } } } |