Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calling Enter/Exit from a different thread

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

    Calling Enter/Exit from a different thread

    Hi,

    Any reason to think calling Enter/Exit functions from a different thread will not work?

    Going back to the discussion before about going from limit->market order, I wanted to do a scheme where I create a limit order, but also setup a timer (say for 30 seconds in the future). If within 30 seconds my limit order isn't filled, I plan to change the limit order to a much lower price in order to fill immediately.

    According to MSDN docs, the thread that calls the timer event handler is from a separate thread-pool. I'll be careful with using lock() statements in my code, but want to double-check whether anything could possibly break on the back-end I'm not aware of.

    #2
    Again this is way beyond what we can provide support for. I wanted to point out again, that by using C# you certainly could code a lot of cool stuff. However, due to bandwidth limitation we are unable to provide support for that and need to focus our support resources to documented NinjaScript features.

    Thanks for your understanding.

    Nevertheless, here is another hint:
    >> According to MSDN docs, the thread that calls the timer event handler is from a separate thread-pool
    Try System.Window.Forms.Timer which would throw an event in the main thread.

    Comment


      #3
      Originally posted by NinjaTrader_Dierk View Post
      Nevertheless, here is another hint:
      >> According to MSDN docs, the thread that calls the timer event handler is from a separate thread-pool
      Try System.Window.Forms.Timer which would throw an event in the main thread.
      I'm fine with just a hint, and I understand.

      But how about a little more detail on the hint... is the main UI thread also the thread used for real-time events, as you previously might have said? If they're not... then I'm wondering if I'm really gaining something by using that thread, as opposed to generic thread.

      If the main UI thread is also the processing thread you use elsewhere, then it's probably the right thing for me to use.

      Comment


        #4
        >> is the main UI thread also the thread used for real-time events
        correct

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X