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

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 Segwin, 05-07-2018, 02:15 PM
                14 responses
                1,789 views
                0 likes
                Last Post aligator  
                Started by Jimmyk, 01-26-2018, 05:19 AM
                6 responses
                837 views
                0 likes
                Last Post emuns
                by emuns
                 
                Started by jxs_xrj, 01-12-2020, 09:49 AM
                6 responses
                3,294 views
                1 like
                Last Post jgualdronc  
                Started by Touch-Ups, Today, 10:36 AM
                0 responses
                13 views
                0 likes
                Last Post Touch-Ups  
                Started by geddyisodin, 04-25-2024, 05:20 AM
                11 responses
                63 views
                0 likes
                Last Post halgo_boulder  
                Working...
                X