Skip to main content

Flat Place Order

FLATPLACE and PLACE with flatten_first=true share the normal intent: clear the same account and instrument before a new entry. They are not identical under every gate or legacy execution path, so use the form whose behavior below matches your workflow.

A benefit of PLACE with flatten_first is its Trading Window behavior. During closing_only_after, CrossTrade can keep the flatten leg and suppress the new entry. FLATPLACE is classified as an opening command, so the whole command is blocked in closing-only mode. Both forms are blocked outside the normal start/end window.

Cleanup and settlement

On current NinjaTrader Add-On and Tradovate paths, FLATPLACE scopes cleanup to the same account and exact instrument: it flattens any position, cancels nonterminal working orders, and waits for both to clear before entry. If settlement cannot be confirmed within the bounded wait, the command returns an error and does not place the entry. Legacy NinjaTrader ATI/ATM routing performs the same intent as staged flatten and cancel operations rather than the Add-On's direct helper.

An account holding three long contracts with a bracket working, and the same account short two contracts afterwards with the old orders gone. Flatplace closes whatever is there, confirms it is clear, and only then places the new order. It is the command for

Flatten, confirm the account is clear, then enter. One instruction.

Example Payloads​

This example message will trigger a simple market order for BUY or SELL actions that will remain in-force for the rest of the trading day.

Buy or Sell (Market Orders)​

Using FLATPLACE Order Command​

key=your-secret-key;
command=flatplace;
account=sim101;
instrument=ES1!;
action=buy;
qty=1;
order_type=market;
tif=day;

Using PLACE Order Command​

key=your-secret-key;
command=place;
account=sim101;
instrument=ES1!;
action=buy;
qty=1;
order_type=market;
tif=day;
flatten_first=true;

We will cease the examples here since all PLACE payloads will be identical to FLATPLACE payloads aside from the command name.

See the Place Order command and Examples pages for more use cases.

On Tradovate

flatplace (and flatten_first=true; on place) works with destination=tradovate;. CrossTrade resolves the exact contract, liquidates the same-account position, and polls both live net position and nonterminal same-contract orders. A "no position" response is tolerated, but orphan working orders still must clear. The entry is placed only after settlement succeeds, and each mapped copier follower runs its own flatten-and-settle barrier before its entry.