[Quantproject-developers] QuantProject/b91_QuantProject Main.cs,1.9,1.10
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-02-06 20:15:36
|
Update of /cvsroot/quantproject/QuantProject/b91_QuantProject In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2555/b91_QuantProject Modified Files: Main.cs Log Message: Resolved minor conflicts, added a new item for running in release mode Index: Main.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b91_QuantProject/Main.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Main.cs 6 Feb 2005 18:18:08 -0000 1.9 --- Main.cs 6 Feb 2005 20:15:23 -0000 1.10 *************** *** 32,36 **** using QuantProject.Scripts.SimpleTesting; using QuantProject.Scripts.WalkForwardTesting.WalkForwardOneRank; ! using QuantProject.Scripts.CallingReportsForRunnedScripts; --- 32,36 ---- using QuantProject.Scripts.SimpleTesting; using QuantProject.Scripts.WalkForwardTesting.WalkForwardOneRank; ! using QuantProject.Scripts.CallingReportsForRunScripts; *************** *** 61,64 **** --- 61,65 ---- private System.Windows.Forms.MenuItem menuItemAccountViewer; private System.Windows.Forms.MenuItem menuItemShowReportFromAccount; + private System.Windows.Forms.MenuItem menuItemRunReleasingMode; /// <summary> /// Required designer variable. *************** *** 108,111 **** --- 109,113 ---- this.menuItemSavedTests = new System.Windows.Forms.MenuItem(); this.menuItemAccountViewer = new System.Windows.Forms.MenuItem(); + this.menuItemShowReportFromAccount = new System.Windows.Forms.MenuItem(); this.menuItem13 = new System.Windows.Forms.MenuItem(); this.menuItem14 = new System.Windows.Forms.MenuItem(); *************** *** 117,121 **** this.menuItem6 = new System.Windows.Forms.MenuItem(); this.menuItem7 = new System.Windows.Forms.MenuItem(); ! this.menuItemShowReportFromAccount = new System.Windows.Forms.MenuItem(); // // mainMenu1 --- 119,123 ---- this.menuItem6 = new System.Windows.Forms.MenuItem(); this.menuItem7 = new System.Windows.Forms.MenuItem(); ! this.menuItemRunReleasingMode = new System.Windows.Forms.MenuItem(); // // mainMenu1 *************** *** 151,155 **** this.menuItem11.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItemRun, ! this.menuItemSavedTests}); this.menuItem11.Text = "BackTest"; // --- 153,158 ---- this.menuItem11.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItemRun, ! this.menuItemSavedTests, ! this.menuItemRunReleasingMode}); this.menuItem11.Text = "BackTest"; // *************** *** 157,161 **** // this.menuItemRun.Index = 0; ! this.menuItemRun.Text = "Run"; this.menuItemRun.Click += new System.EventHandler(this.menuItemRun_Click); // --- 160,164 ---- // this.menuItemRun.Index = 0; ! this.menuItemRun.Text = "Run (debugging mode)"; this.menuItemRun.Click += new System.EventHandler(this.menuItemRun_Click); // *************** *** 174,177 **** --- 177,186 ---- this.menuItemAccountViewer.Click += new System.EventHandler(this.menuItemAccountViewer_Click); // + // menuItemShowReportFromAccount + // + this.menuItemShowReportFromAccount.Index = 1; + this.menuItemShowReportFromAccount.Text = "Show report from account"; + this.menuItemShowReportFromAccount.Click += new System.EventHandler(this.menuItemShowReportFromAccount_Click); + // // menuItem13 // *************** *** 222,230 **** 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 --- 231,239 ---- this.menuItem7.Text = ""; // ! // menuItemRunReleasingMode // ! this.menuItemRunReleasingMode.Index = 2; ! this.menuItemRunReleasingMode.Text = "Run (releasing mode)"; ! this.menuItemRunReleasingMode.Click += new System.EventHandler(this.menuItemRunReleasingMode_Click); // // Principale *************** *** 298,304 **** { } ! private void menuItemRun_Click(object sender, System.EventArgs e) { // try // {//call here your scripts --- 307,314 ---- { } ! //run scripts in debugging mode private void menuItemRun_Click(object sender, System.EventArgs e) { + // try // {//call here your scripts *************** *** 312,315 **** --- 322,326 ---- // //in this way qP shouldn't stop if running a single script fails ... // } + } *************** *** 320,328 **** } private void menuItemShowReportFromAccount_Click(object sender, System.EventArgs e) { ! ShowReportFromFile.ShowReportFromSerializedAccount("C:\\CtcPortfolio.qP"); } } } --- 331,379 ---- } + private string getPath() + { + OpenFileDialog openFileDialog = new OpenFileDialog(); + openFileDialog.Title = "Select a serialized account please ..."; + openFileDialog.Multiselect = false; + openFileDialog.CheckFileExists = true; + openFileDialog.ShowDialog(); + return openFileDialog.FileName; + } + private void menuItemShowReportFromAccount_Click(object sender, System.EventArgs e) { ! string chosenPath = this.getPath(); ! if(chosenPath != "") ! ShowReportFromFile.ShowReportFromSerializedAccount(chosenPath); } + + private void menuItemRunReleasingMode_Click(object sender, System.EventArgs e) + { + try + { + this.Cursor = Cursors.WaitCursor; + //call here your scripts + //new RunWalkForwardOneRank().Run(); + //new RunEfficientCTCPorfolio().Run(); + //new RunEfficientCTOPorfolio("STOCKMI",70,5,5,1000).Run(); + new RunEfficientCTOPorfolio("STOCKMI",100,5,5,1000).Run(); + new RunEfficientCTOPorfolio("STOCKMI",70,5,10,2500).Run(); + new RunEfficientCTOPorfolio("STOCKMI",100,5,10,2500).Run(); + } + catch ( Exception ex ) + { + string notUsed = ex.ToString(); + //in this way qP shouldn't stop if running a single script fails ... + } + finally + { + this.Cursor = Cursors.Default; + } + } + + + + } } |