SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Mon Nov 19, 2018 9:22 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Nov 01, 2017 1:28 am 
Offline

Joined: Mon Oct 23, 2017 2:11 pm
Posts: 3
Dear Fellow Traders/Coders,
I read that OpenQuant is able to run multiple strategies in one solution on one instrument, but I don't see how to do it. I need them to be able to communicate and to be in the same timestep when running on historical data. So, creating separate Scenarios doesn't seem to be OK. But one Scenario seems to be able to run only one strategy instance.
Can somebody provide code sample or explanation how to run multiple instances in the same time?
Thanks!!
Márton


Top
 Profile  
 
PostPosted: Thu Nov 02, 2017 2:32 am 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 235
Hi there,

as a general advise, try to use Visual Studio to code any strategies. Once done, reopen in OQ to run them...

Debugging, Context help is much better in VS...

Quote:
I need them to be able to communicate

this is best done with a global variable.
Define a Namespace (like AlloController) and add an instance of that to the Global variables in the scenario:
Code:
AlloController alloController = new AlloController();
strategy.Global.Add("allocator", alloController);


Then, under your strategy, make a reference to the global AlloController like this:
Code:
public AlloController alloController;

//and add below into OnStrategyStart to link to the global instance of the AlloController....
protected override void OnStrategyStart(){
alloController = Global["allocator"] as AlloController;
}


And once that is in place, you can have Events fire from the AlloController or whatever you like. Or Rank the strategies...

Sorry, I am super involved right now, and hardly have time for free Support. You can check out the team fom SQ/OQ for paid consultancy or myself.

Regards
Mike


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

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 2 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