[Quantproject-developers] QuantProject/b91_QuantProject Main.cs,1.7,1.8
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-02-04 00:20:49
|
Update of /cvsroot/quantproject/QuantProject/b91_QuantProject In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9557/b91_QuantProject Modified Files: Main.cs Log Message: The main method now runs a form from which it is now possible to choose what to do from a main menu. The main menu now contains at "BackTest" item: - "run" sub-item, to run user's scripts; - "savedTests"-->AccountViewer sub-item, to view saved (serialized) accounts (work is in progress); - "savedTests"-->ShowReportFromAccount sub-item, to run a Report using a saved (serialized) account. Index: Main.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b91_QuantProject/Main.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Main.cs 3 Feb 2005 00:30:39 -0000 1.7 --- Main.cs 4 Feb 2005 00:20:39 -0000 1.8 *************** *** 28,32 **** --- 28,39 ---- using QuantProject.Scripts; using QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios; + //using QuantProject.ADT.Optimizing.Genetic; + + using QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios; + using QuantProject.Scripts.WalkForwardTesting.WalkForwardOneRank; + using QuantProject.Scripts.CallingReportsForRunnedScripts; + + namespace QuantProject.Principale *************** *** 48,55 **** private System.Windows.Forms.MenuItem menuItem10; private System.Windows.Forms.MenuItem menuItem11; - private System.Windows.Forms.MenuItem menuItem12; private System.Windows.Forms.MenuItem menuItem13; private System.Windows.Forms.MenuItem menuItem14; private System.Windows.Forms.MenuItem menuItem9; /// <summary> /// Required designer variable. --- 55,65 ---- private System.Windows.Forms.MenuItem menuItem10; private System.Windows.Forms.MenuItem menuItem11; private System.Windows.Forms.MenuItem menuItem13; private System.Windows.Forms.MenuItem menuItem14; private System.Windows.Forms.MenuItem menuItem9; + private System.Windows.Forms.MenuItem menuItemRun; + private System.Windows.Forms.MenuItem menuItemSavedTests; + private System.Windows.Forms.MenuItem menuItemAccountViewer; + private System.Windows.Forms.MenuItem menuItemShowReportFromAccount; /// <summary> /// Required designer variable. *************** *** 96,100 **** this.menuItem9 = new System.Windows.Forms.MenuItem(); this.menuItem11 = new System.Windows.Forms.MenuItem(); ! this.menuItem12 = new System.Windows.Forms.MenuItem(); this.menuItem13 = new System.Windows.Forms.MenuItem(); this.menuItem14 = new System.Windows.Forms.MenuItem(); --- 106,112 ---- this.menuItem9 = new System.Windows.Forms.MenuItem(); this.menuItem11 = new System.Windows.Forms.MenuItem(); ! this.menuItemRun = new System.Windows.Forms.MenuItem(); ! this.menuItemSavedTests = new System.Windows.Forms.MenuItem(); ! this.menuItemAccountViewer = new System.Windows.Forms.MenuItem(); this.menuItem13 = new System.Windows.Forms.MenuItem(); this.menuItem14 = new System.Windows.Forms.MenuItem(); *************** *** 106,109 **** --- 118,122 ---- this.menuItem6 = new System.Windows.Forms.MenuItem(); this.menuItem7 = new System.Windows.Forms.MenuItem(); + this.menuItemShowReportFromAccount = new System.Windows.Forms.MenuItem(); // // mainMenu1 *************** *** 138,149 **** this.menuItem11.Index = 1; this.menuItem11.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.menuItem12}); this.menuItem11.Text = "BackTest"; // ! // menuItem12 // ! this.menuItem12.Index = 0; ! this.menuItem12.Text = "Go"; ! this.menuItem12.Click += new System.EventHandler(this.menuItem12_Click); // // menuItem13 --- 151,177 ---- this.menuItem11.Index = 1; this.menuItem11.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.menuItemRun, ! this.menuItemSavedTests}); this.menuItem11.Text = "BackTest"; // ! // menuItemRun // ! this.menuItemRun.Index = 0; ! this.menuItemRun.Text = "Run"; ! this.menuItemRun.Click += new System.EventHandler(this.menuItemRun_Click); ! // ! // menuItemSavedTests ! // ! this.menuItemSavedTests.Index = 1; ! this.menuItemSavedTests.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { ! this.menuItemAccountViewer, ! this.menuItemShowReportFromAccount}); ! this.menuItemSavedTests.Text = "Saved Tests"; ! // ! // menuItemAccountViewer ! // ! this.menuItemAccountViewer.Index = 0; ! this.menuItemAccountViewer.Text = "Account viewer"; ! this.menuItemAccountViewer.Click += new System.EventHandler(this.menuItemAccountViewer_Click); // // menuItem13 *************** *** 195,198 **** --- 223,232 ---- this.menuItem7.Text = ""; // + // menuItemShowReportFromAccount + // + this.menuItemShowReportFromAccount.Index = 1; + this.menuItemShowReportFromAccount.Text = "Show report from account"; + this.menuItemShowReportFromAccount.Click += new System.EventHandler(this.menuItemShowReportFromAccount_Click); + // // Principale // *************** *** 201,205 **** this.Menu = this.mainMenu1; this.Name = "Principale"; ! this.Text = "Principale"; } --- 235,239 ---- this.Menu = this.mainMenu1; this.Name = "Principale"; ! this.Text = "Main"; } *************** *** 212,219 **** } - private void menuItem12_Click(object sender, System.EventArgs e) - { - } - private void menuItem10_Click(object sender, System.EventArgs e) { --- 246,249 ---- *************** *** 226,237 **** //try { ! // new RunMSFTsimpleTest().Run(); // new RunMSFTsimpleTest_2().Run(); //new RunOneRankWithExcelReport().Run(); ! // new RunOneRankWithWindowsReport().Run(); //new RunMSFTwalkForward().Run(); //new RunMultiTestOneRank().Run(); //new RunEfficientCTOPorfolio().Run(); ! new RunWalkForwardOneRank().Run(); } //catch ( Exception ex ) --- 256,282 ---- //try { ! //new RunMSFTsimpleTest().Run(); // new RunMSFTsimpleTest_2().Run(); //new RunOneRankWithExcelReport().Run(); ! ! //new RunOneRankWithWindowsReport().Run(); ! //new RunBestTwoIndipendent().Run(); ! //Principale.geneticOptimizerTest(); ! //new RunEfficientCTOPorfolio().Run(); ! //new RunEfficientCTCPorfolio().Run(); ! //new RunEfficientPorfolio().Run(); ! Application.Run(new Principale()); ! // new RunMSFTwalkForward().Run(); ! ! // new RunOneRankWithWindowsReport().Run(); //new RunMSFTwalkForward().Run(); + //new RunMultiTestOneRank().Run(); + + //new RunWalkForwardOneRank().Run(); + //new RunEfficientCTOPorfolio().Run(); ! //new RunWalkForwardOneRank().Run(); ! } //catch ( Exception ex ) *************** *** 240,248 **** } } ! private void menuItem14_Click(object sender, System.EventArgs e) { } } } --- 285,328 ---- } } ! /* ! private static void geneticOptimizerTest() ! { ! IGenomeManager genomeManagerTest = new GenomeManagerTest(5,1,10); ! GeneticOptimizer GO = new GeneticOptimizer(genomeManagerTest); ! GO.KeepOnRunningUntilConvergenceIsReached = true; ! GO.Run(true); ! System.Console.WriteLine("\n\nThe best solution found is: " + (string)GO.BestGenome.Meaning + ! " with {0} generations", GO.GenerationCounter); ! } ! */ private void menuItem14_Click(object sender, System.EventArgs e) { } + private void menuItemRun_Click(object sender, System.EventArgs e) + { + try + {//call here your scripts + //new RunWalkForwardOneRank().Run(); + new RunEfficientCTCPorfolio().Run(); + } + catch ( Exception ex ) + { + string notUsed = ex.ToString(); + //in this way qP shouldn't stop if running a single script fails ... + } + } + + private void menuItemAccountViewer_Click(object sender, System.EventArgs e) + { + AccountViewer accountViewer = new AccountViewer(); + accountViewer.Show(); + } + + private void menuItemShowReportFromAccount_Click(object sender, System.EventArgs e) + { + ShowReportFromFile.ShowReportFromSerializedAccount("C:\\CtcPortfolio.qP"); + } + } } |