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
    • Intro to NT8
    • 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
  • Limitations of TradingView Strategy alerts
  • How Does the XT Alert Builder Strategy Work?
  • Alert Creation Instructions
  • Putting It All Together
  1. Getting Started
  2. TradingView Alerts

XT Alert Builder

Learn how to build CrossTrade compatible alerts from any indicator

PreviousDynamic VariablesNextExample Indicators

Last updated 4 months ago

When working with TradingView’s native strategies, users often encounter a major limitation: the inability to differentiate multiple alert types as easily as they can with indicators. Unlike indicators, strategies don’t naturally support multiple distinct alerts, making it difficult to send different alert messages for separate trade events (e.g., one for a buy, another for a sell, and yet another for flat or close conditions).

The strategy was developed to solve this limitation.

This enhanced tool allows traders to better manage their alerts and seamlessly connect with NinjaTrader by generating CrossTrade compatible alerts using the {{strategy.order.alert_message}} variable.

Limitations of TradingView Strategy alerts

A standard TradingView strategy can:

  • Place trades (entries, exits, etc.)

  • Backtest performance on historical data

  • Send a single alert, which must capture all conditions

What it cannot easily do, by default, is:

  • Generate multiple, individually selectable alerts (as alertcondition() does in indicators)

  • Clearly distinguish between different signal types (buy, sell, close) within the default alert framework

  • Create a variety of unique alerts without resorting to intricate message formatting or using an external indicator script

With the XT Alert Builder Strategy, these shortcomings are addressed by allowing users the ability to source signals from other indicators and package CrossTrade compatible alerts into the strategy's order variable. Let's dive deeper and expand on this functionality...

How Does the XT Alert Builder Strategy Work?

At its core, the XT Alert Builder Strategy is an attempt to combine the best of both worlds with the flexibility of indicator alerts and the convenience of the strategy.order.alert_message variable. This is done by providing inputs sources for Buy Signals and Sell Signals, as well as the accompanying exit signals for both. This structure allows full ultimate customization of both entries and exits with added checkboxes to make the strategy unidirectional if you need. The first step is to simply add your indicators to the Superchart, and the Alert Builder will reference them inside of the source input:

Custom Command Building for Alerts:

When a buy or sell signal triggers, the strategy constructs a detailed XT Compatible command string encoded in the alert_message. This message includes instructions like command=PLACE; account=...;instrument=...;action=BUY; or action=SELL;, along with optional fields for ATM strategies, stop losses, take profits, and additional parameters. The inputs panel includes all of the necessary components for full CrossTrade compatibility:

Trading Hours

Users can specify a trading session or time window to ensure signals only occur during desired hours. If you select the Session End option for the Exit Signal Type input, the strategy will send the Close Position command at the ending time you define in the Trading Hours.

NinjaTrader Settings:

These settings include your NT8 specifics for the account, instrument and quantity for the trade.

Trade Management

💡The quantity and ATM strategy name must be an exact match.

Stop Loss and Take Profit levels

💡Select only one management option: ATM template or take_profit and stop_loss levels.

CrossTrade Advanced Options

Alert Creation Instructions

In the Alert Message window, you will simply add your CrossTrade secret key and the dynamic strategy variable {{strategy.order.alert_message}} For example: Key=your-secret-key; {{strategy.order.alert_message}}

Putting It All Together

  • Define clear, condition-based entries and exits.

  • Maintain compatibility with advanced order management features (such as ATM strategies on NinjaTrader).

The option to trigger an on NinjaTrader is also included, allowing for full automated trading capabilities with trailing stops and auto-breakeven rules.

In addition to the ability to include and utilize an ATM template, you also have the ability to set individual with either tick or percentage-based values.

Include various like flatten_first, require_market_position, delay_timer, rate_limit, and max_position for unqiue trading scenarios,

Example TradingView Alert

The strategy represents a significant leap forward for traders who want to do more with their TradingView strategies. By referencing external indicators it overcomes the default limitations imposed by Pine Script’s strategy alerts. Users can now:

ATM strategy template
stop_loss and take_profit levels
Advanced Options
XT Alert Builder
XT Alert Builder
example-tradingview-webhook-alert