Database

[database] configures the SQLite databases used to record backtest results and store historical prices locally. A strategy can declare only one [database] block.

Example

[database]
backtest_export_enabled = true
objective_limit         = 60

This example enables SQLite export for backtest results and keeps up to 60 backtests for each objective.

Block parameters

ParameterDescription
backtest_export_enabled
 Boolean
 Optional
Enables or disables exporting backtest results to a SQLite database.
Default value: false
objective_limit
 Integer
 Optional
Defines the maximum number of backtests to keep for each objective.
Default value: 50
database_directory
 Text
 Optional
Specifies the absolute path to the directory where the SQLite file will be stored. The application will create the directory if it does not exist. If this key is not provided, a directory named after the TOML file (without its extension) is created inside the results_directory.
Default value: "<results_directory>/<TOML file name without extension>"
database_file_name
 Text
 Optional
Sets the name of the results database file. If this key is omitted, the file is named after the TOML file name without its extension, followed by a timestamp, and then the .db extension.
Default value: <file_name_without_extension>_YYYY-MM-DD_HH-MM-SS.db
market_data_cache_enabled
 Boolean
 Optional
Enables or disables the cache database used to store historical market data. When this option is disabled, no database is created on disk and data is kept in memory for the current run.
Default value: true
market_data_cache_directory
 Text
 Optional
Specifies the absolute path to the folder containing the cache.db database for market data. This key is ignored when market_data_cache_enabled is false.
Default value: %LOCALAPPDATA%\\Almageste\\Whale‑E on Windows, or $XDG_DATA_HOME/almageste/whale-e on Linux.
include_all_grid_parameters
 Boolean
 Optional
Persist all grid parameters to SQLite, even when they do not vary. When false, only varying grid parameters are stored.
Default value: false
include_all_hyperparameters
 Boolean
 Optional
Persist all hyperparameters to SQLite, even when they do not vary. When false, only varying hyperparameters are stored.
Default value: false
include_trades
 Boolean
 Optional
Includes the structured trade rows in the SQLite export.
Default value: false
include_block_usage
 Boolean
 Optional
Includes block execution counters in the SQLite export.
Default value: false
include_strategy_toml
 Boolean
 Optional
Stores the source strategy TOML in the export metadata.
Default value: false