Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Handling events outside of NT?

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

    Handling events outside of NT?

    Guys,

    I'd like to execute some external code (written by myself, in C#, but outside of NT...a la not NinjaScript) on every trade. I see the OnExecution method in the API docs, but this appears to only be in relation to strategies. Is there a way to do this?

    Thanks,
    Nijwiv

    #2
    Hi Nijwiv, there is not a way to have some code fire on every trade (discretionary and automated), but there are events for every strategy trade as you've noticed (OnOrderUpdate, OnExecution, etc).

    Let us know if you have any other questions.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Austin View Post
      Hi Nijwiv, there is not a way to have some code fire on every trade (discretionary and automated), but there are events for every strategy trade as you've noticed (OnOrderUpdate, OnExecution, etc).

      Let us know if you have any other questions.
      Austin,

      Thanks. Would polling from an external app be a bad approach here, and if so, why? In other words, I could imagine setting my app to poll every 2-3 seconds call the Orders() client method to get a list of all orders. I assume that the order id is always unique, so I should be able to "monitor" orders in this way? I'm not sure how long an order will be returned by an Orders() call however.

      Could you please share some insight on this approach?

      Thanks!

      Comment


        #4
        nijwiv,

        You could try. I don't foresee any major issues. Unfortunately this is beyond the level of support we can offer though.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks Josh.

          Can you tell me:
          1. Is Order id always guaranteed to be unique on a per client basis?
          2. How long will orders be returned from client.Orders()?
          Thanks!

          Comment


            #6
            1. No, you should use Token.
            2. Not sure what you mean. Unfortunately this is beyond the scope of what we can offer support for and there is little more information I can provide.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              1. No, you should use Token.
              2. Not sure what you mean. Unfortunately this is beyond the scope of what we can offer support for and there is little more information I can provide.
              All I mean is that there is a set of orders returned from this method call, and I'm interested in how long after execution an order will continue to be returned from this.

              Thanks. I appreciate your help.

              Comment


                #8
                nijwiv,

                The return does not remove any orders even if they are filled.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                571 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                331 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                101 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                549 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                550 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X