Backtest Signals Guide

image

Contents:

Follow Along a Backtest Using Provided Chartbooks

Prepare a Chart, Create a Signal, then Run a Backtest

For additional information on Auto Trading signals CLICK HERE.

Backtesting Cheat Sheet:

  1. Prepare chart(s) for backtesting
  2. Formulas in the Buy K3/Sell M3 cells
  3. Disconnect data feed then run Autotrade Replay Backtest

Cheat Sheet Table For Sierra Chart Backtesting - Some Possible Combinations

ACSIL
Just Spreadsheet For Trading Study
Spreadsheet Auto + Trade Management by Study
Spreadsheet + Trade Order Config
Combination of Previous Options
Controlled By
Compiled Study
Spreadsheet K-N cells. J22-J25
Spreadsheet K-N cells, Trade Management by Study study
Spreadsheet K-N, Trade Config (OCO)
Spreadsheets, studies, Trade Config
Limitations
Requires C++/ACSIL understanding
1 second OR 1 bar close refresh
Performance
Extremely Fast, Highly Reliable
High
High
High
High
Description
Best choice in most cases
All conditions, order quantities, and orders managed through spreadsheet
Same as prior, but uses Trade Management by Study study to move orders
Trading operations handled by spreadsheet, order management via Trade Order Config.
Combine various methods to backtest or autotrade in Sierra Chart

Key Concepts for Spreadsheet Backtesting

  • Basics:
    • Buy and Sell logic in cell K3, and N3. 1 is true 0 is false
    • The latest data is row 3, and when the bar forms it is sent to the row below, along with every other loaded row of data
    • Spaces don’t matter in formulas and they will not cause syntax errors
    • In the list of studies for a chart, the Spreadsheet System for Trading should be moved to the bottom of the studies list
    • Use the absolute least amount of Number of Rows as possible, under study settings for the spreadsheet
  • Become familiarized with key columns and cells:
    • J Column relates to key spreadsheet and chart values, mixed between user defined and read-only
    • All columns beyond Z be default are for studies. It is possible to modify the amount of formula columns
    • There are static cells and main spreadsheet formula cells. It’s possible to use static cells in H or J column in other cells and references
  • Understand referencing of studies and rows:
    • Using absolute references. In case of referencing static stationary cells (J Column) from formula cells, simply add “$” between the name and number of the cell. Example: Instead of J8 cell we use the absolute reference of $J$8.
    • The first study that is added to a chart containing a spreadsheet will be the AA column. The current data is row 3, so the latest value for that study is in cell AA3. Instead of referencing to that cell as AA3, we’ll identify by study name + row, for a more fluid sheet: ID1.SG1@3.
    • ID1.SG1@3 means: ID1 = study ID, SG1 is sub graph 1, @3 means row 3 (the latest data)
    • Example in a formula:
    • =IF(ID1.SG1@3 > 1000,1,0)
      # This logic returns 1 if latest value of ID1.SG1 is greater than 1000.
    • To refer to previous rows (bars), and also a range:
    • # This logic returns true when the current and last bar study value is > 1000
      =AND(ID1.SG1@3 > 1000, ID1.SG1@4 > 1000)
      
      # For a range, can try this
      =AND(MIN(ID1.SG1@3:ID1.SG1@12) > 1000)
      

Prepare Charts and Studies

CRITICAL:

  • Title Bar: Trade > Auto Trading Enabled - Global
  • Disconnect from data feed when running backtest
  • Chart Settings > Trading menu > Always Simulate Bid and Ask Prices During Replay: Yes
Click Arrow to See Example of Simulate Bid and Ask Prices
image

  • Open the chart to be backtested, ensure data on startup has finished downloading, and the desired studies have been applied (example: moving average 1 and moving average 2)
  • Title Bar : Analysis > Studies > Spreadsheet System for Trading > Add
    • If no backtest trading is desired, and user only wants to view or export signals, then use the Spreadsheet System/Alert study instead
  • With the Spreadsheet study selected hit Settings from the Chart Studies window
  • Configure Input Values as needed, and under Spreadsheet Name give the sheet any name before pressing OK. These settings vary vastly between traders, to see an example expand the arrow below:
  • Close the Chart Studies window

Other settings within the Title Bar: Chart Settings window to consider changing:

  • Data Limiting Tab
    • Days to Load for Intraday Chart Type: [Desired days to backtest]
  • Symbol Tab
    • Continuous Contract: Continuous Futures Contract - [User rollover of choice, volume or date based]

Create Buy/Sell Signals

