• 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

Loading same indicator twice in one chart hiding another.

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

    Loading same indicator twice in one chart hiding another.

    Hi,

    Attached is a simple custom (fake) indicator that is assigned to a 1000 volume chart twice but only one of the instances is showing up a a given time after pressing F5 to Reload. The first instance is assigned as InputValue = 1, the second as InputValue = 2.

    It draws on the both price panel as well as its own panel. The problem is something is preventing them both to be active at the same time. Press F5 will sometimes toggle it to the other one and sometimes even to no indicator at all as shown:

    https://postimg.org/image/p2aly0c25/
    https://postimg.org/image/ish9xhre3/

    The NT8 caching mechanism looks like it is supposed to include the InputValue so not sure why this isn't working. Maybe I just have some parameter set incorrectly. Could someone give it a try to reproduce? Here is the test indicator:

    http://www.filedropper.com/testindicator

    Thanks,
    Chris
    Last edited by crokusek; 09-29-2016, 12:03 AM.

    #2
    Thanks, we could reproduce and isolated the behavior to the cast

    Code:
    // Line #91
    Rectangle r = DrawObjects[tag] as Rectangle;
    We are looking into why this is happening under NTEIGHT-10467. I will let you know if there is a temporary solution.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hi,

      This stack trace is hopefully the same location you found but just in case (it is happening in a different indicator): It happens < 1/1000 of the time calls to OnBarUpdate() so is probably some race/multi-thread/locking issue.

      Thanks,
      Chris


      Exception: NinjaTrader.NinjaScript.Indicators.Crokusek.Indica tor123 7ECAC7 ES 12-16

      Exception: 10/3/2016 12:15:13 PM Destination array was not long enough. Check destIndex and length, and the array's lower bounds.

      at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
      at System.Collections.Generic.List`1.CopyTo(T[] array, Int32 arrayIndex)
      at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
      at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
      at NinjaTrader.Gui.Chart.ChartPanel.get_ChartObjectsR enderSorted()
      at NinjaTrader.Gui.Chart.ChartPanel.get_ChartObjects( )
      at System.Linq.Enumerable.<SelectManyIterator>d__16`2 .MoveNext()
      at NinjaTrader.Gui.Chart.ChartControl.get_ChartObject s()
      at NinjaTrader.Gui.NinjaScript.DrawObjects.get_Item(S tring tag)
      at NinjaTrader.NinjaScript.Indicators.Crokusek.LomoHi mo.CalculateCurrentExpectedValue() in d:\Documents\NinjaTrader 8\bin\Custom\Indicators\Crokusek\Indicator123.cs:l ine 447
      at NinjaTrader.NinjaScript.Indicators.Crokusek.LomoHi mo.OnBarUpdateInternal() in d:\Documents\NinjaTrader 8\bin\Custom\Indicators\Crokusek\Indicator123.cs:l ine 192
      at NinjaTrader.NinjaScript.Indicators.Crokusek.Crokus ekIndicatorBase.OnBarUpdate() in d:\Documents\NinjaTrader 8\bin\Custom\Indicators\Crokusek\CrokusekIndicator Base.cs:line 65

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by jecoyeko, Today, 12:45 AM
      0 responses
      4 views
      0 likes
      Last Post jecoyeko  
      Started by Newtrader101, Yesterday, 06:31 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_EricB  
      Started by Tyler7498, Yesterday, 07:34 PM
      0 responses
      4 views
      0 likes
      Last Post Tyler7498  
      Started by Woomera, Yesterday, 07:24 PM
      2 responses
      10 views
      0 likes
      Last Post Woomera
      by Woomera
       
      Started by Newtrader101, Yesterday, 12:31 PM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_EricB  
      Working...
      X