SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Wed Oct 23, 2019 6:31 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Apr 30, 2019 4:56 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 260
Dear Team,
I want to load instruments via an InstrumentManager. But I am missing the appropriate callback Events/Functions that would return the Instruments or the Instruments definition.
Please see below:
Code:
 
                var p = new SmartQuant.IB.IBTWS(framework) as IInstrumentProvider;
                var r = new InstrumentDefinitionRequest();
                r.FilterType = InstrumentType.Future;
                r.FilterSymbol = "ES";
                p.Send(r);


Could you please point me in the right direction?
Thanks
Mike


Last edited by mikembb on Mon May 13, 2019 3:31 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Mon May 13, 2019 3:30 pm 
Offline

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

does someone have an idea?

Thanks
Mike


Top
 Profile  
 
PostPosted: Tue May 14, 2019 11:17 am 
Offline

Joined: Sat May 11, 2019 12:04 pm
Posts: 2
Coincidentally I'm also working in a similar area, for a plugin to our data services.

If you check in C:\Program Files\SmartQuant Ltd\OpenQuant 2014\Samples\SampleProviders, you'll see a SampleProvider C# project. That has a section of code (#region IInstrumentProvider Members) that shows how to create securities and send them back using EmitInstrumentDefinition.

You'll have to click Data->Import->Instruments->(your provider name) to bring them in though, although there might be a way to do this at the start of a backtest.


Top
 Profile  
 
PostPosted: Wed May 22, 2019 12:58 am 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 260
would be great, if this event to a InstrumentDefinitionRequest could be added to the software rather sooner then later.

@NorgateData: would be great, if you could either add your additional information(when which index constitute etc) which you have for your symbols/instruments into an object of the Fields properties of an Instrument. That way, OQ could make use of them, as just the normal simple TimeSeries of prices. Or make them available some other way, via the plugin.

Thanks
Mike


Top
 Profile  
 
PostPosted: Wed May 22, 2019 5:48 pm 
Offline

Joined: Sat May 11, 2019 12:04 pm
Posts: 2
@mikembb: We'll probably provide index constituent information via an indicator to make it very easy to incorporate index membership on any given bar.


In regards to instruments, here's an example scenario:

User wants to backtest a strategy against the Russell 3000 Constituents back to 1990 (almost 11000 stocks - this is something we have researched at Norgate). These 11000 stocks need to be in the instrument manager.

There doesn't appear to be any easy way to bulk add these instruments prior to the Scenario being run.

So far, my limited attempts to add new instruments fails because they have a read-only property of Id=0.

SmartQuant, do you have any suggestions here on bulk adding instruments?


Top
 Profile  
 
PostPosted: Thu May 23, 2019 9:03 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 260
Hi there, not sure, why the SmartQuant Team went into silent mode on this topic and more in general again :-(

One hack could be, that you send a UserEvent (I think all events with ID > 250 or such - look at forum) and then
send an object with, which holds your id for the new created instrument, and then add your own unique ID to the Instrument.Fields list.

Then, you indicator, could check for that Instrument.Fields ID do check if that Instrument was part of an index at a certain point in time.

Regards
Mike


Top
 Profile  
 
PostPosted: Thu Jun 20, 2019 11:49 am 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 536
mikembb wrote:
Dear Team,
I want to load instruments via an InstrumentManager. But I am missing the appropriate callback Events/Functions that would return the Instruments or the Instruments definition.
Please see below:
Code:
 
                var p = new SmartQuant.IB.IBTWS(framework) as IInstrumentProvider;
                var r = new InstrumentDefinitionRequest();
                r.FilterType = InstrumentType.Future;
                r.FilterSymbol = "ES";
                p.Send(r);


Could you please point me in the right direction?
Thanks
Mike

Hello,
after sending the request, you can wait for events from provider by subscribing to them:
Code:
         framework.EventManager.Dispatcher.InstrumentDefinition += Dispatcher_InstrumentDefinition;
         framework.EventManager.Dispatcher.InstrumentDefinitionEnd += Dispatcher_InstrumentDefinitionEnd;


ps subscribing should be done prior to request.


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