Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

NT hands and when removing data series from chart

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NT hands and when removing data series from chart

    hi, I am working on a multi-instrument indicator. The indicator has properties for symbol, bar type and period.

    The following steps cause NT to hangOpen a chart
    1. Add the indicator to the chart
    2. Configure two symbols
    3. View the chart - Initialize Adds the two symbol; everything ok so far
    4. Open indicator parameters and remove one of the symbols (by setting the symbol field to "")
    5. Go back to chart => Ninja hands and chart does not display anymore.

    Below is the simplest code I could make that reproduces this. It happens 100% of the time on my computer and on others computers as well.

    --Onn

    Code:
    namespace NinjaTrader.Indicator
    {
        [Description("")]
        public class Tester : Indicator
        {
            
            private string symbol1 = "";
            private int period1 = 15;
            private PeriodType type1 = PeriodType.Minute;
            
            private string symbol2 = "";
            private int period2 = 15;
            private PeriodType type2 = PeriodType.Minute;
            
            protected override void Initialize()
            {
                if (symbol1 != "")
                {
                    Add(symbol1, type1, period1);
                }
                
                if (symbol2 != "")
                {
                    Add(symbol2, type2, period2);
                }
            }
                
            protected override void OnBarUpdate()
            {
                return;
            }
            
            #region Properties
            
            public string Symbol1
            {
                get { return symbol1; }
                set { symbol1 = value; }
            }
            
            public int Period1
            {
                get { return period1; }
                set { period1 = value; }
            }
            
            public PeriodType Type1
            {
                get { return type1; }
                set { type1 = value; }
            }
            
            
            public string Symbol2
            {
                get { return symbol2; }
                set { symbol2 = value; }
            }
            
            public int Period2
            {
                get { return period2; }
                set { period2 = value; }
            }
            
            [Description("")]
            public PeriodType Type2
            {
                get { return type2; }
                set { type2 = value; }
            }
    
    
            #endregion
        }
    }
    Last edited by onnb1; 07-12-2014, 06:45 PM.

    #2
    Hello onnb1,

    Thank you for your post.

    There is an Index out of range of the array error that will get produced in your Trace file.

    What is occurring is in the first initialization is adding the other indexes to the BarsArray[] count
    When you remove the instrument, the BarArray object is still there and the reason you run into this error.

    I will confer with my colleagues on Monday about the scenario

    Thank you for your patience.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      hi, just checking if any update on this.

      Comment


        #4
        Hello onnb1,

        Thanks for your post.

        Cal is out today however I have another NinjaScript representative looking into this. If he gets more info today he will reply, otherwise Cal may work with the NinjaScript lead when they both return tomorrow to look into this further.
        BrandonNinjaTrader Customer Service

        Comment


          #5
          no worries; this is not urgent and can wait for Cal/tomorrow. Just wanted to follow up so it doesn't get lost

          Comment


            #6
            Onnb1,

            After some research, this is a limitation with the BarsArray object loading.

            Development is looking to handling this more gracefully in NT8, however dynamic adds will not be fully supported.
            Cal H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by FrancisMorro, Today, 03:24 AM
            0 responses
            1 view
            0 likes
            Last Post FrancisMorro  
            Started by Segwin, 05-07-2018, 02:15 PM
            10 responses
            1,769 views
            0 likes
            Last Post Leafcutter  
            Started by Rapine Heihei, 04-23-2024, 07:51 PM
            2 responses
            30 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by Shansen, 08-30-2019, 10:18 PM
            24 responses
            943 views
            0 likes
            Last Post spwizard  
            Started by Max238, Today, 01:28 AM
            0 responses
            10 views
            0 likes
            Last Post Max238
            by Max238
             
            Working...
            X