Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Initialize

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

    Initialize

    Hi,

    I have to manage many strategy and to check they are launch.

    For do that, i write in a text file (separate for each startegy) from Initialize event.

    But when i launch 1 strategy, all the "initialize" from all strategy are execute, so :

    how to do for Initialize is execute only when the strategy is launch and not the others ?
    or
    where to put the code (for writing to text file ) for be excute only when the current strategy is launch ?

    regards

    Laurent

    #2
    Laurent,

    You should never place any code logic in Initialize(). If you want something to evaluate just once do it in OnBarUpdate().

    Code:
    if (CurrentBar == 0)
         // Do something;
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      Laurent,

      You should never place any code logic in Initialize(). If you want something to evaluate just once do it in OnBarUpdate().

      Code:
      if (CurrentBar == 0)
           // Do something;
      many thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      650 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      370 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      577 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X