Introducing the CrossTrade API, a remotely accessible REST API for NinjaTrader

CrossTrade now offers a first-of-its-kind REST API for NinjaTrader 8. Connect the CrossTrade NT8 Add-On and interact with your desktop NinjaTrader from anywhere.

Depiction of the CrossTrade to NT8 API connection path
Introducing the CrossTrade API

CrossTraders, we want to share an exciting update. CrossTrade (part of the NinjaTrader ecosystem) just released the brand new CrossTrade NT8 Add-On, and with it comes a fully-functional REST API for NinjaTrader.

We're not native C#/.NET programmers and it's not our first choice of language, so coding in NinjaScript is honestly a pain.

If you're algotraders like us, you most likely have data sources you're analyzing outside of NinjaTrader as well. We wanted a way to execute through NT8 while being able to send orders from any code or 3rd-party service, anywhere in the world, directly to our NT8 desktop application. Now you can code autotrading bots in Python, Javascript, Java, Go, or even assembly!

Getting Started

Installation is as simple as installing any other NT8 Add-On. As long as the Add-On is connected, you're live.

The CrossTrade client must be connected for the API to be functional.

Interacting with the API

The REST API is the same underlying functionality CrossTrade uses to execute orders from inbound webhook requests from TradingView. It's battle-tested and used to execute hundreds of thousands of orders in NT8 every day.

Anyone with a CrossTrade account can use the API to access information about your NT8 accounts, positions, orders, strategies, executions, and even instrument quotes.

Each CrossTrade account is given a Secret Key, which can be used to both authenticate inbound alert messages from TradingView, for instance, or as a Bearer token to interact with the API.

This is how easy it is to send your first API request to quote the ES 12-24 contract in Python:

url = "https://app.crosstrade.io/v1/api/accounts/sim101/quote"
headers = {
  "Authorization": "Bearer <token>",
}
params = {
  "instrument": "ES 12-24"
}
try:
  response = requests.get(url, headers=headers, params=params)
  print(f"Response Code: {response.status_code}, Response Text: {response.text}")
except Exception as e:
  print(f"An error occurred: {e}")

Quoting ES 12-24 in Python using the CrossTrade API

Learn how to authenticate and interact with the API here: https://docs.crosstrade.io/api/overview

Summer 2024 Updates Recap

For non-developers, we also released a bunch of enhancements to the webhook functionality, including the ability to require market position before execution, setting a max number of positions allowed at one time, and the option to set trading windows per-alert message.

If you're new to CrossTrade and looking to get started, learn how to send webhook commands from TradingView.

If you have any questions at all, please reach out and let us know.

Thanks for reading!
~CrossTrade Team


Start your free trial

Try CrossTrade for 7 days.

Sign Up