This example creates a BUY when price is greater than EXAMPLE STUDY 1 and SELL when below EXAMPLE STUDY 2. When conditions of the AND formula occur, the value turns to TRUE (or 1).

⚠️
Spreadsheet Legend:

Current Row: Row 3 is main row for formulas that automatically copy logic to cells below

Buy Column: Cell K3

Sell Column: Cell M3

EXAMPLE STUDY 1: As ID1.SG1 Cell AA3 of spreadsheet

EXAMPLE STUDY 2: As ID2.SG1 Cell AB3 of spreadsheet

Last : Last traded price of most recent row. ID0.SG4 = Cell E3 of spreadsheet

Spreadsheet: The Spreadsheet created from steps above for Alerts

Usually using 1 or more studies a signal is derived. To begin:

  • Add any studies to be used for signals (Example: Moving Average 5, Moving Average 21)
  • Open the recently created Spreadsheet from the above steps

In cell K3, click to edit cell and create a BUY signal:

	=AND(ID0.SG4@3 > ID1.SG1@3 , ID0.SG4@3 < ID2.SG1@3)

# ID0 IS THE ID OF STUDY, SG4 IS SUBGRAPH 4, @3 IS THIRD (CURRENT) ROW. ID0.SG4@3.

In cell M3, click to edit the cell and create a SELL signal:

=AND(ID0.SG4@3 < ID1.SG1@3,ID0.SG4@3 > ID2.SG1@3)

When either of these conditions are TRUE, the cell will return a 1. This triggers a buy or sell signal.

To back test simulated trades using these signals, proceed to the next step.

Run The Backtest

Initial Preparation:

  • Trading is UNLOCKED
  • Trade > Auto Trading Enabled - Global is checked
  • Configure the Trade Order Window. Stop loss and targets if desired. Attached orders are checked. More info on the Trade Window HERE
  • DISCONNECT from the data feed (Title Bar: File > Disconnect)

After the steps above have been followed it’s time to run a backtest:

  • Title Bar: Trade > AutoTrade System Replay Backtest
  • Replay Window pops up, change the settings:
    • Charts To Replay: All Charts in Chartbook
    • Replay Mode: Standard Replay is often sufficient, but can use: Accurate Trading System Back Test or others
    • Speed: Try 10 or less, for very basic signals can try 100000
    • Set Date to desired date and time
  • Press Play

Results can be found:

  • Title Bar: Trade > Trade Activity Log > Statistics menu

Note: For a full walkthrough of auto trading in Sierra Chart CLICK HERE

◀️Previous Module:
Backtesting Introduction

▶️Next Module:
Export Bar and Study Data

Back To Handbook Home

📊
Sierra Chart Master Handbook - Unofficial

Please be aware that the information contained in this handbook is not intended to be and should not be taken as financial advice. The creator is not a financial advisor and the materials provided should not be relied upon in making any financial decisions. Any actions taken based on the information contained in this handbook are taken at the reader's own risk and the creator will not be held liable for any losses or damages resulting from such actions.

In addition, the creator is not a registered broker or financial advisor in the United States and the materials contained in this handbook do not constitute financial advice or a recommendation to buy or sell any financial instrument. The creator does not endorse or recommend any particular investment strategy and the reader should not rely on any information contained in this handbook as the basis for making any investment decisions.

Furthermore, past performance is not indicative of future results and the reader should be aware that trading futures, crypto, stocks, and NFTs carries a high degree of risk and the possibility of significant losses. The reader should carefully consider their financial situation and seek independent financial advice before making any investment decisions.

The creator of this handbook is not an expert and the materials contained within are provided for educational and entertainment purposes only. No material contained in this handbook suggests a specific method or strategy for investing or trading, and under no circumstances should anything contained in this handbook or any related materials be considered as financial advice.

Please also be aware that some pages within this handbook may contain affiliate links that pay the creator a small commission at no additional cost to the reader. The inclusion of these links does not constitute a recommendation or endorsement of the products or services being advertised and the reader should carefully evaluate the suitability of any product or service before making a purchase.

By accessing and using the materials contained in this handbook, the reader acknowledges and agrees to the terms of this disclaimer and releases the creator from any liability for financial losses or damages resulting from the reader's use of the materials contained within. It is possible to lose more than the value of a trading account. Nothing within this handbook is advice or a recommendation to the reader. Any damages or losses following changes the reader makes to Sierra Chart after reading material within this handbook the creator should not be held liable. This handbook is NOT created by Sierra Chart and is not an official handbook to Sierra Chart. Each purchase only grants the user associated with the email provided on checkout for lifetime access. Trading is risky.