Settings Reference

Master Settings

This group controls the core behavior of the backtester.

  • Enable Longs/Shorts: The main on/off switch for long and short trading. If disabled, the backtester will not open new positions for that side.

  • Leverage Mode: Defines how margin and liquidation are calculated.

    • Isolated: Risk is confined to the specific capital allocated to a single position.

    • Cross: The entire account equity is used as collateral to prevent liquidation on an open position.

  • Long/Short Leverage: The leverage multiplier applied to long and short positions, respectively (e.g., 3.0 for 3x leverage).

  • Sizing Mode: Determines how the size of each trade is calculated before leverage is applied.

    • Percent: The trade allocates a percentage of the total account equity.

    • Absolute USD: The trade allocates a fixed dollar amount.

  • Allocation Value: The numerical value for the chosen Sizing Mode (e.g., 10.0 for 10% or $10).


Trigger Groups (Long, Short, Exit Long, Exit Short)

These groups define the specific rules for entering and exiting trades. The settings are identical for all four groups.

Trigger Invalidation These settings control how and when an in-progress, multi-step trigger sequence is reset. This is crucial for ensuring the strategy acts only on fresh, relevant signals.

  • Invalidation Type: This dropdown menu determines the rule used to reset a sequence after it has started but before it is complete.

    • Time Interval: Starts a countdown timer when the first step is completed. If all subsequent steps are not completed within the Reset Timeout (bars) window, the entire sequence is invalidated. This is ideal for strategies where setup conditions must occur in relatively close succession.

    • Strict Sequence: The steps must be completed in their exact numerical order (1, then 2, then 3, etc.). If a condition for a later step (e.g., Step 3) becomes true before an earlier step (e.g., Step 2) has been completed, the entire sequence is immediately invalidated. This is perfect for causal strategies where one event must lead to the next.

    • Invalidate on Step 1: If a Step 1 condition becomes true again after the sequence has already started, the current in-progress sequence is immediately invalidated, and a new one begins. This is useful for acting on the most recent or strongest setup signal.

  • Reset Timeout (bars): Specifies the number of bars for the countdown timer. This setting is only used when the Invalidation Type is set to Time Interval.

  • Condition [1-5] Enabled: A checkbox to activate or deactivate a specific condition row.

  • Boolean (AND/OR): (For conditions 2-5) Determines how this condition logically combines with other active conditions within the same step.

    • AND: Requires this condition AND the previous one(s) in the step to be true.

    • OR: Requires either this condition OR the previous one(s) in the step to be true.

  • Condition: A dropdown menu where you select which pre-defined External Signal (from the Condition Setup section) to use for this rule.

  • Step: Assigns the condition to a sequential step from 1 to 5. The strategy must satisfy all conditions in Step 1 before it will evaluate Step 2, and so on.

Special Options for Exit Triggers:

  • Flip Condition: In the "Condition" dropdown for Exit Long or Exit Short triggers, you can select Short Entry Trigger or Long Entry Trigger, respectively. This will cause the position to close and "flip" direction when the opposing entry signal is confirmed.

  • TP / SL:

    • TP/SL Checkbox: Enables Take-Profit or Stop-Loss for that side.

    • TP/SL Source: A source input that allows you to link the TP or SL price level to a plot from another indicator on your chart.


Condition Setup

This section is the foundation of your strategy, where you translate raw data from indicators into simple, reusable true/false statements. Think of these 12 "External Signals" as the logical building blocks you will later assemble in the trigger sections. Each signal is a complete logical condition defined by three parts:

  • Signal Source (Left Field): This is the primary, dynamic data point you want to measure. It is a value that changes with each bar on the chart.

    • How to use: Click the dropdown to select a data source.

    • Examples:

      • Price Data: close, open, high, low.

      • Indicator Plots: The plotted lines or shapes from any other indicator on your chart, such as an RSI line, a Moving Average, or a signal from the Smart Signals Assistant. For instance, you could select [Smart Signals Assistant -> Bullish Signal] to read the location of the bullish signal shape.

  • Operator (Middle Field): This defines the logical comparison or relationship between the Signal Source and the Value.

    • Standard Comparisons:

      • Greater than: Is the Source's value higher than the Value's?

      • Lesser than: Is the Source's value lower than the Value's?

      • Equal to: Are the two values exactly the same? (Note: This is less common for price data).

      • Not equal to: Are the two values different?

    • State-Change Triggers: These are crucial for detecting specific events.

      • crossover: Becomes true only on the single bar where the Signal Source crosses above the Value. It was previously below or equal, and is now above.

      • crossunder: Becomes true only on the single bar where the Signal Source crosses below the Value.

      • cross: Becomes true on any bar where the Signal Source and Value intersect, regardless of direction.

  • Value (Right Field): This is the benchmark, threshold, or second data series that the Signal Source is compared against.

    • Fixed Value: A static number you type in. This is useful for creating rules based on specific levels.

      • Example: Comparing an RSI plot to the fixed value 70.

    • Dynamic Value (Source): Another plot from the chart. This is essential for creating dynamic, adaptive strategies.

      • Example: Comparing the chart's close price to a Moving Average plot. The condition remains true as long as the price stays above the moving average line.

Putting It Together: A Complete Example

Let's say you want to create a classic "Golden Cross" signal (50 EMA crossing over the 200 EMA).

  1. Add an indicator to your chart that plots two EMAs (e.g., TradingView's built-in "EMA Cross").

  2. In the Condition Setup, configure External Signal 1 as follows:

    • Signal Source: [EMA Cross -> EMA (50)]

    • Operator: crossover

    • Value: [EMA Cross -> EMA (200)]

Now, External Signal 1 will be true only on the exact bar the 50 EMA crosses above the 200 EMA, and false on all other bars. You can then use this powerful, pre-built condition in your Long Trigger section.

The right field from Signal Sources 1-7 are also external sources (like open, close, or other indicator plots) while sources 8-12 are float input values.


Appearance

These settings control the visual elements of the backtester on your chart.

  • Bullish/Bearish Colour: Sets the color for bar coloring when in a long or short position, and for the TP/SL lines drawn on the chart.

  • Show Strategy Table: Toggles the visibility of the on-chart performance and status dashboard.

  • Table Size: Adjusts the text size within the dashboard (Tiny, Small, Medium, Large).

  • Table Position: Sets the location of the dashboard on your chart (e.g., top right, bottom left).

Last updated