• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Interact with Ninjatrader from an external application

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

    Interact with Ninjatrader from an external application

    I would like to know if there is any mechanism to interact with Ninjatrader 8 from an external application.

    I have developed an application outside of Ninjatrader, and I would like to forward order requests to Ninjatrader 8.

    Basically, having Ninjatrader 8 connected to an account, I would like to click a button in my other application and have an order forwarded to be placed within Ninjatrader.

    Does Ninjatrader allow this? Is there an API or something one can use for this?

    Thank you.

    #2
    Hello blunt,

    NinjaTrader does have an API. Support for the API is limited.

    Below is a link to a forum post with information about using the API.
    https://ninjatrader.com/support/foru...626#post793626
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea.

      For what I can understand from the documentation here:

      https://ninjatrader.com/support/help..._interface.htm


      You can place an order using the following method exposed in the DLL:

      int Command(string command, string account, string instrument, string action, int quantity, string orderType, double limitPrice, double stopPrice,
      string timeInForce, string oco, string orderId, string strategy, string strategyId)
      Function for submitting, cancelling and changing orders, positions and strategies. Refer to the Commands and Valid Parameters section for detailed information. A return value of 0 indicates success and -1 indicates an error. The Log tab will list context sensitive error information.

      Am I understanding the documentation correctly?


      What about order placement confirmation and / or fill information?

      Do I need to poll this for getting updated order information until the order gets placed and same thing for filled?


      string OrderStatus(string orderId)
      Gets the order state (see definitions) for the orderId. Returns an empty string if the order ID value provided does not return an order.

      Comment


        #4
        Hello blunt,

        Yes, the Command method allows orders to be submitted, cancelled, or changed.

        Also, all methods you must call for calling information. There are no events from the API that you can add handlers to.
        The Orders() method is used to get a list of IDs. The OrderStatus() method is used to get the status of an order with a specified ID.

        Below is a link to the available methods.
        https://ninjatrader.com/support/help.../functions.htm
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ketotop7, Today, 03:58 AM
        0 responses
        4 views
        0 likes
        Last Post ketotop7  
        Started by Radiant0, Today, 03:55 AM
        0 responses
        3 views
        0 likes
        Last Post Radiant0  
        Started by pstrusi, Today, 02:21 AM
        0 responses
        4 views
        0 likes
        Last Post pstrusi
        by pstrusi
         
        Started by indy73, Yesterday, 10:52 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_EricB  
        Started by priceisking, 05-13-2019, 08:30 AM
        6 responses
        39 views
        0 likes
        Last Post Harry
        by Harry
         
        Working...
        X