SmartQuant Discussion
http://www.smartquant.com/forums/

Loading Instruments via InstrumentDefinitionRequest
http://www.smartquant.com/forums/viewtopic.php?f=86&t=14906
Page 1 of 1

Author:  mikembb [ Tue Apr 30, 2019 4:56 pm ]
Post subject:  Loading Instruments via InstrumentDefinitionRequest

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

Author:  mikembb [ Mon May 13, 2019 3:30 pm ]
Post subject:  Re: Loading Instruments via InstrumentManager

Hi there,

does someone have an idea?

Thanks
Mike

Author:  NorgateData [ Tue May 14, 2019 11:17 am ]
Post subject:  Re: Loading Instruments via InstrumentDefinitionRequest

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.

Author:  mikembb [ Wed May 22, 2019 12:58 am ]
Post subject:  Re: Loading Instruments via InstrumentDefinitionRequest

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

Author:  NorgateData [ Wed May 22, 2019 5:48 pm ]
Post subject:  Re: Loading Instruments via InstrumentDefinitionRequest

@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?

Author:  mikembb [ Thu May 23, 2019 9:03 pm ]
Post subject:  Re: Loading Instruments via InstrumentDefinitionRequest

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

Author:  skuvv [ Thu Jun 20, 2019 11:49 am ]
Post subject:  Re: Loading Instruments via InstrumentDefinitionRequest

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.

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/