Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DataLoaded question about when in a series is updated

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

    DataLoaded question about when in a series is updated

    In my strategy I have a series in the Dataloaded section , that is an indicator with certain arguments: ie MyIndicator( minValue, Maxvalue) based on time of day I want to adjust one or more arguments to different values. I have this in a procedure in the OnBarUpdate. and as the strategy processes, it will be during various times. So is the Dataloaded only processed during initial enabling of the strategy or can the data be manipulated during the live trading? or do I need to place this under OnBarUpdate section

    #2
    I think I understand the DataLoaded is one time deal, so I created a series of IF statements under OnBarUpdate, and added the MyIndicator(minVal,Maxval) I just wonder if it takes any extra processing and if its reloading the data each bar. I still have the indicator in the Dataloaded section.

    Comment


      #3
      Hello set2win,

      Thanks for your post.

      State.DataLoaded is called only once after all data series have been loaded. It is used for logic that needs to access data-related objects like Bars, Instruments, BarsPeriod, TradingHours or instantiating indicators, notifies that all data series have been loaded, and initializes any class level variables (including custom Series<T> objects).

      If you would like to adjust the values passed into the indicator during certain times, you must do so in the OnBarUpdate() method as you have described.

      See this help guide page for more information about NinjaScript States: https://ninjatrader.com/support/help...tatechange.htm

      And, see this help guide page for more information about the NinjaScript Lifecycle: https://ninjatrader.com/support/help...fecycle_of.htm

      Let me know if I may assist further.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      134 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X