SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Sun May 26, 2019 8:06 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Jul 25, 2012 2:38 pm 
Offline

Joined: Sun May 06, 2012 5:39 pm
Posts: 4
Hello,

Is there any way how to change parameters for project after set ResetOnStart = false;

There is my code :

Code:
public override void Run()
   {
      ResetOnStart = true;
      

      //****************************************************
      // Test 1
      //****************************************************
      Solution.StartDate = new DateTime(1900, 1, 1);
      Solution.StopDate = new DateTime(2010, 1, 1);
      
      // set parameters
      Solution.Projects[0].Parameters["Length1"].Value = 5;
      Solution.Projects[0].Parameters["Length2"].Value = 40;
      
      Console.WriteLine(Solution.Projects[0].Parameters["Length1"].Value);
      Console.WriteLine(Solution.Projects[0].Parameters["Length2"].Value);
      
      Start();
      
      
      ResetOnStart = false;
      
      //****************************************************
      // Test 2
      //****************************************************
      Solution.StartDate = new DateTime(2010, 1, 1);
      Solution.StopDate = DateTime.Now;
      
      // set new parameters
      Solution.Projects[0].Parameters["Length1"].Value = 50;
      Solution.Projects[0].Parameters["Length2"].Value = 200;
      
      Console.WriteLine(Solution.Projects[0].Parameters["Length1"].Value);
      Console.WriteLine(Solution.Projects[0].Parameters["Length2"].Value);
      
      Start();
   }



In Output window i get :
5
40
50
200
, so parameters are set fine. But in result window I see backtest only for 5,40 parameters.


Top
 Profile  
 
PostPosted: Wed Jul 25, 2012 4:16 pm 
Offline

Joined: Wed Oct 08, 2003 1:06 pm
Posts: 833
Hi,

After this line "ResetOnStart = false;" - the parameters set by scenario are not propagated into the real strategy parameters. In fact normally each time you call Start() from the scenario - all strategy instances are recreated and parameters are propogated. Unless ResetOnStart=false, in this case "old" instances of strategies are started second time and no new parameters are applied.

Regards,
Sergey.


Top
 Profile  
 
PostPosted: Wed Jul 25, 2012 9:23 pm 
Offline

Joined: Sun May 06, 2012 5:39 pm
Posts: 4
And what about StartOver = true ?
Or some combination of it ?

Any suggestions ?


Top
 Profile  
 
PostPosted: Thu Jul 26, 2012 11:02 am 
Offline

Joined: Wed Oct 08, 2003 1:06 pm
Posts: 833
Please tell me what exactly you are trying to acheive and I will try to help you. Are you going to run the system twice on the same data with different parameters, or?

Regards,
Sergey.


Top
 Profile  
 
PostPosted: Mon Jul 30, 2012 9:53 am 
Offline

Joined: Sun May 06, 2012 5:39 pm
Posts: 4
As in example, I need test one system for two different time period with two different parameters. But I resolve this with using StartOver and ResetOnStart combination.
Anyway thank you


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group