InstrumentDataRequest > Daily > Build from minutes

Questions about MultiCharts .NET and user contributed studies.
fabz
Posts: 4
Joined: 16 Mar 2015

InstrumentDataRequest > Daily > Build from minutes

Postby fabz » 16 Mar 2015

Hello,

I am currently trying to receive daily data for n-Days back of a specific bar within an intraday Chart. So far no problem to request data with usage of the DataLoader .

The only Problem I have with this is that I can not set the "Build from minutes"-Attribute for InstrumentDataRequest.Resolution and because of that I do not get correct daily data for my local timezone.
At least I have not found any information on how to set this attribute in code.

Can any one please help me with that? Is there maybe another option to receive the needed daily data (Without embedding a Daily-Instrument and using BarsOfData)?

Kind regards and thanks in advance,
Fabian

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

Re: InstrumentDataRequest > Daily > Build from minutes

Postby Henry MultiСharts » 19 Mar 2015

Hello Fabian,

"Build from minutes" attribute can be accessed from the code. Please use FID_BUILD_DAY_FROM_MINUTES. Example can be found here.

fabz
Posts: 4
Joined: 16 Mar 2015

Re: InstrumentDataRequest > Daily > Build from minutes

Postby fabz » 20 Mar 2015

Hello Henry,

thanks for your example of receiving such a value. But is it possible to set it via code too?

I've tried it like that:

Code: Select all

dtCurrent = new DateTime(Bars.Time[0].Year, Bars.Time[0].Month, Bars.Time[0].Day, 0, 0 ,0);
dtTo = dtCurrent;

InstrumentDataRequest Req = Bars.Request;

Req.Resolution = new Resolution { Size = 1, Type = EResolution.Day};
Req.Resolution.Attributes.Add(1150, 1);
Req.Range = DataRequest.CreateBarsBack(dtTo, ADRDays);
Req.SessionName = "24/5";
Req.FilterOutOfRangeData = true;
Req.Subscribe2RT = false;
Getting the same worse result as without Setting the Attribute...

Kind regards,
Fabian

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

Re: InstrumentDataRequest > Daily > Build from minutes

Postby Henry MultiСharts » 26 Mar 2015

Hello Fabian,

Here is the proper code:

Code: Select all

dtCurrent = new DateTime(Bars.Time[0].Year, Bars.Time[0].Month, Bars.Time[0].Day, 0, 0 ,0);
dtTo = dtCurrent;

InstrumentDataRequest Req = Bars.Request;

Req.Resolution = new Resolution { Size = 1, Type = EResolution.Day};
Req.Resolution.Attributes[1150] = 0; // 0 - false, 1 - true
Req.Range = DataRequest.CreateBarsBack(dtTo, ADRDays);
Req.SessionName = "24/5";
Req.FilterOutOfRangeData = true;
Req.Subscribe2RT = false;
We have identified an issue with using Req.Resolution.Attributes[1150] = 1. This command does not work. The fix of the issue is targeted to the next version of MultiCharts .NET.


Return to “MultiCharts .NET”