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 f.saeidi, Yesterday, 08:12 AM
      3 responses
      24 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by algospoke, Yesterday, 06:40 PM
      1 response
      14 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by quantismo, Yesterday, 05:13 PM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by The_Sec, 04-16-2024, 02:29 PM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_ChristopherS  
      Started by hurleydood, 09-12-2019, 10:45 AM
      15 responses
      1,099 views
      0 likes
      Last Post Leeroy_Jenkins  
      Working...
      X