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

EventManager does not raise quotes
http://www.smartquant.com/forums/viewtopic.php?f=60&t=14900
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]));
}
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?

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
https://www.phpbb.com/