TradingView Strategy Builder
Create custom trading strategies with our TradingView Pine Script strategy builder
The TradeSgnl Strategy Builder is a customizable TradingView Pine Script that lets you create, test, and automate trading strategies directly in TradingView. It generates alerts that can be sent to your TradeSgnl EA for automated execution.
Key Benefits:
Flexible Data Sources
Use any indicator or data source available on your TradingView chart
Custom Conditions
Create flexible entry and exit conditions with multiple data comparisons
Dynamic Risk Management
Set take profit and stop loss levels based on indicators or fixed values
Invite-Only Access
The TradeSgnl Strategy Builder is available exclusively to our subscribers through TradingView's invite-only system. To gain access:
- You must have an active TradeSgnl subscription or trial
- Submit your TradingView username in your profile page
- Once approved, the strategy will appear in your TradingView 'Invite-only Scripts' section
- A TradingView paid plan is recommended for alert capabilities
Getting Started
Once you've subscribed to TradeSgnl and submitted your TradingView username in the subscriber portal, you'll have access to our Strategy Builder through TradingView's invite-only scripts feature.
Access the Strategy Builder
Open a TradingView Chart
Log into TradingView using the account with the username you provided during your TradeSgnl subscription. Open any chart of your choice where you want to apply the strategy.
Click Indicators in the Top Toolbar
Locate and click on the "Indicators & Strategies" button in the top toolbar (or press the / key as a shortcut) to open the indicator browser.

Navigate to Invite-only Scripts
In the indicator browser, look for the "Invite-only Scripts" section. Here you'll find the TradeSgnl Strategy Builder that has been shared with your account. Click on it to add it to your chart.

Entry Conditions
The TradeSgnl Strategy Builder allows you to create sophisticated entry conditions for both long and short positions. You can define up to four different conditions for each trading direction and combine them using logical operators.
Condition Structure
Each entry condition follows the same structure and consists of the following components:
Source A
Primary data source (indicator, price data, or other value)
Operator
Comparison operator (crosses above, is greater than, etc.)
Source B or Value
Secondary data source or a custom numerical value

Condition Operators
Operator | Description | Example Usage |
---|---|---|
Crosses Above | True when Source A crosses above Source B | MACD Line crosses above Signal Line |
Crosses Below | True when Source A crosses below Source B | Price crosses below 200 EMA |
Greater Than | True when Source A is greater than Source B | RSI > 70 |
Less Than | True when Source A is less than Source B | Stochastic < 20 |
Equal To | True when Source A equals Source B | Parabolic SAR = Price |
Available Data Sources
One of the most powerful features of the Strategy Builder is the ability to use virtually any data source available on your TradingView chart:
Price Data
Open, High, Low, Close, HL2 (High+Low/2), OHLC4, and other price aggregations
Technical Indicators
Moving Averages, RSI, MACD, Bollinger Bands, Stochastic, custom indicators, etc.
Volume Data
Volume, Volume MA, On-Balance Volume, and other volume-based indicators
Custom Values
Fixed numerical values for thresholds (e.g., RSI > 70, Price < 100)

Combining Multiple Conditions
You can define up to four separate conditions for each trading direction (long/short) and combine them using logical operators:
Operator | Description | Example Usage |
---|---|---|
AND | Both conditions must be true for the result to be true | RSI < 30 AND MACD crosses above Signal Line |
OR | At least one condition must be true for the result to be true | Price > 200 EMA OR Volume > 1.5× Average Volume |
Example Entry Condition Scenarios
Moving Average Crossover
Long Entry Condition:
Fast MA (e.g., MA 10) crossing over Slow MA (e.g., MA 50)
Configuration:
• Source A: MA 10
• Operator: Crossing Over
• Source B: MA 50
• Logic: Single condition (others disabled)
RSI With Trend Confirmation
Long Entry Condition:
RSI crosses above 30 (oversold) AND price is above 200 EMA (uptrend confirmation)
Configuration:
• Condition 1:
- Source A: RSI
- Operator: Crossing Over
- Source B: Custom Value (30)
• Condition 2:
- Source A: Close
- Operator: Greater Than
- Source B: EMA 200
• Logic: AND (both conditions must be true)

The same condition structure applies to both long and short entries, but typically with inverted operators (e.g., crossing over for longs, crossing under for shorts).
Exit Conditions
The Strategy Builder allows you to create flexible exit conditions separate from your take profit and stop loss levels. This gives you the ability to exit positions based on technical indicators or price action signals.
Exit Condition Structure
Exit conditions follow the same structure as entry conditions but are specifically designed to close existing positions:
Up to Two Conditions per Direction
You can define up to two separate exit conditions for long positions and two for short positions
Same Source Selection Options
Use any indicator or price data on your chart as a trigger for exit signals
AND/OR Logic
Combine conditions using AND (both must be true) or OR (either can be true) logic
Independent from TP/SL
Exit conditions work alongside your take profit and stop loss levels - whichever triggers first will close the position

Only Exit on Profit Option

