Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Torontobluejays, Today, 08:43 AM
      0 responses
      1 view
      0 likes
      Last Post Torontobluejays  
      Started by sastrades, 01-31-2024, 10:19 PM
      12 responses
      191 views
      0 likes
      Last Post sastrades  
      Started by Jimmyk, 01-26-2018, 05:19 AM
      8 responses
      864 views
      0 likes
      Last Post emuns
      by emuns
       
      Started by giulyko00, 04-24-2024, 12:03 PM
      6 responses
      29 views
      0 likes
      Last Post giulyko00  
      Started by 00nevest, 04-27-2024, 02:27 PM
      3 responses
      27 views
      0 likes
      Last Post 00nevest  
      Working...
      X