Articles on: Trading Essentials

Backtesting in Altrady

Introduction


Backtesting is the process of testing a trading strategy using historical market data to evaluate its past performance. This helps assess whether a strategy might be profitable—without risking real money.


Altrady’s backtesting simulates trading similarly to paper trading, but uses its own simulated balances. No live or paper account is required.


The market’s candle history is replayed one bar at a time at your chosen speed. You can place or modify orders as if trading live, making it easy to test strategies under realistic conditions.


All standard order types are supported, except OCO and Trailing Stop orders.


Contents


Video Overview

Background

Starting a Backtesting Session

Backtesting Controls

The Backtests Widget

Editing a Position During a Backtesting Session

Frequently Asked Questions


Video Overview


Background


Four widgets are used in backtesting. While active, these widgets are dedicated to the session and unavailable for regular use:


  • Chart Widget (with Backtest control bar): Create and control backtesting; start and stop sessions; start and stop candle replay, adjust replay timing; edit orders in the chart; create alerts.
  • Trading widget (with message at the top: Backtesting): Create and edit orders for the backtest session; view balances.
  • Position Info widget: view analytics for positions created during the current session.
  • Backtest widget: Manage, edit, view and select backtest sessions. Start a new session.


Starting a Backtesting Session


Using the Chart


  1. In the Trading Terminal, click the Replay icon at the top of the Chart widget.



  1. Click before the desired candle to select a start time.



  1. The Start replay session window will appear. Click Backtest to enter backtesting mode.


To skip this prompt next time, tick Remember my choice before clicking Backtest.



  1. In the Create Session window:


A) Name the session

B) Choose the market

C) Set the starting quote currency balance

D) Set the starting base currency balance

E) Define the start date/time

F) Define the end date/time

G) Use the Random Bar buttons to auto-generate start/end dates, respectively.


Click Create.



  1. The chart will reload based on the start time, and the backtesting controls will appear below.



Backtesting Controls



  1. Switch to Replay Mode: Exits backtesting and returns to replay mode.
  2. Start Time: Click before a candle to set a new start time.
  3. Random Bar: Randomly sets a start time.
  4. Back to Start: Restarts the session from the defined start time.
  5. Play/Pause: Toggles playback. Icon changes based on state.
  6. Step: Moves forward by one candle/bar.
  7. Auto-Resume:
  • Enabled: Session continues after events (e.g. fills, alerts).
  • Disabled: Session pauses after events until resumed manually.
  1. Replay Speed: Adjusts playback speed.
  2. Exit Backtesting: Leaves the session without ending it. Resume anytime from the Backtests widget.


The Backtests Widget


Use this widget to manage and resume sessions, and view detailed backtesting data.


For default layouts, it is enabled automatically. In custom layouts, a prompt appears the first time backtesting is launched.


Enabling the Backtests Widget


  1. Click the Widgets button in the top-right.



  1. In the dropdown, tick Backtests.




  1. The widget appears on-screen, grouped with others by default.



Saving and Resuming Backtesting Sessions


Backtesting sessions are saved automatically unless marked Finished.


Progress is only saved if trading occurred during the session.


To resume a session:


  1. In the Backtests widget, open the Running section.



  1. Find the desired session by name or scroll the list.



  1. Click Resume next to the session.


  1. Click Yes to confirm. The session will resume in the same market, from the last trade point.



Editing a Position During a Backtesting Session


Editing a position during a backtesting session functions in the same way as it does outside of a backtesting session.


  1. Click on an open/pending order on the chart. To modify the price of an order, drag the order to the desired price, via the white part of the order handle.



  1. Navigate to the Trading widget, which will now be in edit mode. Additional changes can be made to the position here. To confirm the changes, scroll to the bottom of the widget and click Place Order.



  1. If Auto-Confirm orders is disabled at the bottom of the Trading widget, a confirmation window will be displayed. Click Confirm to proceed with the changes.



Positions can also be edited via the Position Controls. To learn more about using these controls, refer to the following article: Position Management and Controls


Editing a Stop Loss with Protection: Follow Take Profit or Protection: Break Even after it has trailed, is not possible without disabling protection. To learn more, refer to the following section: Why Can't I Edit My Stop Loss with Protection: Follow Take Profit or Protection: Break Even After it Has Trailed?


Frequently Asked Questions


How Does Backtesting Compare to Live Trading?


Backtesting fills orders based solely on chart price, without an order book. Orders are filled once price crosses the order price.


In live trading, orders must match with real market orders, which can affect fill timing, execution price, and success due to liquidity.


Backtesting uses the same fee rate as paper trading.


Why Are My Results Different to a Live Position?


Differences occur because backtesting doesn’t use real market depth or exchange fees. Fills are based only on price crossing the order level.


Does it Matter Which Trading Account is Selected?


No. Balances are manually set before starting and don’t rely on actual trading accounts.


Can I Use the Base Scanner in Backtesting Mode?


Yes, if included in your subscription. Bases appear on the chart, and manual base trading can be tested. Only the latest ~1000 hours (~6 weeks) of base data is available.


Does it Work for Futures?


Yes. It works even without a Futures account.


  • Liquidation price, margin, and leverage are shown. The Liquidation Price is an estimated price assuming Isolated margin mode and may differ from the exchange.
  • Liquidations are not actioned--the price is shown for information only. A price alert can be set at the liquidation price, to help understand whether the position would have been liquidated.
  • Hedge mode is always enabled; to simulate one-way mode, open positions in one direction only, at a single time.


Can More Than One Position or Order Be Tested at Once?


Yes. Each new smart order opens a separate position shown in the Position Info widget. Hedged futures positions are also supported.


Why Can't I Edit My Stop Loss with Protection: Follow Take Profit or Protection: Break Even After it Has Trailed?


Attempting to modify the Stop price for a Stop Loss with either of these protection types, after trailing has occurred, will display the following window:



  1. Clicking this button will reset the Stop price to the level it was moved to, after trailing occurred. The position will still be in edit mode after this is clicked. The edit will need to be cancelled thereafter, or any other changes to the position will still need to be confirmed, by clicking Place Order.
  2. Clicking this button will disable protection for the Stop loss and will allow it to be moved as desired. The position will still be in edit mode after this is clicked. Place Order will still need to be clicked to confirm that the protection is removed, alongside any other changes that might be made to the position.


Updated on: 14/07/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!