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 NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X