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 cmoran13, 04-16-2026, 01:02 PM
    0 responses
    51 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    31 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    165 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    100 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    160 views
    2 likes
    Last Post CaptainJack  
    Working...
    X