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

Access to orders/positions placed from SuperDOM

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

    Access to orders/positions placed from SuperDOM

    I have a strategy that I wrote custom that wants to close a position on an order placed from the Superdom.

    If I iterate orders/positions looking for that instrument there are none.

    The log shows the order was placed through ATI.

    How do I access these?

    Thanks in advance.

    #2
    Hello maryfromcolorado,

    Thank you for your post.

    You mention a few items here so let me make sure I have all the details on what you are attempting.
    • The order is placed by you through the SuperDOM?
    • You then have a strategy that you wish to have close the position that the manually placed order opened?
    • How are you iterating through the orders and positions?
    • Do you run any items that use the ATI? Can you provide the line from the log that determines this?

    Generally it is not recommended to use an automated strategy to control positions manually opened.

    Comment


      #3
      Yes the order is placed through the Superdom.

      Yes, I may need to adjust stops and or close.

      foreach (IOrder ord in Orders)
      {
      DoSomething();
      }
      foreach (Position p in Cbi.Accounts.Positions)
      {
      DoSomething()!
      }

      I know I would have to watch that it wasn't close to a limit and or double check for overfills. I understand that.

      The log just said something like order placed though the ATI. It's on someone elses machine so I don t have the exact line. Is he running something else which is using the AT interface or could the Superdom do that ?

      Thanks in advance.
      Last edited by maryfromcolorado; 11-08-2016, 11:53 AM.

      Comment


        #4
        Hello maryfromcolorado,

        Thank you for your response.

        Generally the ATI orders are from the Automated Trading Interface. I would check to see if they have any other third party software or systems that could cause this.

        Comment


          #5
          Access order placed in SuperDom through NinjaScript

          Ok Patrick. I was able to try this locally with a simulated data feed connection. I put in an order in the SuperDOM and had one ATM Strategy for Stop Loss and Take Profit, I can see it in the log, saying the order was opened on strategy id xyz123. It was for ES 06-13 Qty 1.

          when I iterate orders nothing comes back.

          OnBarUpdate()
          foreach (IOrder o in Orders) // there are none
          Print("Order Found");

          foreach (Position p in Positions)
          Print("Position Found"): // I see the position 1L

          How can I access these orders ?

          Thanks,
          Mary

          Comment


            #6
            Hello maryfromcolorado,

            This would be unsupported. A short example would be the following:
            Code:
            			foreach (Account acct in Cbi.Globals.Accounts)
            			{
            				if (acct.Positions != null)
            				{
            					PositionCollection positions = acct.Positions;
            					foreach (Position pos in positions)
            					{
            						Print(pos.Account.Name + " " + pos.Instrument + " " + pos.MarketPosition + " " + pos.Quantity + " " + pos.AvgPrice);
            					}
            				}
            				if (acct.Orders != null)
            				{
            					OrderCollection orders = acct.Orders;
            					foreach (Order ord in orders)
            					{
            						Print(ord.OrderState.ToString());
            					}
            				}
            			}

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jxs_xrj, 01-12-2020, 09:49 AM
            4 responses
            3,281 views
            1 like
            Last Post jgualdronc  
            Started by Option Whisperer, Today, 09:55 AM
            0 responses
            5 views
            0 likes
            Last Post Option Whisperer  
            Started by geddyisodin, 04-25-2024, 05:20 AM
            8 responses
            58 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by halgo_boulder, 04-20-2024, 08:44 AM
            2 responses
            22 views
            0 likes
            Last Post halgo_boulder  
            Started by mishhh, 05-25-2010, 08:54 AM
            19 responses
            6,189 views
            0 likes
            Last Post rene69851  
            Working...
            X