Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 traderqz, Today, 12:06 AM
    6 responses
    12 views
    0 likes
    Last Post traderqz  
    Started by Skifree, Today, 03:41 AM
    3 responses
    12 views
    0 likes
    Last Post Skifree
    by Skifree
     
    Started by traderqz, Yesterday, 09:06 AM
    5 responses
    33 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by guillembm, Today, 11:25 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by owensd, 04-21-2024, 11:34 PM
    9 responses
    34 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X