+1 888 340 6572 GET STARTED
MultiCharts Project Management
previous_open_issue.png
Go to the previous open issue
previous_issue.png
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
bug_report_small.png
Open Bug report MC-2576

CustomInstrument fails with the resolution same as primary data's

action_vote_minus_faded.png
0
Votes
action_vote_plus_faded.png
next_issue.png
Go to the next issue (open or closed)
next_open_issue.png
Go to the next open issue
Description

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.

Steps to reproduce this issue

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

}

Comments (1)
#1
user-offline.png  MultiCharts Support (MultiCharts)
Apr 17, 2019 - 17:14
Hello, SUNSIRIUS!

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

Changes:
  •   icon_status.pngStatus changed: Under Review => Confirmed
  •   icon_milestone.pngMilestone changed: Not determined => MultiCharts 14 (RELEASED)
History
Issue basics
  • Type of issue
    Bug report
  • Category
    Not determined
  • Targeted for
    MultiCharts Future Releases
  • Status
    Confirmed
  • Priority
    Not determined
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
Issue details
  • Reproducability
    Not determined
Attachments (0)
There is nothing attached to this issue
Commits (0)
There are no code checkins for this issue
Duplicate issues (0)
This issue does not have any duplicates