Table of Contents

Forward Testing

Forward Testing validates strategies on unseen data after the main in-sample calculations.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Forward testing          ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Validate strategies on new unseen data.
use_forward_testing = false

; Number of bars loaded before the forward-test segment.
; 0 keeps the default behavior.
preload_data_bars   = 0

What it controls

How the forward segment is chosen

When forward testing is enabled, backtesting starts from each strategy's update time. In practical terms, bars before that point are not used for trade entries in the forward-test run.

If preload_data_bars is greater than 0, Generator loads extra history before the start point so indicators have context. Values above 0 are treated with a minimum preload of 300 bars.

Typical usage

Enable forward testing with a preload window:

use_forward_testing = true
preload_data_bars   = 500

Run from command line:

node ./bin/gen.js --use-forward-testing true --preload-data-bars 500

Notes