Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calling Update from DataLoaded or Configure runs OnBarUpdate

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

    Calling Update from DataLoaded or Configure runs OnBarUpdate

    Just wanted to report a small bug/undesirable side effect I found.

    I'm passing in non-default price series to an Indicator. (I need adjusted HLC values).

    I pass these in and then utilize them via a property as follows:

    Code:
          private ISeries<double> _lowSeries;
    
            [NinjaScriptProperty]
            [Browsable(false)]
            [XmlIgnore]
            public ISeries<double> LowSeries
            {
                set { _lowSeries = value; }
                get
                {
                    Update();
                    return _lowSeries ?? Low;
                }
            }
    Using a property like this permits me to Instantiate my indicator externally with Indicator(AdjHighSeries, AdjLowSeries, AdjCloseSeries) to use adjusted HLC via the property above. Or I can just call it using Indicator(null, null, null) and it will just use the base High, Low, Close values instead.

    However, I notice that if I try to access this property during Configure or Dataloaded; for example if needed as an input to ANOTHER indicator, that the call to Update() from the property results in OnBarUpdate running during the Configure / Data Loaded state.

    This results in a failure if there are dependencies that have not yet been set up. Ideally calls to Update() which happen before State.Historical should be ignored and should not run OnBarUpdate.

    I've managed to get around this by instantiating my internal indicator differently. But I thought I would report this. Clearly most people would never call it so early, but I think my use case is valid for doing so.

    #2
    Hello kevinenergy,
    Thanks for your post.

    I have submitted this as a feature request to our development team for consideration in future releases.

    The internal tracking number for your feature request is SFT-3567. Please reference this internal tracking number if you ever have questions regarding this feature request.

    When a feature request is implemented, you'll find it in the release notes:


    Josh G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    649 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    573 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    576 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X