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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    215 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    130 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    147 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    230 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    192 views
    0 likes
    Last Post CarlTrading  
    Working...
    X