SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Thu Aug 22, 2019 5:02 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Apr 05, 2019 11:24 am 
Offline

Joined: Thu Dec 06, 2018 1:57 am
Posts: 28
I have found what looks to me like a bug. The EventManager does not emit quotes. I'm running this from Scenario_. I'm subscribing to the the bid/ask events but these events are never raised (never printing) when I add a quote series to the DataSimulator. Try the code:

EventManager.Dispatcher.Bid += (object sender, Bid bid) => { Console.WriteLine(bid); };
EventManager.Dispatcher.Ask += (object sender, Ask ask) => { Console.WriteLine(ask); };

DataSimulator.SubscribeAll = false;
TickSeries bids = DataManager.GetHistoricalBids("EURCHF", new DateTime(2015,1,1), new DateTime(2020,1,1));
TickSeries asks = DataManager.GetHistoricalAsks("EURCHF", new DateTime(2015,1,1), new DateTime(2020,1,1));

QuoteSeries quotes = new QuoteSeries();
for(int i = 0; i < bids.Count; i++)
{
quotes.Add(new Quote((Bid)bids[i], (Ask)asks[i]));
}
DataSimulator.Series.Add(quotes);

StartStrategy(strategy, StrategyMode.Backest)


However if we use:
DataSimulator.Series.Add(bids);
DataSimulator.Series.Add(asks);
The bid/ask events are raised and printed as expected.

Is this correct behaviour?


Top
 Profile  
 
PostPosted: Mon Jul 08, 2019 12:48 pm 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 497
Code looks correct, but
Bid/Ask which coming from Quote will not be sent to all events in framework to avoid duplicates.
So Dispatcher cannot receive Bid/Ask from Quotes.
But you can still receive it using strategy and push it to scenario(if necessary).


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