SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Tue Sep 29, 2020 2:18 am

All times are UTC + 3 hours

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

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]));

StartStrategy(strategy, StrategyMode.Backest)

However if we use:
The bid/ask events are raised and printed as expected.

Is this correct behaviour?

PostPosted: Mon Jul 08, 2019 12:48 pm 

Joined: Wed May 05, 2010 9:49 pm
Posts: 578
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).

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 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:  
Powered by phpBB® Forum Software © phpBB Group