CrossTrade Docs
Basic CommandsAdvanced Commands
  • Welcome!
    • Set Up Guide
  • Getting Started
    • Installation
    • User Dashboard
      • XT Control Panel
      • Manual Trader
      • Command Builder
    • Alert History
    • TradingView Alerts
      • Dynamic Variables
      • XT Alert Builder
      • Example Indicators
      • Example Strategies
    • VPS Connection Guide
  • Webhooks
    • Overview
    • Commands
      • Place Order
      • Flat Place Order
      • Close Position
      • Reverse
      • Reverse Position
      • Flatten Positions
      • Flatten Everything
      • Cancel Order
      • Cancel Orders
      • Cancel All Orders
      • Cancel Replace
      • Change Order
      • Close Strategy
    • Advanced Options
      • Multi-Account Placement
      • Flatten First
      • Require Market Position
      • Max Positions
      • Bracket Orders
      • Percentage and Tick Prices
      • Limit Order Timeouts
      • Trading Window
      • Bypass Trade Windows
      • Delay Timer
      • Rate-Limiting
      • Alert Commenting
      • Kill Switch
      • Notes
    • Examples & Use Cases
    • Troubleshooting
  • Account Manager
    • Overview
      • How It Works
      • Dashboard
      • Global Settings
      • Frequently Asked Questions (FAQ)
    • Monitors
      • Profit/Loss Thresholds
      • Minimum Profit Drawdown
      • Trailing Drawdown
      • Advanced Usage
    • Account Settings
      • Auto-Flattening
      • Trading Windows
    • Management Logs
  • NinjaTrader
    • ATM Strategies
      • Creating ATM Template
    • Optimizing NinjaTrader Performance
    • Enabling Multi-Provider Mode
  • CrossTrade API
    • Overview
    • Authentication
    • Rate Limiting
    • Webhook Trading
    • Accounts
      • GET Accounts Summary
      • GET Accounts
      • GET Account
    • Positions
      • GET Positions
      • GET Position
      • POST Close Position
      • POST Reverse
      • POST Reverse Position
      • POST Flatten Positions
      • POST Flatten Everything
    • Orders
      • GET Orders
      • GET Order
      • GET Order Status
      • POST Cancel Order
      • POST Cancel Orders
      • POST Cancel All Orders
      • POST Place Order
      • POST Flat Place Order
      • POST Replace Order
      • PUT Change Order
    • Strategies
      • GET Strategies
      • GET Strategy
      • POST Close Strategy
    • Executions
      • GET Executions
      • GET Execution
    • Quotes
      • GET Quote
  • Changelog
    • XT Versions
    • All Updates
  • Affiliate Program
    • Media Kit
  • Social Links
    • Discord
    • TradingView
    • YouTube
    • X (Twitter)
    • Instagram
    • Facebook
    • Reddit
    • Website
    • Blog
Powered by GitBook
On this page
  1. CrossTrade API
  2. Positions

POST Reverse Position

Reverses the position specified by instrument in the account.

Combined Close Position and Place Order

POST /v1/api/accounts/{account}/positions/reverseposition

Effectively closes the position and then executes a Place Order instruction if and only if a position already exists. A position must be already open in the specific instrument for this command to work, otherwise an error will be returned and execution will cease. It is otherwise identical to calling Close Position and the Place Order. Returns the Order ID of the newly opened position.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Query Parameters

Name
Type
Required
Description

account

string

Required

Name of account in NT8

Body

Name
Type
Required
Description

instrument

string

Required

Name of underlying instrument (e.g., "ES 12-24")

action

string

Required

BUY, SELL

quantity

integer

Required

Contract quantity of new order

orderType

string

Required

MARKET, LIMIT, STOPMARKET, STOPLIMIT

timeInForce

string

Required

DAY, GTC

limitPrice

float

Optional

Limit price when submitting limit order type

stopPrice

float

Optional

Stop price when submitting stop order type

ocoId

string

Optional

Create or append to OCO order by ID

strategy

string

Optional

ATM strategy name if opening with ATM template

Code Examples (coming soon)

// Some code
const message = "hello world";
console.log(message);
message = "hello world"
print(message)

Response

{
    "orderId": "cb1fc8d4e1a84d29ae38fea964aaac8c",
    "success": true
}
{
    "error": "No position found for instrument 'ES 12-24' in account 'sim101'"
}
PreviousPOST ReverseNextPOST Flatten Positions

Last updated 4 months ago