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 XT Alert Builder 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.
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. 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}}
That's it!... because you're packaging all of the details into the alert_message, all that is required in to send CrossTrade is the message and your secret key for validation. Let's dive deeper and expand on this functionality...
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:
Users can specify a trading session or time window to ensure signals only occur during desired hours. The Trading Hours section allows you to define exactly when your strategy should be active, giving you precise control over your automated trading schedule.
Session-Based Controls: Set specific start and end times for your trading sessions based on Eastern NYC market time. Choose which days of the week you want the signals to be active, ensuring your strategy only trades during your preferred market hours.
Automatic Position Management: 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. This ensures you never hold positions overnight unintentionally and provides a clean slate for each trading session. Additionally, if you delay the closing action until the final bar, you're free to send signals throughout the session without any closing interference from TradingView. TradingView strategies require an offsetting order, so this is a workaround which allows you to create an open playing field and delay the closing action.
Market Hours Alignment: Align your strategy with specific market sessions like the London open, New York session, or overnight futures trading. This is particularly valuable for strategies that depend on specific volatility patterns or market participant behavior during certain time periods.
Weekend and Holiday Protection: The trading hours settings automatically respect market closures and prevent signals from being sent during non-trading periods, adding an extra layer of protection for your automated strategies.
These settings include your NT8 specifics for the account, instrument and quantity for the trade. The NinjaTrader Settings section bridges your TradingView strategy with your actual trading infrastructure, ensuring seamless execution in your live or demo accounts.
Account Configuration: Specify your exact NinjaTrader account name where trades should be executed. The system supports all NinjaTrader account types including simulation, live, and prop firm accounts. You can even configure multi-account placement by separating account names with commas. (e.g. account=sim101,sim102,sim103;)
Instrument Formatting: Your preferred NT8 instrument must be entered in NT compatible format (e.g., ES 09-25). This is optional as we will automatically convert the TradingView continuous contracts (ES1!) to the proper NT8 format.
Position Sizing Control: Define your preferred NT8 quantity for each trade. This is separate from the trade size you can establish on TradingView in the Properties panel. When using ATM templates, its crucial that you provide the same quantity in this field to open the ATM correctly.
The XT Alert Builder Advanced provides comprehensive trade management options. You have three powerful approaches: Souce Inputs from indicators, ATM strategy templates for advanced automation, or individual stop-loss and take-profit levels for precise control. Simply select your Exit Method from the dropdown and the corresponding trade managhement option will be applied.
Source Signals: Similar to the Entry method, you can exit based on any indicator signal. This opens the door to creating truly unique strategies that can enter and exit based on one or more source signals from compatible indicators.
Custom Stop-Loss and Take-Profit Levels: You also have the ability to set individual stop_loss and take_profit levels with either tick or percentage-based values. These levels will be plotted on TradingView and allow for full tick-based backtesting. When the alert fires, your take_profit and stop_loss values will automatically be added to your {{strategy.order.alert_message}}
The system automatically handles directional offset requirements. The stops and target levels DO NOT require price scale offsetting using a negative sign. For example, a Buy signal with Take Profit = 50 and Stop Loss = 20 will automatically place the take profit 50 ticks above entry and stop loss 20 ticks below entry.
ATM Strategy Integration: The option to trigger an ATM strategy template on NinjaTrader is also included, allowing for full automated trading capabilities with trailing stops and auto-breakeven rules. The ATM template name and quantity must match what's saved on Ninja, providing seamless integration with your existing NinjaTrader trade management setups.
Features such as flatten_first, require_market_position, delay_timer, rate_limiting, and max_position command enhancements have also been included. These advanced options provide the sophisticated controls that professional algorithmic traders demand for complex strategies.
Flatten First Protection: The flatten_first option ensures existing positions are closed before new positions are opened, preventing unwanted position accumulation. This is particularly valuable for strategies that might generate conflicting signals or when transitioning between different market bias conditions.
Market Position Requirements: Require_market_position blocks and prevents the signal from going through unless the NT8 market position matches your command requirements (flat, long, or short). This adds a crucial safety layer that ensures orders only execute when account state matches your expectations.
Execution Timing Controls: Delay_timer introduces controlled delays between order executions to stagger entries across multiple accounts or prevent simultaneous order flooding during high-volatility periods. Rate_limiting controls the frequency of order submissions to comply with broker requirements.
Position Limits: Max_position sets limits on the maximum number of open positions across multiple symbols to control risk exposure and prevent overtrading during volatile market conditions. This is essential for maintaining disciplined risk management in automated strategies.
Strategy Synchronization: Advanced options include strategy sync capabilities to eliminate dangerous state drift between TradingView and NinjaTrader, ensuring your strategy's internal position tracking matches your actual broker positions at all times. When using Strategy Sync, its important to note that your TradingView must, at some point, be flat. Stop and Reverse style approaches will not sync properly.
The XT Alert Builder 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, and we offer multiple versions to match different trader needs and complexity requirements.
Free Version: This free version provides basic functionality, including signal source integration, ATM management, and CrossTrade compatibility.
Advanced Version: The Advanced version expands capabilities for professional traders who need more sophisticated strategy logic. This includes complex exit conditions and technical filtering.
Flex Version: The Flex version enables up to 3 stop and target source signals to be used. This version specifically enables automation of indicators that scale out of positions.
Version Comparison Benefits: Each version maintains full CrossTrade compatibility while providing increasing levels of sophistication. All current CrossTrade subscribers get Invite-only access to the Advanced and Flex versions.
Master the XT Alert Builder with our comprehensive video tutorial that walks you through every feature step-by-step. From basic setup and indicator connection to advanced trade management configurations, our tutorials show you exactly how to transform any TradingView indicator into a fully automated CrossTrade strategy. Whether you're connecting your first RSI signal or building complex multi-condition strategies with ATM templates, our visual guides make implementation straightforward and error-free. Watch seasoned traders demonstrate real-world setups, troubleshoot common issues, and share best practices that will have you trading automated strategies in minutes, not hours.
Explore how to set up your first Copier with this comprehensive, step-by-step guide on using this powerful account management tool available with CrossTrade Pro. Whether you're managing your own account or working as an active prop trader, this tool will provide you with a new level of flexibility. In this video, you'll discover how to navigate the CrossTrade Trade Copier interface and create your first copier!