SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Mon Mar 20, 2023 7:41 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 4 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: 273
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  
 
PostPosted: Sun Jan 06, 2019 4:36 pm 
Offline

Joined: Thu Feb 05, 2015 11:15 am
Posts: 39
Also, I find that running multiple strategies on the same instrument will cause all these strategies plot on the same chart. I guess the chart tag is based on instrument instead of strategy instance?

Is there a way to separate plots/pad from different strategies (but on the same instrument)?


gorogm wrote:
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: Wed Jan 09, 2019 9:33 am 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 583
ericwang wrote:
Also, I find that running multiple strategies on the same instrument will cause all these strategies plot on the same chart. I guess the chart tag is based on instrument instead of strategy instance?

Is there a way to separate plots/pad from different strategies (but on the same instrument)?


gorogm wrote:
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

Hello,
I think this is similar thing:
http://www.smartquant.com/forums/viewtopic.php?f=59&t=9183


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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