SmartQuant Discussion

EventManager does not raise quotes
Page 1 of 1

Author:  abasqd [ Fri Apr 05, 2019 11:24 am ]
Post subject:  EventManager does not raise quotes

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?

Author:  skuvv [ Mon Jul 08, 2019 12:48 pm ]
Post subject:  Re: EventManager does not raise quotes

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

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group