- Code: Select all
O2GRequestFactory factory = session.getRequestFactory();
if (factory != null)
{
O2GTimeframe tf = factory.Timeframes[timeframeName];
O2GRequest request = factory.createMarketDataSnapshotRequestInstrument("EUR/USD", tf, 300);
DateTime dtFrom = new DateTime(2017,10,10);
DateTime dtTo = new DateTime(2018,10,10);
dtFrom = string.IsNullOrEmpty(sFrom) ? factory.ZERODATE : DateTime.Parse(sFrom);
dtTo = string.IsNullOrEmpty(sTo) ? factory.ZERODATE : DateTime.Parse(sTo);
factory.fillMarketDataSnapshotRequestTime(request, dtFrom, dtTo, false);
session.sendRequest(request);
responseListener.ResponseHandle.WaitOne(30000); //30 seconds timeout
}
I suppose to get response type as MarketDataSnapshot , but i am always getting response of type CommandResponse, Can you please mention what is wrong in this method ?