Skip to navigation

Place Order

View as Markdown

Make a request to place an order.

Depending on the order type, the parameters vary. In the Trader application, you can see the details of placing a standard order ticket by adding the Order Ticket module to your workspace.

Whether you send customTag50 depends on how your organization is configured. See Operator ID (customTag50) and Passthrough.

Market Order

const URL = 'https://live.tradovateapi.com/v1'
const body = {
accountSpec: yourUserName,
accountId: yourAcctId,
action: "Buy",
symbol: "MYMM1",
orderQty: 1,
orderType: "Market",
isAutomated: true //must be true if this isn't an order made directly by a human
}
const response = await fetch(URL + '/order/placeorder', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${myAccessToken}`,
},
body: JSON.stringify(body)
})
const json = await response.json() // { orderId: 0000000 }

Sell Limit

const URL = 'https://live.tradovateapi.com/v1'
const body = {
accountSpec: yourUserName,
accountId: yourAcctId,
action: "Sell",
symbol: "MYMM1",
orderQty: 1,
orderType: "Limit",
price: 35000, //use for single value like limit or stop
isAutomated: true //must be true if this isn't an order made directly by a human
}
const response = await fetch(URL + '/order/placeorder', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${myAccessToken}`,
},
body: JSON.stringify(body)
})
const json = await response.json() // { orderId: 0000000 }

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
actionenumRequired
Buy, Sell
Allowed values:
symbolstringRequired<=64 characters
orderQtyintegerRequired
orderTypeenumRequired
Limit, LimitIfTouched, MIT, Market, MarketLimit, MarketStopWithProtection, MarketWithProtection, QTS, Stop, StopLimit, TrailingStop, TrailingStopLimit
accountSpecstringOptional<=64 characters
accountIdlongOptional
clOrdIdstringOptional<=64 characters
pricedoubleOptional
stopPricedoubleOptional
limitIfTouchedPricedoubleOptional
maxShowintegerOptional
pegDifferencedoubleOptional
timeInForceenumOptional
Day, FOK, GTC, GTD, IOC
Allowed values:
expireTimedatetimeOptional
textstringOptional<=64 characters
activationTimedatetimeOptional
customTag50stringOptional<=64 characters

Operator ID for the order. Send it only if NinjaTrader configured an allow-list of operator IDs for your user. In that case it’s required on every order and must exactly match one approved value. If no allow-list is configured, omit it: a supplied value is denied. Organizations using passthrough also omit it, and NinjaTrader fills it in. Up to 64 characters. See Operator ID (customTag50) and Passthrough.

isAutomatedbooleanOptional

Response

PlaceOrderResult
failureReasonenumOptional
AccountClosed, AdvancedTrailingStopUnsupported, AnotherCommandPending, BackMonthProhibited, ExecutionProviderNotConfigured, ExecutionProviderUnavailable, HomeStateRestricted, InvalidContract, InvalidPrice, KeyInformationDocumentRequired, LiquidationOnly, LiquidationOnlyBeforeExpiration, MaxOrderQtyIsNotSpecified, MaxOrderQtyLimitReached, MaxPosLimitMisconfigured, MaxPosLimitReached, MaxTotalPosLimitReached, MinTradeDurationNotElapsed, MultipleAccountPlanRequired, NoQuote, NotEnoughLiquidity, OtherExecutionRelated, ParentRejected, RiskCheckTimeout, SSFNFAComplianceRequired, SSFNFAComplianceRequiredJointOnly, SSFRiskDisclosureAcknowledgmentRequired, SessionClosed, Success, TooLate, TradingLocked, TrailingStopNonOrderQtyModify, Unauthorized, UnknownReason, Unsupported
failureTextstringOptional<=8192 characters
orderIdlongOptional