Practical Example
Practical Example: A Trend-Following Strategy with SSA
This example demonstrates how to build a strategy using signals from the Smart Signals Assistant (SSA) indicator.
Strategy Goal:
Entry: Enter a trade when a Normal or Strong "Smart Signal" appears.
Exit: Close the trade if an opposing Smart Signal appears (a strategy "flip") or if the SSA built-in TP/SL levels are hit .

Configuration Steps:
Prepare Indicators:
Add the
Smart Signals Assistant
andBacktest - Strategy Builder
to your chart.In the SSA settings, ensure Smart Signals are enabled and Take-Profit/Stop-Loss Levels are enabled.
Configure Backtester
Condition Setup
:
The Smart Signals appear on the chart as shapes (▲
and ▼
). The backtester can read the price level of these shapes. When no signal is present on a bar, the value is empty (na
). We will set up conditions to detect when a signal shape is present. A simple way to do this is to check if the plot's value is greater than zero.
Signal 8 (Normal Bullish):
[Smart Signals Assistant -> Bullish Signal]
Greater than
0
.Signal 9 (Strong Bullish):
[Smart Signals Assistant -> Strong Bullish]
Greater than
0
.Signal 10 (Normal Bearish):
[Smart Signals Assistant -> Bearish Signal]
Greater than
0
.Signal 11 (Strong Bearish):
[Smart Signals Assistant -> Strong Bearish]
Greater than
0
.

Use signals 8-12 when the sources are from plotshape() or platchar() functions that only appear when a certain condition is true, not continuous plots like a moving average or RSI.
Configure
Long Trigger
:
We want the entry to trigger on a Normal OR a Strong Bullish signal.
Condition 1: Enable, select
External Signal 8
, assign toStep 1
.Condition 2: Enable, set the Boolean to
OR
, selectExternal Signal 9
, assign toStep 1
.
Configure
Short Trigger
:
Similarly, we want the entry to trigger on a Normal OR a Strong Bearish signal.
Condition 1: Enable, select
External Signal 10
, assign toStep 1
.Condition 2: Enable, set the Boolean to
OR
, selectExternal Signal 11
, assign toStep 1
.
Configure
Exit Long Trigger
:
We'll build a comprehensive exit rule. The position will close if the Take-Profit (TP) is hit, the Stop-Loss (SL) is hit, OR if an opposing short signal appears.
Set up the Flip Condition:
In the
Exit Long Trigger
section, enableCondition 1
.From the "Condition" dropdown, select
Short Entry Trigger
and assign it toStep 1
.
Set up the Take-Profit and Stop-Loss:
In the same section, check the box to enable TP. Click the source input next to it and select the plot from the Smart Signals Assistant for your take-profit level (e.g.,
Take Profit 1 Level Export
).Check the box to enable SL. For its source, select the
Stop Loss Level Export
plot from the Smart Signals Assistant.
Configure Exit Short Trigger
:
The logic is identical but reversed for short positions.
Set up the Flip Condition:
In the
Exit Short Trigger
section, enableCondition 1
.From the "Condition" dropdown, select
Long Entry Trigger
and assign it toStep 1
.
Set up the Take-Profit and Stop-Loss:
Enable TP and SL, linking them to the same
Take Profit 1 Level Export
andStop Loss Level Export
plots from the SSA. The indicator automatically calculates the correct levels for short positions.
Make sure the TP and SL levels are enabled in the SSA indicator as the calculations are turned off when not in use, the export levels will return 0 if TP/SL levels are disabled
Your strategy now has a complete trade management plan. It will enter a long position on a bullish signal and will exit based on whichever of these three conditions occurs first: the take-profit is hit, the stop-loss is hit, or a bearish entry signal triggers a flip.
5. Understanding the Dashboard
The on-chart table provides a quick status check and performance summary.
Trades Status:
ON
: The strategy configuration is valid and running.OFF
: The strategy is paused due to an invalid setup.
Longs/Shorts Status:
READY
: The side is correctly configured with both entry and exit rules.BLOCKED
: The side is disabled. The reason (e.g., "No Exit") is shown in theValue
column.
Warnings:
!
: Your setup has an error (e.g., an entry is enabled without an exit). The specific error is listed in theValue
column.OK
: The configuration is valid.
Performance Metrics: Displays key statistics like Net Profit, Win Rate, and Max Drawdown.
Last updated