SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Tue Nov 24, 2020 3:28 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Feb 03, 2011 3:41 pm 
Offline

Joined: Wed Oct 08, 2003 1:06 pm
Posts: 833
The sample shows how to continuously switch from Simulation to Live mode using Scenario.

Code:
public class MyScenario : Scenario
{
   public override void Run()
   {
      // simulate historical data
      this.Solution.StartDate = new DateTime(1996, 1, 1);
      this.Solution.StopDate  = Clock.Now;         
      
      Start(StrategyMode.Simulation);      
      
      // make sure all objects: portfolios, orders,
      // indicators and strategy state remain the same
      // on next strategy start
      this.ResetOnStart = false;
      
      // start solution in Live mode
      Start(StrategyMode.Live);
   }
}


Top
 Profile  
 
PostPosted: Wed Apr 30, 2014 6:03 pm 
Offline

Joined: Wed Sep 18, 2013 10:50 am
Posts: 67
Location: London
Hi Sergey

Does this approach work in QuantTrader too?

Regards
Madhur


Top
 Profile  
 
PostPosted: Wed Apr 30, 2014 8:03 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
Yes, why not?

Regards,
Anton


Top
 Profile  
 
PostPosted: Thu May 01, 2014 3:37 pm 
Offline

Joined: Wed Sep 18, 2013 10:50 am
Posts: 67
Location: London
Hi Anton

I am asking because there is no simulation mode for quant trader nor can the instruments store data for simulation. (or am I missing something?)

------------------------------------------------------------------------------------------------------------------------------
public override void Run()
{
try
{
Start(StrategyMode.Simulation);
}
catch(Exception e)
{
Console.WriteLine(e);
}
}


System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at OpenQuant.Config.Configuration.set_ActiveMode(ConfigurationMode value)
at QuantTrader.Solutions.Runner.SetActiveMode(StrategyMode mode)
at QuantTrader.Solutions.Runner.Scenario_StartRequested(Object sender, EventArgs e)
at OpenQuant.API.Engine.Scenario.Start(StrategyMode mode)
at Scenario.Run()
------------------------------------------------------------------------------------------------------------------------------

Regards
Madhur


Top
 Profile  
 
PostPosted: Thu May 01, 2014 6:47 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
ok, sorry, it's not possible to switch to simulation mode in QuantTrader but you can preload historical data in OnStrategyStart to fll indicators, etc.

Regards,
Anton


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 1 guest


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