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

Automated trade interface

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

    Automated trade interface

    Hello, I'm testing ATI with only partial success. I use the .NET Client class which works OK for sending price updates to Ninja, but I cannot see orders using Orders(account) call where account ="Sim101". Ninja is connected to External Data Feed if it is relevant, MYINSTRUMENT is a manually created stock instrument. See the code below - the charts is drawn, ask/bid are changing, orders are waiting and get filled, but no order ids are sent back although they are created and output in the Log tab. Thank you for any help.

    Code:
    static void Main(string[] args)
            {
                string account = "Sim101";
                IClient client = new Client();
                int price = 50;
                Random random = new Random();
                for (int i = 0; i < 100000; i++)
                {
                    price += random.Next(5) - 2;
                    Console.WriteLine(price);
                    client.Last("MYINSTRUMENT", price, 1);
                    client.Ask("MYINSTRUMENT", price-1, 10);
                    client.Bid("MYINSTRUMENT", price + 1, 10);
                    Thread.Sleep(100);
                    string orderIds = client.Orders(account);
                    // here orderIds is always emtpy although some orders are in working state
                }
             
                Console.ReadKey(true);
            }

    #2
    mantak007, unfortunately this would be an undocumented area we could not provide support on. From the snippet provided would not have a quick why that would be the case, I will leave this open though for community member to comment on as well.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      OK...Would you provide support if I use DLL Interface Functions ? I believe this is documented....
      Last edited by mantak007; 07-02-2014, 05:17 AM.

      Comment


        #4
        Yes, the DLL interface would be supported.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I was not aware of the AT Interface switch in the menu, after switching it on everything started to work.

          One more question regarding the ATI: I'm trying to create a bridge between Ninjatrader and a custom trading platform. Using ATI (or generally External data feed), I'm able to send market data to Ninja, create orders using the Chart trader or Strategies inside Ninjatrader and send these orders' values to the external platform which then sends them to the real exchange. So far so good, this is great, but then I have no idea how to synchronize positions when an order gets filled at the exchange. Are there any means how to tell Ninjatrader real execution price and volume, e.g. in case of part fill? It seems that Ninja fills its internal trades according to ask/bid/last prices send via the External data feed, but it's obvious the real world fills will differ from the internals (due to slippage and part fills) and strategies and traders get confused by invalid order states inside Ninjatrader. Is there some external interface or internal calls on Ninjascript objects to provide this synchronization?
          Last edited by mantak007; 07-03-2014, 01:12 AM.

          Comment


            #6
            mantak007, I'm really not aware of anything supported in that area per se, one would need to keep in mind we're not talking about a full API here, but an interface designed to route external orders for execution to NT.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Of course, I understand. So the only option how to do that is to create an account connector, which I suppose is either undocumented or proprietary and there is currently no way how to route and synchronize external order to Ninjatrader, right? By the way, is there going to be any change in NT8 regarding external connectors or custom account plugins, would there be e.g. an interface to develop own account plugins?

              Comment


                #8
                Your understand is correct mantak007, with NinjaTrader 8 we expect to offer a much deeper NinjaScript programming framework to operate in however custom connectors would still be a non supported item very likely.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  OK, no surprise then :-) Thank you.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by cre8able, 02-11-2023, 05:43 PM
                  3 responses
                  236 views
                  0 likes
                  Last Post rhubear
                  by rhubear
                   
                  Started by frslvr, 04-11-2024, 07:26 AM
                  8 responses
                  113 views
                  1 like
                  Last Post NinjaTrader_BrandonH  
                  Started by stafe, 04-15-2024, 08:34 PM
                  10 responses
                  46 views
                  0 likes
                  Last Post stafe
                  by stafe
                   
                  Started by rocketman7, Today, 09:41 AM
                  3 responses
                  11 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by traderqz, Today, 09:44 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Working...
                  X