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

NinjaTrader and Thread Usage

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

    NinjaTrader and Thread Usage

    Hello,

    I've created a new Timer() event handler within my strategy that does some housekeeping. I'm seeing some strange behaviour with the way the timer fires it's events - firing much more often than the interval set.

    I would assume only one NT thread would enter my Initialize() method, but the results I am getting makes me think maybe this is not the case.

    I tried to seach the forum for "threads" but as you can imagine, that's a tough word to seach for in a forum..

    Thanks,

    -Scott

    #2
    Initialize() method is accessed several times while in the process of loading your strategy. Like when it loads the strategy's default settings into the strategy dialog window for you to choose, it accessed Initialize() method once there.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks Josh,

      I don't really like the fact that my event hadler for my timer event is static since I have many instances of the same class. I think the cleaner way to handle some basic housekeeping is to utilize the OnOrderUpdate() event. This will be much more respective of system resources.

      Thanks for the quick response. I think I have figured out a better way to accomplish what I was trying to do.

      -Scott

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by adeelshahzad, Today, 03:54 AM
      5 responses
      32 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by stafe, 04-15-2024, 08:34 PM
      7 responses
      32 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by merzo, 06-25-2023, 02:19 AM
      10 responses
      823 views
      1 like
      Last Post NinjaTrader_ChristopherJ  
      Started by frankthearm, Today, 09:08 AM
      5 responses
      21 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      43 views
      0 likes
      Last Post jeronymite  
      Working...
      X