DataLoader in Future  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
Alexxx
Posts: 25
Joined: 28 Aug 2014
Has thanked: 4 times
Been thanked: 2 times

DataLoader in Future

Postby Alexxx » 27 Oct 2014

For more fast calc Bar-to-bar in "Change resolution" trade/bid/ask tick DataLoader I want to try loading some bars from future (its playback mode, ticks of future I have db). I collect this result to collection and will work with this collection. As I understand it give less queries to db.

I want to try it do with this code:

Code: Select all

InstrumentDataRequest Request = Bars.Request;
Request.Resolution = new Resolution { Size = 1, Type = EResolution.Tick };
Request.FilterOutOfRangeData = false;

Request.Range = DataRequest.CreateFromTo(Bars.Time[0].AddHours(2), Bars.Time[1]);

Request.Range.ToAlwaysIsNow = false;

IDataLoaderResult iResTrade, iResAsk, iResBid;
Request.QuoteField = RequestQuoteField.Trade;
manualEventTrade[0] = new ManualResetEvent(false);
iResTrade = DataLoader.BeginLoadData(Request, OnData, manualEventTrade[0]);

Request.QuoteField = RequestQuoteField.Ask;
manualEventsAsk[0] = new ManualResetEvent(false);
iResAsk = DataLoader.BeginLoadData(Request, OnData, manualEventsAsk[0]);

Request.QuoteField = RequestQuoteField.Bid;
manualEventsBid[0] = new ManualResetEvent(false);
iResBid = DataLoader.BeginLoadData(Request, OnData, manualEventsBid[0]);
But in result I have ticks as range from Bars.Time[1] to Bars.Time[0]. Its don't download ticks from future :)

This restriction MС or I do something wrong?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: DataLoader in Future  [SOLVED]

Postby Henry MultiСharts » 28 Oct 2014

Hello Alexxx,

There are no such restrictions. If the request is correct then the data will be returned.
"Ticks of future" should be requested from the calculation time, not from the current time.

Code: Select all

Request.Resolution = new Resolution { Size = 1, Type = EResolution.Tick };
Request.Range = DataRequest.CreateFromTo(Bars.Time[0].AddHours(2), Bars.Time[1]);
This request is incorrect. From should be less than To.

Alexxx
Posts: 25
Joined: 28 Aug 2014
Has thanked: 4 times
Been thanked: 2 times

Re: DataLoader in Future

Postby Alexxx » 28 Oct 2014

Hello Alexxx,

There are no such restrictions. If the request is correct then the data will be returned.
"Ticks of future" should be requested from the calculation time, not from the current time.

Code: Select all

Request.Resolution = new Resolution { Size = 1, Type = EResolution.Tick };
Request.Range = DataRequest.CreateFromTo(Bars.Time[0].AddHours(2), Bars.Time[1]);
This request is incorrect. From should be less than To.
Thanks! It`s my mistake, sorry.


Return to “MultiCharts .NET”