+1 888 340 6572
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_stroke.svg
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

minus.svg
Please log in to vote
0
Votes
pluse.svg
Please log in to vote
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
Apr 17, 2019 - 11:14
Hello, SUNSIRIUS!

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

Changes:
  •   icon_status.svgStatus 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
People involved
  • Posted by
    user-offline.png  SUNRISUS
  • Owned by
    Not owned by anyone
  • Assigned to
    Not assigned to anyone
  • Subscribers
    3 subscriber(s)
    Click here to show the list of subscribers
Times and dates
  • Posted at
  • Last updated
Issue details
  • Reproducability
    Not determined
Commits (0)
There are no code checkins for this issue
×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.