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

SubmitOrder - how to associate entry exit to one Trade?

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

    SubmitOrder - how to associate entry exit to one Trade?

    Hi
    I would like to associate to one unique Trade, an entry and exit orders when using SubmitOrder (I have Unmanaged = true). At the moment my executed entries and exits are associated to different trades.

    For the entry I have 2 OCO orders, 1 buy and 1 sell:
    For example if the long is executed first, then the ShortSell is cancelled.
    Or if the ShortSell is executed First then the Long order is cancelled.

    Then in OnExecution method,
    if the Long was executed first I create a Sell order which is the corresponding exit.
    If the ShortSell (entry) was executed I create a BuyToCover order (exit).

    Even if the couple of Long and Sell orders are given the same exact name (or the couple of ShortSell and BuyTo Cover), I see they are not associated to the same Trade.
    I would like basically these couples to be associated to the same Trade.

    How can I achieve this?

    Thanks for your help
    Last edited by jakjak74; 12-21-2016, 08:48 AM.

    #2
    Hello jakjak74, and thank you for your question.

    A forums user marklekeny has provided an example as far as creating randomly generated OCO orders submitted with an associated order in this thread.



    We are happy to help with any questions that may come up.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Thank you. I don't think this answers my question though. Let me clarify a bit more my question as the core of the issue was not dealing with OCO orders.

      Let's say we pass an
      - order to go Long. Let's call it Entry1.
      Then we pass
      -an order to sell given some conditions. This is Exit 1.
      Later on we pass
      - an order to short sell (Entry 2)
      - and an exit order to Buy to cover (Exit 2).

      The logic is that Entry 1 is linked to Exit1. Same for Entry 2 and Exit 2.

      If the orders are executed at complete random times, how can I guarantee the Trades reporting in NinjaTrader does associate the orders according to my logic

      Trade1 = Entry1, Exit 1
      Trade 2 = Entry2, Exit 2

      Currently given the executions times I can see

      Trade1 = Entry1, Exit2
      Trade 2 = Entry2, Exit 1
      Which I don't want to see. Is there any rule we can link Entry1 and Exit 1 for unmanaged orders? I have tried by putting the same name for Entry and Exit but that doesn't do the job.

      Looking forward to your answer.
      Many thanks

      Comment


        #4
        Thank you for the additional information. I have submitted a feature request to the product management team for the following feature :
        This customer would like unmanaged orders with the same signal name (last parameter) to be tied together in execution reporting

        It is likely this feature, should it be implemented, will be implemented in NinjaTrader 8. I will follow up with more information as soon as it's available. If the feature requests already exists, a vote will be added to it.


        Please let us know if there are any other ways we can help.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Hello jakjak74,

          This feature is being reviewed by the product management team and has been assigned the following unique tracking ID


          SFT-1665


          Please note that multiple strategies feeding into the same account will need unique IDs for this approach to work without errors.



          Please let us know if there is any other way we can help.
          Jessica P.NinjaTrader Customer Service

          Comment


            #6
            Hi Jessica. Thanks.
            How can I follow this tracking Id and see the update on this?

            Comment


              #7
              This thread is your best resource. The tracking ID will show up in forums searches if someone else reports the same thing. Should the product management team have more information, I will update this thread with that information. Otherwise, please keep an eye on the NinjaTrader 8 Release Notes page for updates and bugfixes.

              Jessica P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by sidlercom80, 10-28-2023, 08:49 AM
              166 responses
              2,234 views
              0 likes
              Last Post sidlercom80  
              Started by thread, Yesterday, 11:58 PM
              0 responses
              1 view
              0 likes
              Last Post thread
              by thread
               
              Started by jclose, Yesterday, 09:37 PM
              0 responses
              6 views
              0 likes
              Last Post jclose
              by jclose
               
              Started by WeyldFalcon, 08-07-2020, 06:13 AM
              10 responses
              1,414 views
              0 likes
              Last Post Traderontheroad  
              Started by firefoxforum12, Yesterday, 08:53 PM
              0 responses
              11 views
              0 likes
              Last Post firefoxforum12  
              Working...
              X