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
  • How to define % or tick price levels
  • Price Formatting
  • How it works
  • Example Payloads
  1. Webhooks
  2. Advanced Options

Percentage and Tick Prices

NinjaTrader commands only accept floating-point price levels. But as traders, it's often easier to define our trade logic in percentages or ticks as relative values to the underlying price.

There are 6 fields where a price can be explicitly set in a CrossTrade alert message:

TAKE_PROFIT, LIMIT_PRICE, STOP_PRICE, STOP_LOSS, STOP_LOSS_LIMIT, STOP_LOSS_STOP

We've added functionality to define any of the above variables in terms of % or "ticks" from the underlying price.

It is very important to note that these % and tick are translation to a price level and not, for instance, have anything to do with the value of position.

How to define % or tick price levels

Typically, a price level is defined as a floating-point number, e.g., 5349.25. You can also define a price level relative to the underlying price, like so:

take_profit=5%;
stop_loss=-25 ticks;
limit_price=-2.5%;
stop_price=12 ticks;

Any of the price fields can be defined as a positive or negative percentage or number of ticks. Positive numbers will result in a value above the spot price; negative numbers will result in a value below the spot price.

Price Formatting

A negative sign is required to offset the stop or target level on the price scale. Buy Example: stop_loss=-100ticks; or stop_loss=-3%;

Percentages

Any of the following representations of % are valid:

5%;
5 %;
5.2%;
5.5236 %;
-3%;
-3 %;
-3.2%;
-3.3129%;

Ticks

Any of the following representations of tick(s) are valid:

1 tick;
1 ticks;
1tick;
1ticks;
12tick;
12 ticks;
7.5 ticks;

How it works

Orders submitted to NT8 have to be in price of the underlying, which means ticks or % away from the underlying have to be translated into price. If a price field is presented as a % or tick value, then:

  1. CrossTrade will use the data feed connection from your NT8 to quote the instrument.

  2. The last price and/or tick size of the instrument will be used to define the price level that represents that value.

  3. The price field is swapped with the real value. CrossTrade will calculate the actual price level, rounded to nearest tick.

  4. CrossTrade sends the final order to NinjaTrader and lets NT8 round the price to the nearest value or tick, if necessary.

Prices are interpreted relative to the last price of the most recent quote. +10% is ten percent above the underlying price, -10 ticks is ten ticks below the underlying price.

The underlying price is quoted from your own NT8 feed. If, for whatever reason, the instrument fails to be quoted or the last quote time is greater than several seconds, the alert will error out.

Misspellings may not be caught by CrossTrade filters. If this happens, the value will be passed through unaffected. NT8 does not throw an error for non-numeric prices, e.g., -10 tic, and may result in unexpected behavior.

Example Payloads

The following command will set an OCO bracket order to take profit at 2.5% above the underlying price and stop loss at -5% below the underlying price:

key=your-secret-key; command=PLACE; account=sim101; instrument=ES 06-25; action=BUY; qty=1; order_type=MARKET; TIF=DAY; take_profit=2.5%; stop_loss=-5%;

Similarly, we can set a buy limit order at 10 ticks below the current price:

key=your-secret-key; command=PLACE; account=sim101; instrument=ES 06-25; action=BUY; qty=1; order_type=LIMIT; TIF=DAY; limit_price=-15 ticks;

PreviousBracket OrdersNextLimit Order Timeouts

Last updated 1 month ago