====== Generator (gen.js) ====== The Generator script **gen.js** serves to: * generate new strategy collections for selected data and settings * re-calculate previously generated collections against updated data or updated parameters * validate collections against Acceptance Criteria and Monte Carlo settings * optimize strategies with the built-in optimizer Generator settings are defined in ''./bin/gen.settings.ini'' and can be overridden by user settings files and command options. You can pass one or several user settings files with ''--settings''. When several files are provided, each next file overrides values from the previous one. CLI options have highest priority. If you are new to ExGen workflows, start with [[quick-start|Quick Start]] and use this page as the detailed reference. ===== Main workflows ===== * New generation from market data * Validation of existing collections * Validation, then generation (combined run) * Generation with optimizer and Monte Carlo validation Recommended sequence for new users: * fetch or refresh data with [[fetch-js|Fetcher (fetch.js)]] * run generation for one market and period * validate existing collections after data refresh ===== Quick start ===== ==== Generate new strategies ==== Command: express-generator> node ./bin/gen.js --server MetaQuotes --symbol EURUSD --period M15 ==== Validate an existing collection ==== Command: express-generator> node ./bin/gen.js --input ./collections/Coll_MetaQuotes_EURUSD_M15.json --server MetaQuotes --symbol EURUSD --period M15 ==== Validate, then continue generating ==== Command: express-generator> node ./bin/gen.js --input ./collections/MetaQuotes --input-match EURUSD M15 --validate-then-generate true ===== Output review (example) ===== The following sample output can be used as a visual review of a successful generation run. Output: ..:: Express Generator v2.xx ::.. Market : MetaQuotes EURUSD M15 From : 2022-02-11 13:00, To: 2026-02-20 21:30, Bars: 100000 Spread : 10, Swap long: -0.7, Swap short: -1, Commission: 6 USD Account: 10000 USD, Leverage: 100, Entry: 0.01 lots 10459 ┤ ╭──╮ Net profit 410.54 USD 10417 ┤ ╭╯ ╰── Profit per day 0.28 USD 10375 ┤ ╭─╯ Profit factor 1.73 10333 ┤ ╭─╯ Max drawdown 73.29 USD 10290 ┤ ╭──╯ Max drawdown 0.73 % 10248 ┤ ╭╮ ╭─────╯ Return/drawdown 5.60 10206 ┤ ╭─╯╰─╯ Win / loss 0.61 10164 ┤ ╭───╯ Max stagnation 256 days 10122 ┤ ╭────╯ Max stagnation 17.41 % 10080 ┤ │ R - squared 87.03 10037 ┤ ╭╯ Max cons losses 4 9995 ┼╮╭──╯ Count of trades 171 9953 ┤╰╯ Avrg pos length 579 bars - Ascended: 400, Calculated: 17949, Time: 03:00 of 03:00, Coll: 100 Generator Ready! Count of strategies: 100 Collection exported: collections/Coll_MetaQuotes_EURUSD_M15.json ===== Settings topics ===== See the dedicated pages for each ''gen.settings.ini'' section: * [[data-source|Data source]] * [[output-collection|Output collection]] * [[input-collection|Input collection]] * [[collection|Collection]] * [[generator-stop|Generator stop]] * [[acceptance-criteria|Acceptance criteria]] * [[account-settings|Account settings]] * [[strategy-properties|Strategy properties]] * [[backtester|Backtester]] * [[data-horizon|Data horizon]] * [[forward-testing|Forward testing]] * [[out-of-sample|Out of sample]] * [[trading-session|Trading session]] * [[symbol-info|Symbol info overrides]] * [[miscellaneous|Miscellaneous]] * [[indicators|Indicators]] * [[indicators-options|Indicator options]] * [[auto-save|Auto-save]] * [[optimizer|Optimizer]] * [[monte-carlo|Monte Carlo]] * [[settings-files|Settings files]]