SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Sat Dec 07, 2019 8:09 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Oct 31, 2019 8:16 am 
Offline

Joined: Wed Aug 07, 2019 7:49 am
Posts: 20
Hi,

I have a SellSideStrategy that I am using as my DataProvider for rolled futures contracts.

I'm doing this:

AddInstrument("ES-Front", MyRollSellSide);

inside MyRollSellSide I have something like:

OnSubscribe(Instrument instrument)
{
if (instrument.Symbol == "ES-Front")
{
AddInstrument("ES-2019DEC");

}
}
To my suprise this is printing:

10/31/2019 15:26:44.240 DataSimulator::Subscribe ES-Front
10/31/2019 15:26:44.240 DataSimulator::Subscribe ES-2019DEC

Why and how is DataSimulator subscribed to ES-Front if I'm using AddInstrument("ES-Front", MyRollSellSide)??


Top
 Profile  
 
PostPosted: Thu Oct 31, 2019 10:15 am 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 562
Hi,
please look at demo solution named Roll. It covers your needs.
In this solution, DataSimulator does not subscribe to main instrument.


Top
 Profile  
 
PostPosted: Wed Nov 13, 2019 1:10 pm 
Offline

Joined: Wed Aug 07, 2019 7:49 am
Posts: 20
Hi,

The demo solution Roll does not cover my needs.

In roll I see:

buySide.Instruments.Add(instrument1);

This will not work for me because:
1. I need to add instruments while the strategy is running, Instruments.Add will not trigger the provider to subscribe while the strategy is running.
2. I need to use multiple providers, Instruments.Add does not allow for me to specify which provider to subscribe with.


Top
 Profile  
 
PostPosted: Wed Nov 13, 2019 2:19 pm 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 562
ambl wrote:
1. I need to add instruments while the strategy is running, Instruments.Add will not trigger the provider to subscribe while the strategy is running.

Look at RollSellSide.OnSubscribe, it receives main instrument and subscribes to underlying instrument regardless of strategy mode (backtest/live).

ambl wrote:
2. I need to use multiple providers, Instruments.Add does not allow for me to specify which provider to subscribe with.

Try to use AddInstrument(instrument, provider)


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: Bing [Bot] 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