Exit Condition Examples
Here are some common exit condition setups:
Trailing Moving Average Exit
Long Exit Condition: Price crosses below a faster-period moving average
Configuration:
• Source A: Close
• Operator: Crossing Under
• Source B: EMA 20
• Logic: Single condition (second disabled)
This exit strategy allows your trade to run while it remains above the moving average, but exits when momentum shifts.
RSI Extreme Exit
Long Exit Condition: RSI crosses above 80 (extreme overbought condition)
Configuration:
• Source A: RSI
• Operator: Crossing Above
• Source B: Custom Value (80)
• Logic: Single condition (second disabled)
• Only Exit on Profit: Enabled (to ensure we only exit winning trades)
This exit strategy takes profits when a position becomes extremely overbought, potentially capturing the peak of a move.

Take Profit & Stop Loss
The Strategy Builder provides flexible take profit (TP) and stop loss (SL) settings that can be configured independently for long and short positions. Unlike conditional exits, take profits and stop losses are fixed price levels calculated when a position is opened.

TP/SL Configuration Structure
For each position direction (long/short), you can configure:
- Enable/Disable
Each TP and SL can be individually enabled or disabled
- Type
Multiple calculation methods for determining the exact TP/SL levels
- Value
The specific numeric value to use with the selected calculation type
- Indicator Source
When using Indicator type, the specific indicator to use as the TP/SL level
TP/SL Types
The Strategy Builder supports four different methods for calculating take profit and stop loss levels:
Feature | Type | Description |
---|---|---|
Ticks | Distance in ticks/pips from entry price | Fixed distance in ticks/pips from entry price. Best for consistent risk management across different instruments. |
Price | Exact price level for TP/SL | Specific price level. Ideal when you have precise price targets or support/resistance levels. |
Currency | Fixed amount in account currency | Fixed amount in account currency from entry price. Best for consistent profit/loss targets in monetary terms. |
Indicator | Dynamic levels based on indicator values | Uses a selected indicator's value as the TP/SL level. Perfect for dynamic exits based on technical indicators (e.g., Bollinger Bands). |

{{strategy.order.alert_message}}
as your alert message creates a single alert that works for all signal types (entries, exits, TP/SL). The strategy automatically fills in the correct signal format based on which condition triggered the alert.Alert Messages
Alert messages are the text sent to the TradeSgnl EA when a strategy condition is triggered. Properly formatted alert messages are essential for the EA to execute trades correctly based on your strategy signals.

License ID Configuration
Automatic License ID Inclusion
When you enter your License ID in the input field, the Strategy Builder automatically:
- Prepends your license ID to all alert messages with a comma separator
- Formats messages in the required 'LicenseID,SIGNAL' format for the EA
- Ensures your EA recognizes signals from your licensed account
Example
With license ID: 5643048533453
Alert message: EURUSD,buy,risk=0.01
Final message sent to EA:
Alert Message Format for TradeSgnl EA
Example Alert Messages
Long Entry with Fixed SL/TP
EURUSD,buy,risk=0.01,sl=30,tp=60
Example of a long entry alert with stop loss and take profit levels defined.
Short Exit
EURUSD,closeshort
Example of a short position exit alert.
Complete Examples (with license ID)
Long Entry
LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=60
Short Entry with Comment
LicenseID,GBPUSD,sell,risk=0.02,sl=25,tp=50,comment=Trend Following
Exit Long
LicenseID,EURUSD,closelong
Setting Up TradingView Alerts
Once you've formatted your alert messages, you need to create TradingView alerts to send them to your TradeSgnl EA. Follow these steps to set up your alerts correctly:
Click the Alerts Button
Find and click the 'Alerts' button located at the top of your TradingView chart interface. This will open the alert creation dialog where you can set up your strategy alerts.
The alert button appears in the top toolbar of any TradingView chart and has a bell icon.

Configure Alert Condition
In the Settings tab, from the Condition dropdown menu select TradeSgnl Strategy Builder. This ensures that alerts will trigger based on your strategy's signals. You can set other options like Interval and expiration.

Configure Alert Message
Click on the Message tab within the alert dialog. In this tab, you'll configure the alert name and message.
In the Message field, enter {{strategy.order.alert_message}}
This variable will automatically insert the correctly formatted message for any trigger (entry, exit, TP/SL).

{{strategy.order.alert_message}}
as your alert message creates a single alert that works for all signal types (entries, exits, TP/SL). The strategy automatically fills in the correct signal format based on which condition triggered the alert.Set Up Webhook
Click on the Notifications tab within the alert dialog. Check the Webhook URL option.
Enter https://webhook.tradesgnl.com as the URL.
Click Create to save the alert.

Alert Testing Recommendations
Before relying on your alerts for live trading, follow these best practices:
Start with Demo Trading
Test your alerts with a demo account first to ensure they're working correctly with your EA.
Verify Alert Delivery
Check your MT5 EA logs to confirm alerts are being received and processed correctly.
Use Small Position Sizes
Start with minimal risk until you're confident in your alert configuration.
Need Additional Help?
Our support team is ready to assist you with any questions you might have.