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

How do I find out what the conclusion to an entry order was?

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

    How do I find out what the conclusion to an entry order was?

    How do I find out what happened to an order with a "foo" signal? I have use .FromEntrySignal, however if the exit is a "close on session", I do not know what happened to "foo" order. Not to mention other variables such as closed from broker side etc.
    How do I make it so that I am able to monitor any exits to my "foo" order? I have stops and targets in place, but those .FromEntrySignals get disposed if it's "close on session". I just need to know what was the conclusion to an order. In other words, what was the exit price of "foo"?

    FYI, I am not able to do this: https://ninjatrader.com/support/foru...rogramatically
    But if there's a way to expose how this metric tracks my strategy orders behind the scenes, that might be helpful.

    Thanks.




    Last edited by lakersfan; 07-03-2020, 09:29 AM. Reason: added resoruces that might help in finding out what happened to a position placed by a strategy

    #2
    Hello lakersfan,

    Thank you for your post.

    It looks like you've already been working with several of my colleagues in the other thread you linked, so since they have been working with you already on that, I would encourage you to follow up on that thread. They're currently out of the office for the 4th of July holiday, but will get back to you when they return on that particular issue.

    Are you monitoring your orders in OnExecution? You can track if the order's been filled that way. But when Exit on Session Close is used, that would be what concluded the order in that case. You could monitor for an execution with the name "Exit on session close" to see that.

    If that's not quite what you're trying to do, an example script would be helpful. You can export a script from Tools > Export > NinjaScript Add-on and attach the resulting .zip file to your reply.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Kate View Post
      Hello lakersfan,

      Thank you for your post.

      It looks like you've already been working with several of my colleagues in the other thread you linked, so since they have been working with you already on that, I would encourage you to follow up on that thread. They're currently out of the office for the 4th of July holiday, but will get back to you when they return on that particular issue.

      Are you monitoring your orders in OnExecution? You can track if the order's been filled that way. But when Exit on Session Close is used, that would be what concluded the order in that case. You could monitor for an execution with the name "Exit on session close" to see that.

      If that's not quite what you're trying to do, an example script would be helpful. You can export a script from Tools > Export > NinjaScript Add-on and attach the resulting .zip file to your reply.

      Please let us know if we may be of further assistance to you.
      Hi Kate, this is an entirely different thread. I only mentioned the other thread to let you know what i've tried. Yes this is OnExecution() All I want to know is the exit of a position that the strategy placed. I can assign it ""Exit on session close", but then what about any other orders that exit a position that the strategy placed. Emphasis on the entries the strategy took, as that is the owner of that entry.

      Comment


        #4
        Hello lakersfan,

        Thank you for your reply.

        I am not certain what you are trying to do based on the description. Could you provide a sample of what you specifically tried that didn't work? I understand you linked the other thread however I would not want that information but instead what you tried now to open this thread.

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          I have tried .FromEntrySignal == “foo” but only a stop or target will tag that. How do I make it so that any order that closes entry order “foo”. Gets tagged as closing “foo”. Could be a session on close, or a buy/sell order that closed “foo.”

          Comment


            #6
            Hello lakersfan,

            Thank you for your reply.

            It would not be possible to change the name of the exit on session close order or other orders submitted automatically due to order handling rules. You would need to turn off the Exit on Close and program your own exit on session close behavior into the strategy if you want that to have a different name.

            Please let us know if we may be of further assistance to you.
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Kate View Post
              Hello lakersfan,

              Thank you for your reply.

              It would not be possible to change the name of the exit on session close order or other orders submitted automatically due to order handling rules. You would need to turn off the Exit on Close and program your own exit on session close behavior into the strategy if you want that to have a different name.

              Please let us know if we may be of further assistance to you.
              I do not want to change the name of the exit. All I want to know is if my "foo" entry was closed, then how was it closed/ by what method was it closed, and what was the name of the close. There's different ways to close a position, Exit on session close" a setStopLoss tag, a profit tag, from the broker side, a Buy order, a Buy Market order (or sell). These all have different order names (that I've seen), how do I expose "tag" the name of the order that closed a position that my strategy entered?

              Comment


                #8
                Hello lakersfan,

                Thank you for your reply.

                The tags for exits submitted by NinjaTrader will be the same as they appear on a chart when they occur. So, for example, the Signal name for an Exit on Session Close order is simply "Exit on session close". You can see this in a Strategy Performance window - it will be listed in there along with the names you set for your own specific orders.

                Please let us know if we may be of further assistance to you.
                Kate W.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Kate View Post
                  Hello lakersfan,

                  Thank you for your reply.

                  The tags for exits submitted by NinjaTrader will be the same as they appear on a chart when they occur. So, for example, the Signal name for an Exit on Session Close order is simply "Exit on session close". You can see this in a Strategy Performance window - it will be listed in there along with the names you set for your own specific orders.

                  Please let us know if we may be of further assistance to you.
                  Correct, those are the ones I am talking about. How do I expose those programatically? Can you give me an example? Let's say I have an entry signal named "Foo". How will I know which of those (besides the ones that have the entry signal .FromEntrySignal tag. How will I know which one of those closed my "Foo" position programatically? Looking for a code example. Thanks!
                  Last edited by lakersfan; 07-07-2020, 07:38 PM.

                  Comment


                    #10
                    Hello lakersfan,

                    Thank you for your reply.

                    If you're just looking to find out what closed a trade after it closes, I'm attaching an example of how to get the name of the closing order from the TradeCollection.

                    If this isn't what you're looking for, a simple example script illustrating a use case would be helpful.

                    Please let us know if we may be of further assistance to you.
                    Attached Files
                    Kate W.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by rdtdale, Today, 01:02 PM
                    0 responses
                    1 view
                    0 likes
                    Last Post rdtdale
                    by rdtdale
                     
                    Started by alifarahani, Today, 09:40 AM
                    3 responses
                    15 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by RookieTrader, Today, 09:37 AM
                    4 responses
                    18 views
                    0 likes
                    Last Post RookieTrader  
                    Started by PaulMohn, Today, 12:36 PM
                    0 responses
                    6 views
                    0 likes
                    Last Post PaulMohn  
                    Started by love2code2trade, 04-17-2024, 01:45 PM
                    4 responses
                    40 views
                    0 likes
                    Last Post love2code2trade  
                    Working...
                    X