Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Instrument name for indicator of State.Configure

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

    Instrument name for indicator of State.Configure

    I have an indicator that uses property NinjascriptBase.Instrument within OnStateChange when State is State.Configure. Applying this indicator to a chart there are no issues, but using this indicator from a strategy, NinjascriptBase.Instrument is null. What's the correct way to get the instrument name? Or maybe the question is what's the correct way to use the indicator from the strategy so Instrument is not null? Right now as a work around I added a NinjaScriptProperty to pass the IntrumentName from the strategy but I'm assuming there's a better way.

    #2
    Hello Philmera,

    Thank you for your post.

    In NinjaTrader 8 you cannot rely on the instrument information to be loaded in Configure which would occur before the DataLoaded State. If you need to pull instrument information from the Indicator I would wait until a state after DataLoaded. You can take a look at the order of the States at the following link: http://ninjatrader.com/support/helpG...tatechange.htm

    With that said, it means calling an indicator from a strategy where the indicator is accessing or adding a series based on any of the Instrument items will not work. There is no guarantee the information would be loaded when the strategy calls the indicator. It would be recommend to add or call any data based on the Instrument from within the calling strategy or indicator.

    Instrument data such as BarsPeriod would not be available in State.Configure and would return null. If you wanted to dynamically add another bar series based on the bar type and value of the primary series, you could not do so in NinjaTrader 8.

    Please let me know if you have any questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Max238, Today, 01:28 AM
    1 response
    22 views
    0 likes
    Last Post CactusMan  
    Started by giulyko00, Yesterday, 12:03 PM
    2 responses
    10 views
    0 likes
    Last Post giulyko00  
    Started by r68cervera, Today, 05:29 AM
    0 responses
    4 views
    0 likes
    Last Post r68cervera  
    Started by geddyisodin, Today, 05:20 AM
    0 responses
    6 views
    0 likes
    Last Post geddyisodin  
    Started by JonesJoker, 04-22-2024, 12:23 PM
    6 responses
    38 views
    0 likes
    Last Post JonesJoker  
    Working...
    X