CustomInstrument for the resolution same as primary data's

Questions about MultiCharts .NET and user contributed studies.
sunrisus
Posts: 5
Joined: 19 Mar 2019
Has thanked: 2 times

CustomInstrument for the resolution same as primary data's

Postby sunrisus » 21 Mar 2019

Hi from a new comer!

I have been playing with data retrieving using CustomInstrument, and noticed that it is working fine for retrieving instruments except the resolution the same as the primary data's.. I know I could do it with DataLoader, but the later is not bond with primary bars and would make plotting more difficult. It would be nicer if Multicharts would allow requesting new instruments with the same resolution as the primary data's, facilitating plotting.

I also know I could bypass the problem by loading data2 to chart, and using BarsOfData(2) , but if I were to manually load 10-20 instruments to chart every time, that would be a painful process.

I am not sure if not allowing the resolution same as primary series is by design or a bug.

The following is the sample code, with primary chart data resolution of 1 day. All resolutions works fine except the resolution the same as primary data's.

Code: Select all

using System;
using System.Drawing;
using PowerLanguage.Function;
using System.Collections.Generic;

namespace PowerLanguage.Indicator
{
//[SameAsSymbol(true)]
public class _aTest : IndicatorObject
{

CustomInstrument inst2;

public _aTest(object ctx) : base(ctx){
}

protected override void Create(){
}

protected override void StartCalc(){
inst2 = new PowerLanguage.CustomInstrument(
Bars,
"TS",
SymbolStorage.GetSymbols("TS", "QQQ")[0],
new Resolution { Size = 1, Type = EResolution.Minute },
//new Resolution { Size = 1, Type = EResolution.Hour },
//new Resolution { Size = 1, Type = EResolution.Day },
//new Resolution { Size = Bars.Info.Resolution.Size, Type = Bars.Info.Resolution.Type },
true,
RequestQuoteField.Trade
);
}


protected override void CalcBar(){
Output.WriteLine("inst2.CloseValue={0}", inst2.CloseValue);
}

protected override void Dispose( bool _b)
{
inst2.Dispose();
}
}
}
_aTest.pln
(1.2 KiB) Downloaded 315 times
Last edited by sunrisus on 26 Mar 2019, edited 1 time in total.

User avatar
Anna MultiCharts
Posts: 560
Joined: 14 Jul 2017
Has thanked: 42 times
Been thanked: 140 times

Re: CustomInstrument for the resolution same as primary data

Postby Anna MultiCharts » 26 Mar 2019

Hello, sunsirius!

We’ve checked your case on our end. Your study works fine when anything but 1 day is selected for the resolution of the main data series. With minute-based main data series the data for the additional instrument having the same resolution is extracted fine with the help of CustomInstrument, but with 1 day there appears an error. Please confirm that the situation is the same on your end or please be more specific about the exact resolutions that you cannot access using CustomInstrument. Also please attach a screenshot of the error if you receive any.

sunrisus
Posts: 5
Joined: 19 Mar 2019
Has thanked: 2 times

Re: CustomInstrument for the resolution same as primary data

Postby sunrisus » 26 Mar 2019

Thank you Anna! I am sorry I did not check 1 min as main data resolution, I will check that once I get home.. But my experience is basically exact as you described, I always faill to retrieve 1 day data with CustomInstrument when I set the main chart daily. I did try to attach the captured error image, but could not manage to insert that image.

sunrisus
Posts: 5
Joined: 19 Mar 2019
Has thanked: 2 times

Re: CustomInstrument for the resolution same as primary data

Postby sunrisus » 26 Mar 2019

Hi Anna, I rechecked the problem, and list the result as follows. It seems like still as I said: the problem is with the CustomeInstrument set to the resolution the same as the primary series'. Error messages are all similar except the second line which indicates the chart resolution used,. Two error message images are attached, 1day primary resolution with 1 day CustomInstrument resolution, and 1 minute primary resolution with 1 min CustomInstrument resolution.
Capture.PNG
(35.38 KiB) Downloaded 419 times
Capture.PNG
(35.38 KiB) Downloaded 418 times
Capture.PNG
(19.29 KiB) Downloaded 430 times

User avatar
Anna MultiCharts
Posts: 560
Joined: 14 Jul 2017
Has thanked: 42 times
Been thanked: 140 times

Re: CustomInstrument for the resolution same as primary data's

Postby Anna MultiCharts » 17 Apr 2019

sunsirius,

Sorry for the delayed reply. This was confirmed to be a bug, the fix is currently targeted to MultiCharts 13.

sunrisus
Posts: 5
Joined: 19 Mar 2019
Has thanked: 2 times

Re: CustomInstrument for the resolution same as primary data's

Postby sunrisus » 18 Apr 2019

Thank you very much, Anna! I appreciate your effort striving to improve

sunrisus
Posts: 5
Joined: 19 Mar 2019
Has thanked: 2 times

Re: CustomInstrument for the resolution same as primary data's

Postby sunrisus » 28 Dec 2020

The same problem has not been solved on the new release 14 (Build 21360). The sample image is for the daily chart of QQQ, with the CustomInstrument set to 1 day.
Capture.PNG
(20.19 KiB) Not downloaded yet

User avatar
Vlada MultiCharts
Posts: 293
Joined: 22 Apr 2020
Has thanked: 8 times
Been thanked: 76 times

Re: CustomInstrument for the resolution same as primary data's

Postby Vlada MultiCharts » 19 Mar 2021

Hello everyone,

Our development team is aware of the issue and we are working on implementing an improvement.
According to our current road map, we aim to introduce a fix in MultiCharts 15.

rc76
Posts: 44
Joined: 14 Oct 2020
Has thanked: 11 times

Re: CustomInstrument for the resolution same as primary data's

Postby rc76 » 04 Jun 2021

Hi Vlada,

Since MC15 is still quite sometime into the future, is there any current workaround (i.e. other methods we can try to use) to successfully load the other instruments with same resolution as primary data?

Cheers

User avatar
Vlada MultiCharts
Posts: 293
Joined: 22 Apr 2020
Has thanked: 8 times
Been thanked: 76 times

Re: CustomInstrument for the resolution same as primary data's

Postby Vlada MultiCharts » 09 Jun 2021

Hello rc76,

I checked it with the Engineering Team. Unfortunately, at the moment there is no workaround for the issue, it can only be fixed on our end.
You can check the What's New section on our website to see when the improvement is released.


Return to “MultiCharts .NET”