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 ageeholdings, Today, 07:43 AM
    0 responses
    11 views
    0 likes
    Last Post ageeholdings  
    Started by pibrew, Today, 06:37 AM
    0 responses
    4 views
    0 likes
    Last Post pibrew
    by pibrew
     
    Started by rbeckmann05, Yesterday, 06:48 PM
    1 response
    14 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    9 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    12 views
    0 likes
    Last Post burtoninlondon  
    Working...
    X