Webhook Trader

How to use the Webhook Trader a.k.a. Command Tester

What is the CrossTrade Webhook Trader?

The Webhook Trader is a dedicated space where users can create and test how their trade commandsarrow-up-right interact with NinjaTrader. It allows you to check if your orders are flowing from CrossTrade to NinjaTrader as expected. Essentially, the Trader serves as a quality check to ensure your integration works exactly as it should, saving you from unwanted surprises when it’s time to go live.

circle-info

πŸ’‘ The Webhook Trader's purpose is strictly for sending predefined commands between CrossTrade and NinjaTrader. Dynamic Variables from a TradingView strategy will not work.

Webhook Trader & Command Library

The Webhooks page is where you manage, test, and build your trading commands. It contains three main components: the Webhook Trader (for sending commands directly to NinjaTrader), the Command Library (pre-built and saved commands), and the Command Examples (ready-to-use reference payloads). Together, these tools give you a complete workflow for building, testing, and deploying webhook alert messages without ever needing to leave the dashboard.

You'll find these on the Webhooks tab of your dashboard.

Webhook Trader

The Webhook Trader sends alert payloads directly to NinjaTrader β€” the same way an external platform like TradingView would. Think of it as a built-in way to fire commands at your NT8 instance without setting up an alert first. This is useful for testing new commands, verifying your setup is working, or manually executing trades when you need to act quickly.

When you submit a command through the Trader, it travels through the same CrossTrade infrastructure that processes external webhooks. Your secret key is automatically included, so the payload follows the identical path β€” CrossTrade server to XT Add-On to NinjaTrader. If it works here, it will work from TradingView.

What the Trader Supports

The Trader accepts static commands only. You type or paste a command payload into the input area and send it. It supports every command CrossTrade accepts: Place, Close Position, Flatten Everything, Flatten, Reverse, Reverse Position, Flat Place, Cancel, Cancel Orders, Cancel All Orders, Cancel Replace, Change, Close Strategy, and Cancel & Bracket.

All advanced options work as well β€” Flatten First, Require Market Position, Max Positions, Trading Windows, Rate Limiting, Delay Timer, Cancel After Timeout, Brackets, ATM Strategies, Strategy Tags, and Notes.

What the Trader Does Not Support

TradingView dynamic variables like {{strategy.order.action}}, {{strategy.order.contracts}}, {{ticker}}, and similar placeholders will not resolve in the Trader. These variables are populated by TradingView at the moment an alert fires β€” they have no meaning outside of that context. If you send a command containing {{strategy.order.action}}, CrossTrade will receive the literal text {{strategy.order.action}} and reject it because it's not a valid action value.

To test strategy-based commands that use dynamic variables, you need to fire them from an actual TradingView alert. The Trader is for testing with concrete values only β€” use action=buy instead of action={{strategy.order.action}}.

How to Use It

Type or paste your command into the Trader's text area, or load a command from the Command Library or Command Examples (covered below). Review the payload, then click Send to NT8. The command is dispatched through CrossTrade and the result appears in your Alert History, just like any external webhook would.

If the command is valid and your XT Add-On is connected, you'll see the order execute in NinjaTrader. If something is wrong β€” bad syntax, missing fields, disconnected Add-On β€” the Alert History will show the error details and reason for failure. This makes the Trader an essential debugging tool: if a command works here but fails from TradingView, the problem is on the TradingView side (usually unresolved variables or bad alert configuration). If it fails here too, the command itself needs fixing.

Command Library

The Command Library is a collection of pre-built command examples organized into Basic and Advanced tabs. Each entry is a ready-to-use command template covering the most common trading scenarios.

Basic Commands

These cover the fundamental operations: market buy, market sell, limit orders, close position, and flatten everything. Each one is a complete, working command with placeholder values you can edit for your own account, instrument, and quantity.

Advanced Commands

These demonstrate CrossTrade-specific features that go beyond standard NinjaTrader commands. You'll find examples for Flatten First, ATM Strategy placement, TP/SL Brackets (numerical, tick-based, percentage, and dollar-based), Strategy Sync, Require Market Position, Max Positions, Rate Limiting, Trading Windows, Cancel After Timeout, Delay Timer, and more.

What You Can Do With Library Commands

Each command in the library has action buttons that let you interact with it directly:

Test β€” Loads the command into the Webhook Trader and sends it to NinjaTrader. This is the fastest way to verify that a command type works with your setup. The Trader populates with the command payload so you can review it before or after sending.

Copy β€” Copies the command text to your clipboard, ready to paste into a TradingView alert message body or use with an external webhook. Before pasting, make sure to replace any placeholder values (like sim101 or ES1!) with your actual account and instrument names.

These two actions make the library a practical tool, not just a reference. You can test a command against NinjaTrader to see what happens, then copy the working version into your TradingView alert.

Saved Commands

In addition to the pre-built examples, the library stores commands you've saved from the Automation Wizard. When you build a command in the Wizard and click "Save to Library," it appears here with the custom name you gave it. You can save up to 25 custom commands.

Saved commands work exactly like the pre-built ones β€” you can test them in the Trader or copy them for use in external alerts. This creates a workflow where the Automation Wizard handles the building, the Library handles the storage, and the Trader handles the testing.

Command Examples

Below the Trader on the Webhooks page, you'll find a set of command examples organized by category. These are reference payloads that demonstrate the correct syntax for every supported command and enhancement.

The examples serve three purposes. First, they're documentation β€” each one shows the exact field names, formatting, and structure that CrossTrade expects. Second, they're functional β€” you can copy any example directly into the Webhook Trader to test it, or copy it to your clipboard for use in a TradingView alert or external webhook. Third, they're a starting point β€” take an example that's close to what you need, paste it into the Trader, modify the values, and test until you get the behavior you want.

If you're building a command from scratch and aren't sure about the syntax, the examples are the fastest way to get a working template. They cover everything from simple market orders to complex scenarios with multiple enhancements stacked together.

Putting It All Together

The typical workflow looks like this: browse the Command Examples or Library to find a command close to what you need. Load it into the Webhook Trader. Modify the account, instrument, quantity, and any other parameters. Send it to NinjaTrader and confirm the order appears correctly. Once it works, copy the command and paste it into your TradingView alert message body.

For more complex setups β€” strategy automations, multi-enhancement commands, or anything where you want a guided step-by-step experience β€” use the Automation Wizardarrow-up-right. The Wizard builds the command visually and lets you save the result directly to your Command Library, where it's available for testing in the Trader and copying to external alerts.

Tips

Always test with a sim account before going live. Even if the command syntax is correct, you want to confirm that the order type, quantity, and instrument behave as expected in NinjaTrader before routing real money through it.

If a command works in the Webhook Trader but fails from TradingView, check that your TradingView alert message contains only the CrossTrade payload β€” no default text, no extra characters, no TradingView boilerplate. The alert message body should contain nothing but your command.

When testing commands that use an ATM strategy, the ATM template name in your command must exactly match the name configured in NinjaTrader. This is case-sensitive and space-sensitive. If NinjaTrader shows "My Strategy" and you send atm_strategy=my strategy, it won't match.

Last updated