Backtests

From NakedMarkets
Revision as of 03:07, 29 March 2022 by NMWikiWeb (talk | contribs) (→‎Automatic processing)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Summary

NakedMarkets is aimed to allow the users to simulate the Financial Markets behavior and trade them in the same way. By creating a new backtest you define a new environment with associated Market Symbols.
The Backtests are designed by a specific file format, .bkt files, which can be shared between users with all the relevant properties.

Backtest Creation

To create a new Backtest, you only need to click on the dedicated button "New Button" and follow the process :

  • Choose the Backtest name and the deposit amount :
CreateBacktestStep1.png


















  • Choose the Market Symbols and the starting date :
CreateBacktestStep2.png


















  • Choose the Timezone and the options :
CreateBacktestStep3.png



















The selected Timezone will allow you to choose the candle close timing, depending on your prefered Timezone.
The Timezone display changes the Timezone type of display (GMT, UTC, PST, ...).
The session Timezones are just suggestions for the most popular Timezones, depending on the Markets (London session, NY session, ...).
The Forward test only option can be activated to forbid the user to go back to the history during the backtesting software. This could prevent the modification of past orders and will force the user to trade just like in real Financial Markets.
The Use real spread option tells the software to use the real spread of the Symbols, the spread calculated from tick data. This is the most accurate data format and we strongly advise you to let it activated if you want to simulate the Markets in a realistic manner. If this options is deactivated, then the spread value defined for the Symbols in the Datacenter will be used.

Backtest Processing

Processing the Backtest is the heart of Naked Markets.
By simulating the Markets behavior in the past, the user can move the time forward and place orders when the conditions are met.
There are different ways to efficiently move the time forward in order to gain experience and assess trading strategies.

Steps management

First, it's possible to decide which step you want to use to move the time. This is the goal of the Step toolbox of the Backtest toolbar.
Here, the selected Timeframe will be used to determine the next Backtest date, from the current Backtest date.
The Step toolbox includes all the default and custom Timeframes to decide the forward or backward step :

StepToolbox.png











Manual processing

If the user decides to manually process the Backtest, he can press the Forward button, each time he wants to move the time forward.
This can be done by using the single-step Forward hotkey, as well.

Here is an example where we use a step of 1 day for a D1 chart, then change the step to 1 hour and moving the time forward manually, one step at a time :

SingleStepBacktesting.gif



























Automatic processing

Single-stepping can be very time consuming to find a good setup on the Markets.
The user can move the time forward automatically with the automatic processing toolbox to save time.

Here is the same example where we use the automatic processing :

AutomaticStepBacktesting resized.gif























We strongly advise the user to attach Setup Rules to charts in order to automatically move the time forward and pause when the user-defined conditions are met.
Thus, it allows to save a lot of time and focus and the setup quality instead of printing each candle one step at a time.

Here is an example, where a Setup Rule is created to pause the Backtest when the price reaches a Support/Resistance and this Setup Rule is attached to the chart :

BacktestSetupRuleExample.gif










































Backtest Export

It's possible to export a Backtest file by using the File menu and click on "Save Backtest as...".
This file is independent and can be imported in any version of NakedMarkets software. All the following properties are saved when exporting the Backtest :

  • The selected Market Symbols
  • The account history and opened/pending orders
  • The opened charts and the associated resources (rules, graphical objects, indicators, ...)


Backtest Import

It's possible to import a Backtest file by using the File menu and click on "Open Backtest...".
NakedMarkets will check the following steps during the import process :

  • Check if the Backtest loaded Symbols are locally installed and suggest to install them automatically otherwise
  • Check if the local installed Symbols (and rates) are up-to-date and update them otherwise
  • Load all the underlying resources (Charts, rules, graphical objects, orders, ...)


Backtest logs

The Backtest logs window displays all the opened, triggered, canceled orders and the potential errors relating to them (ie: not enough margin).
It allows the user to check the order history and the reasons why an order has not been triggered, as an example.
It can be opened by clicking on the Tools menu of the main interface.

BacktestLogs.png