TradeSgnl Logo
TradeSgnl
Docs
Portal

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

Tip
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.

TradingView indicators button
Click the Indicators & Strategies button
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.

TradingView invite-only scripts section
Find the TradeSgnl Strategy Builder in your invite-only scripts
Tip
If you don't see the Invite-only Scripts folder or cannot access the Strategy Builder, try refreshing your browser. If issues persist, please contact support with your TradingView username.

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

Entry condition structure showing Source A, Operator, and Source B components
Visual representation of a trading condition structure
Condition Operators
OperatorDescriptionExample Usage
Crosses AboveTrue when Source A crosses above Source BMACD Line crosses above Signal Line
Crosses BelowTrue when Source A crosses below Source BPrice crosses below 200 EMA
Greater ThanTrue when Source A is greater than Source BRSI > 70
Less ThanTrue when Source A is less than Source BStochastic < 20
Equal ToTrue when Source A equals Source BParabolic SAR = Price
Available condition operators in the Strategy Builder
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)

Tip
To use an indicator as a data source, first add it to your chart. For example, if you want to create a condition based on RSI crossing above 30, first add the RSI indicator to your chart, then select it as Source A in your condition.
Available data sources in TradingView for strategy conditions
Selecting data sources from TradingView indicators and price data
Combining Multiple Conditions

You can define up to four separate conditions for each trading direction (long/short) and combine them using logical operators:

OperatorDescriptionExample Usage
ANDBoth conditions must be true for the result to be trueRSI < 30 AND MACD crosses above Signal Line
ORAt least one condition must be true for the result to be truePrice > 200 EMA OR Volume > 1.5× Average Volume
Logical operators for combining conditions
Example Entry Condition Scenarios
1
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)


2
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)

Example entry condition setup in TradingView Strategy Builder
Visual example of configuring multiple entry conditions in the Strategy Builder

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

Exit condition structure showing same components as entry conditions
Exit conditions use the same structure as entry conditions
Only Exit on Profit Option
Only Exit on Profit option in the Strategy Builder
The "Only Exit on Profit" option prevents exits during drawdowns
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.

Example exit condition configuration in the Strategy Builder
Example of configuring a trailing moving average exit condition

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.

Overview of the Take Profit and Stop Loss section in the Strategy Builder
Complete Take Profit and Stop Loss section overview in the Strategy Builder
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
TicksDistance in ticks/pips from entry priceFixed distance in ticks/pips from entry price. Best for consistent risk management across different instruments.
PriceExact price level for TP/SLSpecific price level. Ideal when you have precise price targets or support/resistance levels.
CurrencyFixed amount in account currencyFixed amount in account currency from entry price. Best for consistent profit/loss targets in monetary terms.
IndicatorDynamic levels based on indicator valuesUses a selected indicator's value as the TP/SL level. Perfect for dynamic exits based on technical indicators (e.g., Bollinger Bands).
Tip
While the Strategy Builder allows you to set both conditional exits and TP/SL levels simultaneously, having too many exit methods can sometimes lead to prematurely closed trades. Consider which exit method is most appropriate for your trading style and strategy.
Take Profit and Stop Loss configuration options in the Strategy Builder
Take Profit and Stop Loss configuration in the Strategy Builder
Tip
Using {{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.

Overview of the Alert Messages section in the Strategy Builder
Complete Alert Messages section overview in the Strategy Builder
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:

5643048533453,EURUSD,buy,risk=0.01
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.

TradingView alert button location
The alert button in TradingView's top toolbar
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.

TradingView alert condition configuration
Setting the alert condition in the Settings tab
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).

TradingView alert message configuration
Configuring the alert message in the Message tab
Tip
Using {{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.

TradingView webhook URL configuration
Configuring the webhook URL in the Notifications tab
Tip
TradingView requires a paid plan (Essential plan or higher) to use webhooks for alert notifications.
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.

Email Support