• 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.

  • crokusek
    replied
    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

    Leave a comment:


  • NinjaTrader_Matthew
    replied
    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.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by fluffier, Yesterday, 11:49 PM
0 responses
2 views
0 likes
Last Post fluffier  
Started by GARZONJ, Yesterday, 09:02 PM
0 responses
2 views
0 likes
Last Post GARZONJ
by GARZONJ
 
Started by bouncetherubble, Yesterday, 08:42 PM
0 responses
3 views
0 likes
Last Post bouncetherubble  
Started by connorgrant5, Yesterday, 01:33 PM
1 response
14 views
0 likes
Last Post NinjaTrader_ShawnB  
Started by Mykro, Yesterday, 01:28 PM
7 responses
17 views
0 likes
Last Post Mykro
by Mykro
 
Working...
X