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

Calling Account.Flatten doesn't specify the OrderEntry type

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

    Calling Account.Flatten doesn't specify the OrderEntry type

    In testing the API's for the Account class that create and modify orders, it was discovered that the Account.Flatten function doesn't allow the OrderEntry type to be specified for the orders used to close the position. The orders were flagged with the OrderEntry.Manual type. This seems like a potential problem with the Flatten function since an automated system may be the one calling this function and it would create orders with the wrong parameter.

    #2
    Hello ntbone,

    The account.Flatten() only takes a list of Instruments which should be flattened, the remainder of the flatten process would be handled internally and the appropriate order types would be used for the method that was called.

    Are you seeing a specific error surrounding a broker being used or situation? If so we could look into that in more detail.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      If the account.Flatten as part of a automated trading process, the orders to close are marked as OrderEntry.Manual but since the orders would be part of an automated process I believe they need to be flagged as OrderEntry.Automated per the documentation for CME Tag 1028 referenced in the documentation.

      Comment


        #4
        Hello ntbone,

        Thank you for the reply.

        If you are seeing a problem with an order being submitted to a broker in this situation, we can certainly collect the details surrounding that use case and provide that to development for further review. Is there a specific case where you are seeing a rejection or other error based on the result of flatten or is this just an observation at this point?

        Please let me know if I may be of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          This is an observation at this point. I haven't had a chance to try it with a real broker and only with paper trading account. It is a concern for submitting invalid orders. The broker would not necessarily know the difference between an automated trade system submitting the order vs the manual method so they wouldn't know to reject the order. The concern is with using the Flatten function as part of an automated trading system and having the broker/exchange discover that orders were being submitted by such a system incorrectly with this flag set to manual.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Segwin, 05-07-2018, 02:15 PM
          10 responses
          1,767 views
          0 likes
          Last Post Leafcutter  
          Started by Rapine Heihei, 04-23-2024, 07:51 PM
          2 responses
          30 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by Shansen, 08-30-2019, 10:18 PM
          24 responses
          943 views
          0 likes
          Last Post spwizard  
          Started by Max238, Today, 01:28 AM
          0 responses
          9 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by rocketman7, Today, 01:00 AM
          0 responses
          7 views
          0 likes
          Last Post rocketman7  
          Working...
          X