10. All Order Types Reference

Complete reference for all supported order types.

NinjaSync supports 23+ order types covering market entries, bracket orders (OCO), ATM strategies, position management, and cancellation. Every order type is triggered by the alert field in the JSON payload. Append Long or Short for directional orders.

Basic Orders

Market

Places a market order immediately. No bracket.

JSON
{
  "alert": "Market Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1"
}

Market Close

Closes the current position at market price immediately.

JSON
{
  "alert": "Market Close",
  "account": "Sim101",
  "ticker": "NQ MAR26"
}

Close Then Market

Closes any existing position first, then places a new market entry.

JSON
{
  "alert": "Close Then Market Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1"
}

Limit

Places a limit order at the specified price. No bracket.

JSON
{
  "alert": "Limit Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "limit_price": "21420",
  "tif": "GTC"
}

StopMarket

Places a stop-market order that triggers when price hits the stop price. No bracket.

JSON
{
  "alert": "STOPMARKET Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "stop_price": "21460",
  "tif": "GTC"
}

StopLimit

Entry triggers when price hits stop price, then places a limit order at limit price. No bracket.

JSON
{
  "alert": "STOPLIMIT Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "stop_price": "21460",
  "limit_price": "21465",
  "tif": "GTC"
}

OCO Bracket Orders

OCO Market

Market entry with immediate take profit and stop loss brackets.

JSON
{
  "alert": "OCO Market Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "tif": "GTC",
  "take_profit_price": "21500",
  "stop_loss_price": "21400"
}

OCO Limit

Limit entry with deferred brackets — TP/SL are placed only once the entry fills.

JSON
{
  "alert": "OCO Limit Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "tif": "GTC",
  "limit_price": "21420",
  "take_profit_price": "21500",
  "stop_loss_price": "21380"
}

OCO StopLimit Entry

Stop-limit entry with deferred brackets. Triggers at entry_stop_price, fills at limit_price.

JSON
{
  "alert": "OCO STOPLIMIT Entry Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "tif": "GTC",
  "entry_stop_price": "21460",
  "limit_price": "21465",
  "take_profit_price": "21530",
  "stop_loss_price": "21420"
}

OCO StopMarket Entry

Stop-market entry with deferred brackets. Triggers and fills at market when price hits entry_stop_price.

JSON
{
  "alert": "OCO STOPMARKET Entry Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "tif": "GTC",
  "entry_stop_price": "21460",
  "take_profit_price": "21530",
  "stop_loss_price": "21420"
}

OCO MarketLimit Entry

Market entry with limit-based bracket management.

JSON
{
  "alert": "OCO MARKETLIMIT Entry Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "tif": "GTC",
  "entry_stop_price": "21460",
  "take_profit_price": "21530",
  "stop_loss_price": "21420"
}

Close Then Variants

Any entry order can be prefixed with "Close Then" to flatten the current position before opening the new trade.

Close Then OCO Market

Flattens any existing position, then places an OCO Market entry with brackets.

JSON
{
  "alert": "Close Then OCO Market Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "tif": "GTC",
  "take_profit_price": "21500",
  "stop_loss_price": "21400"
}

Adjusted & Cancel OCO

Adjusted OCO

Moves the take profit and stop loss of an open bracket to new prices. Uses oco_id to identify which bracket to modify.

JSON
{
  "alert": "Adjusted OCO",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "oco_id": "my_trade_1",
  "take_profit_price": "21550",
  "stop_loss_price": "21440"
}

Cancel OCO

Cancels the take profit and stop loss bracket for a given oco_id. Does not close the position.

JSON
{
  "alert": "Cancel OCO",
  "account": "Sim101",
  "ticker": "NQ MAR26"
}

Cancel OCO and Flatten

Cancels the bracket and immediately closes the position at market. Safe to call even if the bracket was already hit.

JSON
{
  "alert": "Cancel OCO and Flatten",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "oco_id": "my_trade_1"
}

Cancel Orders

Cancels all open orders on the account. Does not close any open positions.

JSON
{
  "alert": "Cancel Orders",
  "account": "Sim101",
  "ticker": "NQ MAR26"
}

ATM Strategy Orders

ATM Strategy orders trigger NinjaTrader's built-in Advanced Trade Management. The strategy field must exactly match an ATM strategy name saved in NinjaTrader.

ATM Strategy Market

Market entry that activates an ATM Strategy for bracket management.

JSON
{
  "alert": "ATM Strategy Market Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "strategy": "NQ_Bracket",
  "tif": "GTC"
}

ATM Strategy Limit

Limit entry that activates an ATM Strategy on fill.

JSON
{
  "alert": "ATM Strategy Limit Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "limit_price": "21420",
  "strategy": "NQ_Bracket",
  "tif": "GTC"
}

Close Then ATM Strategy Market

Flattens the current position, then places an ATM Strategy market entry.

JSON
{
  "alert": "Close Then ATM Strategy Market Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "strategy": "NQ_Bracket"
}

Close Then ATM Strategy Limit

Flattens the current position, then places an ATM Strategy limit entry.

JSON
{
  "alert": "Close Then ATM Strategy Limit Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "limit_price": "21420",
  "strategy": "NQ_Bracket"
}

Exit StopMarket

Closes the current position at market. Used within ATM strategy workflows.

JSON
{
  "alert": "Exit Stopmarket",
  "account": "Sim101",
  "ticker": "NQ MAR26"
}

Stop ATM Strategy

Stops a running ATM strategy and closes the managed position.

JSON
{
  "alert": "Stop ATM Strategy",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "strategy": "NQ_Bracket",
  "strategy_id": ""
}