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:

  1. Prepare Indicators:

    • Add the Smart Signals Assistant and Backtest - Strategy Builder to your chart.

    • In the SSA settings, ensure Smart Signals are enabled and Take-Profit/Stop-Loss Levels are enabled.

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

  1. 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 to Step 1.

  • Condition 2: Enable, set the Boolean to OR, select External Signal 9, assign to Step 1.

  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 to Step 1.

  • Condition 2: Enable, set the Boolean to OR, select External Signal 11, assign to Step 1.

  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.

  1. Set up the Flip Condition:

    • In the Exit Long Trigger section, enable Condition 1.

    • From the "Condition" dropdown, select Short Entry Trigger and assign it to Step 1.

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

  1. Set up the Flip Condition:

    • In the Exit Short Trigger section, enable Condition 1.

    • From the "Condition" dropdown, select Long Entry Trigger and assign it to Step 1.

  2. Set up the Take-Profit and Stop-Loss:

    • Enable TP and SL, linking them to the same Take Profit 1 Level Export and Stop Loss Level Export plots from the SSA. The indicator automatically calculates the correct levels for short positions.

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 the Value column.

  • Warnings:

    • !: Your setup has an error (e.g., an entry is enabled without an exit). The specific error is listed in the Value column.

    • OK: The configuration is valid.

  • Performance Metrics: Displays key statistics like Net Profit, Win Rate, and Max Drawdown.

Last updated