Page 1 of 1

Historical Data

PostPosted: Mon Feb 19, 2018 1:32 pm
by imzombie13
Hello, I am trying to fetch historical data, I am using this code to send request

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

                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 ?

Re: Historical Data

PostPosted: Wed Feb 21, 2018 9:59 am
by Apprentice
Forwarded to the development team.

Re: Historical Data

PostPosted: Tue Feb 27, 2018 2:52 am
by PetroIV
Hello imzombie13,
Your code is correct. A similar logic is used in the sample NonTableManagerSamples/GetHistPrices. The output of the GetHistPrices sample is historical data. Could you please confirm the following points:
1. Are you able to run the GetHistPrices sample with filled parameters in App.config?
2. Do you get prices in the output?