Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to place Bid and Ask Order NT8 API DLL

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

    How to place Bid and Ask Order NT8 API DLL

    Hi,

    I trying to place a bid and ask orders with the API DLL and NT8 using VS.

    I don't really understand what this suppose to do:

    int Ask(string instrument, double price, int size)
    Sets the ask price and size for the specified instrument. A return value of 0 indicates success and -1 indicates an error.
    and

    int Bid(string instrument, double price, int size)
    Sets the bid price and size for the specified instrument. A return value of 0 indicates success and -1 indicates an error.

    What price I'm suppose to write?

    Code:
                            
    int Ask = myClient.Ask(contract, 0, qty);
    Console.WriteLine($"Ask: {Ask}");​

    Help me understand.
    Thank you

    #2
    Hello smartromain,

    Use the Command() method to submit an order. For the ACTION parameter supply the string "BUY" for a buy order and "SELL" for a sell order.

    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)​


    Help guide: Operations > Automated Trading > Automated Trading Interface (ATI) > DLL Interface > Functions​
    Help guide: Operations > Automated Trading > Automated Trading Interface (ATI) > Commands and Valid Parameters​ > Understanding parameters and valid values


    The Ask() method is used when sending data from your application to the External Data Feed connection in NinjaTrader.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello smartromain,

      Use the Command() method to submit an order. For the ACTION parameter supply the string "BUY" for a buy order and "SELL" for a sell order.

      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)​


      Help guide: Operations > Automated Trading > Automated Trading Interface (ATI) > DLL Interface > Functions​
      Help guide: Operations > Automated Trading > Automated Trading Interface (ATI) > Commands and Valid Parameters​ > Understanding parameters and valid values


      The Ask() method is used when sending data from your application to the External Data Feed connection in NinjaTrader.
      I know how to place Market order, we set the price to 0 in double limitPrice, double stopPrice.

      But how to place bid and ask order, in NT8 in panel Basic Entry there is Buy Ask, Sell Ask, Buy Bid, Sell Bid, no need to enter price.

      I'm trying do to that with this Place order command 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)​

      Comment


        #4
        Hello smartromain,

        Unfortunately, these actions in the Basic Entry are not directly available to the API or NinjaScript. Clicking the Buy Ask button in the Basic Entry actually causes NinjaTrader to just submit a regular limit order and supply the current ask as the limit price.

        Your application would have to do the same. Fetch the current ask, supply this to the Command() method as the limitPrice.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        563 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        329 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X