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:




    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:



    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 LawrenHom, Today, 10:45 PM
      0 responses
      3 views
      0 likes
      Last Post LawrenHom  
      Started by love2code2trade, Yesterday, 01:45 PM
      4 responses
      28 views
      0 likes
      Last Post love2code2trade  
      Started by funk10101, Today, 09:43 PM
      0 responses
      7 views
      0 likes
      Last Post funk10101  
      Started by pkefal, 04-11-2024, 07:39 AM
      11 responses
      37 views
      0 likes
      Last Post jeronymite  
      Started by bill2023, Yesterday, 08:51 AM
      8 responses
      44 views
      0 likes
      Last Post bill2023  
      Working...
      X