Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

State Configure, a General question

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

    State Configure, a General question

    I am writing a converter from NT7 to NT8 and I am doing some simplifications accepting to do some minor adjustments manually.
    For example I am placing all new class instantiation under DataLoaded because I think it works best in most cases. Is this the best general assumption to make?

    Also I am placing line of code having kewword like "ChartControl" under DataLoaded because I am certain they are available then. By chance is there a place where I can find which keywords goes where or I have to discover it case by case?
    Thank you.
    Gio




    #2
    Hello Gio,

    The help guide typically states in which state a property is constructed by, but not always.

    "Warning: The ChartControl and its methods and properties should ONLY be access once the State has reached State.Historical​"

    "Note: The ChartControl object is ONLY guaranteed to be available when a NinjaScript type initiates from a Chart Window. There are situations where an indicator or strategy starts from another Windows (such as the Control Center's Strategies Grid, or from a Strategy Analyzer), where the ChartContol object is NOT accessible. Therefore, the ChartControl object should always be safely accessed (e.g., from within a try-catch, or conditionally using null reference checks)"



    I would recommend first checking the help guide for each property to see if there is a note or warning on which state (or method) a property can be used in.

    Instantiating new objects is fine to do from State.DataLoaded.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    668 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    377 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    110 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    575 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    580 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X