• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT Is Passing A DISPOSED Bars Array Into Plot()!

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

    NT Is Passing A DISPOSED Bars Array Into Plot()!

    Yikes!

    A test case is attached: I have gotten 5% false positive results: some magic APPEARED to happen when I commented some of the lines out of Initialize (such as COBC); but in any case, the following output is from my console (it has happened both on a live connection and on the Replay):

    lastBackFillBar=290015
    Finish BackFill[1] Volume = 6258
    Plot(): CurrentBar=290015 BarsInProgress=1 BarsArray[1].Disposed=True backFill=False

    ALSO: this ONLY has happened for me on non-minute bar types: the above was printed from a Point And Figure [1, 1, 3] on 6E 06-14 (the primary series). On a 5 minute chart w/ the same instrument, the error has NEVER appeared.

    FURTHER: I was tipped by the debugger catching an early index range exception (below): this paring-out of my code is intended to back-fill the chart using the series added in Init: once backfill is complete, the series is disposed. On the minute charts, NT will iterate BarUpdate for every 'historical' bar in BOTH series' before passing anything to Plot. However, on the non-minute types (it also happens on volume, range, etc) NT actually will pass the last 1-2 'historical' bars of the added series to Plot (and I was not checking BarsInProgress since I dispose of the series) and my code would try accessing ChartControl.GetYByValue assuming this was a non-historical bar (and I also assumed series 0, but that in fact wouldn't matter: it's the fact then the series is actually disposed, and on this exact method the index exception would rise) -- the line raising this exception is present in the test case, and you should be able to trap that.

    The above exception:

    A first chance exception of type 'System.IndexOutOfRangeException' occurred in NinjaTrader.Core.dll
    An exception of type 'System.IndexOutOfRangeException' occurred in NinjaTrader.Core.dll but was not handled in user code
    Additional information: Index was outside the bounds of the array.

    2014-05-18 19:33:00:627 ERROR: Error on plotting indicator 'MarketDataTest'. Please check the 'OnBarUpdate' or the 'Plot' method: Index was outside the bounds of the array.
    Attached Files

    #2
    Hello steevcoco,

    Thank you for your post.

    Is this the full .cs file you are using? It is missing the "#region NinjaScript generated code. Neither change nor remove." region that is necessary for the indicator to run properly.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      PatrickH:

      ... The code was lost during a debug session when I did some copy/paste. It took a while for me to notice; and I'm seeing that also NT does not re-generate the code when I compile ... I thought perhaps that was because the code was inserted elsewhere ...

      I just now ran the New Indicator Wizard and re-entered the code in a new Indi ... but the same condition appears. The new code is attached.

      There IS ALSO ANOTHER strange condition I just recently discovered; and was going to post about -- it happens for this brand-new Indi, as well as the one I'm developing:

      When closing the properties dialog for the Indi, after clicking "OK", the dialog populates with a Plot called "Dummy". This does not appear in the Indi when plotted, but it actually then lives in the properties dialog! It took a while for me to notice since my code currently has no properties in the dialog; but I've just started to expose them ... and so I just noticed that. It is also appearing in this brand-new wizard-generated Indi that's attached. Can you help with that too?
      Attached Files

      Comment


        #4
        Hello steevcoco,

        Thanks for reporting this. This is outside of our Supported code especially disposing of a BarsArray object but I can see what you are trying to go for here.

        I will report this to our development team to look into this further.

        Happy to be of further assistance.
        JCNinjaTrader Customer Service

        Comment


          #5
          "Dummy" Plot

          OK JC: thanks for that.

          Can you tell me anything about the "Dummy" plot? -- It is still showing in my indi. Attached is a screen capture of the properties dialog of the Indi I attached in my prior post (with no code changes -- that was a wizard-generated Indi) ... There is a Plot property called "Dummy" ...Obviously, not in the code.
          Attached Files

          Comment


            #6
            Hello steevcoco,

            Yes, is is the initial setting for a Plot inside of the Core NinjaTrader Engine. Since you are not adding a Plot inside of your indicator but you are setting "PlotsConfigurable = true;" inside of NinjaTrader, when you apply the Indicator to the Chart NinjaTrader will use the initial settings for this.

            Since you are not adding a Plot you may want to remove that "PlotsConfigurable".

            Happy to be of further assistance.
            JCNinjaTrader Customer Service

            Comment


              #7
              Thanks JC!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by claxxical, Today, 10:00 PM
              0 responses
              5 views
              0 likes
              Last Post claxxical  
              Started by ct, Today, 08:13 PM
              0 responses
              6 views
              0 likes
              Last Post ct
              by ct
               
              Started by Lumbeezl, Today, 05:17 PM
              0 responses
              6 views
              0 likes
              Last Post Lumbeezl  
              Started by wishing, Today, 03:33 PM
              0 responses
              10 views
              0 likes
              Last Post wishing
              by wishing
               
              Started by ATMtrader0001, Today, 01:48 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_PaulH  
              Working...
              X