INVITE-ONLY SCRIPT

LuxAlgo - Backtester (PAC)

Updated
The PAC Backtester is an innovative strategy script that allows users to create a wide variety of strategies derived from price action-related concepts for a data-driven approach to discretionary trading strategies.

Thanks to our 'Step' and 'Match' algorithm, users can create custom and complex strategy entries and exits from features such as market structure, order blocks, imbalances, as well as any external indicators, allowing users to create entries from a sequence of conditions and/or multiple matching conditions.

We included a complete alert system that will send a notification for each action taken by the strategy and we also allow users to set custom messages for each action taken by a strategy.

🔶 Features

🔹Step & Match Algorithm

More complex entry rules can be created by using multiple conditions together, this is done thanks to the Step dropdown setting on the right of each condition.

The Step setting is directly related to the Step & Match algorithm and works in two ways:


  • When two or more conditions have the same step number, both conditions are evaluated. Used to test matching conditions.
    When two or more conditions have different step numbers, each condition will be evaluated in order, testing for the first step and switching to the next step once the previous one is true. When the final step is true the strategy will open a market order. Used to create a sequence of conditions.


This operation is complementary, as you can create a sequence of conditions with one step consisting of two or more matching conditions as long as they have the same step number.

🔹Fully Customizable Price Action Concepts As Entries

We allow the users to use market structures, order blocks, imbalances, and external sources together to set their custom entry and exit conditions.

Market structures are commonly used to determine trend direction by indicating when prices break prior swing points. Their occurrence can be used as entry conditions.

Order blocks highlight areas where institutional market participants open positions, one can use order blocks to determine confirmation entries or potential targets as we can expect there is a large amount of liquidity at these order blocks. Price entering, being within, or mitigating an order block can be used as an entry condition.

Market imbalances highlight areas where there is a disparity between supply and demand. Price entering, being within, or mitigating an imbalance can be used as an entry condition.

This system also allows the use of external sources to create entry and exit conditions, such as moving averages, bands, trailing stops...etc.

🔹Complete Alert System

Users can get alerted for any action executed by a strategy, from opening positions to closing them.

The message field in the Alert Messages setting section allows for the strategy to send a custom alert message depending on the action taken by the strategy, if no messages are set the strategy will send default messages.

🔶 Usage

Users can create complete price action strategies from this script, let's see an example using the following entry conditions:

  • Long: Mitigated bearish order block occurring during the New York session after a mitigated bearish imbalance.
  • Short: Mitigated bullish order block occurring during the New York session after a mitigated bullish imbalance.
  • Take Profit: 2 points away from the entry price.
  • Stop Loss: 1 point away from the entry price.


snapshot

We can also use features from Price Action Concepts™ to construct custom exit conditions, leading to the following strategy conditions:

  • Long: Bullish CHoCH and price mitigates bearish FVG.
  • Short: Bearish CHoCH and price mitigates bullish FVG.
  • Exit Long: Price mitigates bearish order block.
  • Exit Short: Price mitigates bullish order block.


snapshot

Users can achieve a wide variety of results by using external indicators as an input source for entries and exits, combining the best from price action and technical indicators. We might for example be interested in exiting a position when the RSI oscillator is overbought or oversold.

snapshot

🔶 Strategy Properties (Important)

This script backtest is done on daily EURGBP, using the following backtesting properties:

  • Balance (default): 10 000 (default base currency)
  • Order Size: 10% of the equity
  • Comission: 3.4 pips (average spread for EURGBP)
  • Slippage: 1 tick
  • Stop Loss: 0.01 points away from entry price


We use these properties to ensure a realistic preview of the backtesting system, do note that default properties can be different for various reasons described below:

  • Order Size: 1 contract by default, this is to allow the strategy to run properly on most instruments such as futures.
  • Comission: Comission can vary depending on the market and instrument, there is no default value that might return realistic results.


    • We strongly recommend all users to ensure they adjust the Properties within the script settings to be in line with their accounts & trading platforms of choice to ensure results from strategies built are realistic.

      🔶 How to access

      You can see the Author's Instructions below to learn how to get access.
Release Notes
New in version 1.0.1:

Users can now set take profits/stop losses using ticks away from the price preceding an entry. The entry price is now visible. New styling options.
Release Notes
New in version 1.1. Added Exit Order Block/Imbalances conditions. Auto take profit/stop loss placements. Fixed a bug affecting short session condition.
Release Notes
Added

  • Added ability to specify if market orders can be opened only if there are no existing positions
  • New trailing stop loss
  • Added ability to use price placeholders in the numerical input field of the second external source setting
  • New {prefix} placeholder


Changed

  • {ticker} placeholder will no longer return a symbol prefix
  • Previous order will no longer be explicitly closed when a new order is generated


Fixed

  • Fixed session condition not working for short conditions
  • Fixed previous take profit/stop loss values being returned on a new entry alert message
  • Fixed wrong messages being returned in certain actions taken by the strategy


Removed

  • Removed "Auto" take profits/stop losses
  • Removed liquidity grabs "Length" setting
Release Notes
- Trailing stop loss is now initially set on the entry price
- Minor changes
Release Notes
Added tooltips to alert message settings
Release Notes
- Added ability to backtest a time window specified using dates
- Added ability to partially exit trades
Release Notes
Added new Long/Short "Time Exits". New Inverse FVG imbalance. New "Entered" "Order Block/Imbalance" logic now evaluates wicks rather than closing price alone. Minor changes.
Release Notes
- New trade based price forecasting feature
Release Notes
- New invalidation step type
- New supported invalidation behaviors
Release Notes
- Fixed "Invalidate" steps throwing error when set for long conditions
Release Notes
- New "All" filter step type
- New "Trend" market structure condition
Release Notes
Trade based forecasts will no longer disappear after a trade is exited
Release Notes
- Added forecast method for setting take profits. This method will use user set percentiles of forecasts as take profits levels
- Forecasts data tracking will now ignore exits in a strategy.
Release Notes
- Added one additional external condition to the long/short entry conditions
- Minor changes
Release Notes
- Fixed external source 2 conditions crashing the backtester when used as independent conditions
Release Notes
- Added ability to always exit trades on a profit when an exit condition trigger
- Added ability to prevent simultaneous trades from triggering at the same time
backtestingbacktestingsystemChart patternsluxalgopacpriceactionconceptssystemTrend Analysis

Invite-only script

Access to this script is restricted to users authorized by the author and usually requires payment. You can add it to your favorites, but you will only be able to use it after requesting permission and obtaining it from its author. Contact LuxAlgo for more information, or follow the author's instructions below.

TradingView does not suggest paying for a script and using it unless you 100% trust its author and understand how the script works. In many cases, you can find a good open-source alternative for free in our Community Scripts.

Author's instructions

Want to use this script on a chart?

Warning: please read before requesting access.

Get access to our exclusive tools: luxalgo.com

Join our 150k+ community: discord.gg/lux

All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
Also on:

Disclaimer