forex software

Create and Test Forex Strategies

forex software

express-generator:mm-js

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
express-generator:mm-js [2026/02/22 09:56] – [Parameters] Miroslav Popovexpress-generator:mm-js [2026/05/29 10:23] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Multi-Market (mm.js) ====== ====== Multi-Market (mm.js) ======
  
-The Multi-Market script (mm.js) validates a collection against another markets.+The Multi-Market script **mm.js** revalidates a collection of strategies across multiple markets
 +It combines two core capabilities: 
 + 
 +  * data fetching from the Fetcher workflow 
 +  * strategy validation from the Generator validator workflow 
 + 
 +If you are new to ExGen workflows, begin with [[quick-start|Quick Start]] before configuring Multi-Market runs. 
 + 
 +===== How it works ===== 
 + 
 +Multi-Market runs this pipeline: 
 + 
 +  * loads settings from ''./bin/mm.settings.ini'' plus optional user settings and CLI overrides 
 +  * resolves test markets from ''test_servers'', ''test_periods'', ''test_symbols'', and ''count_of_tests'' 
 +  * fetches required data files for each test market 
 +  * validates each input strategy on each test market 
 +  * counts passed tests per strategy and exports only those that meet ''min_passed_tests'' 
 + 
 +===== Requirements ===== 
 + 
 +  * Input collection must be provided via ''input''
 +  * Symbol info files must exist for all test servers in ''./res/<server>.json''
 +  * ''min_passed_tests'' must be less than or equal to ''count_of_tests''
 +  * Both ''count_of_tests'' and ''min_passed_tests'' must be 1 or greater. 
 +  * You can prepare symbol info with Fetcher, for example: ''node ./bin/fetch.js --symbol-info true --server Premium''.
  
 ===== Quick start ===== ===== Quick start =====
  
-Validate a collection against 8 markets and export the strategies that pass 5 of 8 tests.+Validate a collection against 8 test markets and export strategies that pass at least 5 tests.
  
 Command: Command:
  
     express-generator> node ./bin/mm.js --server Premium --symbol EURUSD --period M30 --test-symbols auto --test-period M30 --test-server Premium --count-of-tests 8 --min-passed-tests 5     express-generator> node ./bin/mm.js --server Premium --symbol EURUSD --period M30 --test-symbols auto --test-period M30 --test-server Premium --count-of-tests 8 --min-passed-tests 5
 +
 +
 +Run with a custom settings file and CLI override:
 +
 +    express-generator> node ./bin/mm.js --settings mm.ini --symbol GBPUSD
  
  
 Output fetch: Output fetch:
  
-        ..:: Express Generator Multi Market v2.70 ::..+<code text> 
 +..:: Express Generator Multi Market v2.xx ::..
  
     Fetched: Premium Data EURUSD M30, From: 2018-02-13 20:30, To: 2026-02-20 22:00, Bars: 100000     Fetched: Premium Data EURUSD M30, From: 2018-02-13 20:30, To: 2026-02-20 22:00, Bars: 100000
Line 24: Line 54:
     Fetched: Premium Data EURCHF M30, From: 2018-02-13 07:30, To: 2026-02-20 22:00, Bars: 100000     Fetched: Premium Data EURCHF M30, From: 2018-02-13 07:30, To: 2026-02-20 22:00, Bars: 100000
     Fetched: Premium Data EURJPY M30, From: 2018-02-13 14:30, To: 2026-02-20 22:00, Bars: 100000     Fetched: Premium Data EURJPY M30, From: 2018-02-13 14:30, To: 2026-02-20 22:00, Bars: 100000
 +</code>
  
 Output validation: Output validation:
  
 +<code text>
     ...     ...
     Market : Premium Data NZDUSD M30     Market : Premium Data NZDUSD M30
Line 32: Line 64:
     Spread : 10, Swap long: -4.16, Swap short: -4.16, Commission: 6 USD     Spread : 10, Swap long: -4.16, Swap short: -4.16, Commission: 6 USD
     Account: 10000 USD, Leverage: 100, Entry: 0.01 lots     Account: 10000 USD, Leverage: 100, Entry: 0.01 lots
-     + 
-     - Passed: 12, Calculated: 100 of 100  +     - Passed: 12, Calculated: 100 of 100 
-    +
     Market : Premium Data EURGBP M30     Market : Premium Data EURGBP M30
     From   : 2018-02-13 17:00, To: 2026-02-20 22:00, Bars: 100000     From   : 2018-02-13 17:00, To: 2026-02-20 22:00, Bars: 100000
Line 40: Line 72:
     Account: 10000 USD, Leverage: 100, Entry: 0.01 lots     Account: 10000 USD, Leverage: 100, Entry: 0.01 lots
     ...     ...
 +</code>
  
 Output stats and collection: Output stats and collection:
  
-    Multi-Market validator ready! +<code text> 
-     +Multi-Market validator ready!
-    34 of 100 strategies passed  1 of 8 tests +
-    43 of 100 strategies passed  2 of 8 tests +
-    15 of 100 strategies passed  3 of 8 tests +
-      3 of 100 strategies passed  4 of 8 tests +
-      5 of 100 strategies passed  5 of 8 tests +
-     +
-    Count of strategies: 5 +
-    Collection exported: collections/Coll_Premium_Data_EURUSD_M30_MM.json+
  
-===== Settings Files ===== +34 of 100 strategies passed  1 of 8 tests 
- +43 of 100 strategies passed  2 of 8 tests 
-The Multi-Market script **./bin/mm.js** uses a default settings file **./bin/mm.settings.ini**. You can use it as a reference of all the available parameters. +15 of 100 strategies passed  3 of 8 tests 
- + 3 of 100 strategies passed of 8 tests 
-**mm.js** always loads the default settings file. Then we specify the parameters with custom settings files or CLI parameter. + of 100 strategies passed  5 of 8 tests
- +
-Here we load custom settings file ''mm.in'' and then override some of the parameters: +
- +
-    node ./bin/mm.js --settings mm.ini --symbol GBPUSD +
- +
-We can give several settings files. The later overrides the previous one. +
- +
-    node ./bin/mm.js --settings mm.ini gbpusd.ini +
- +
- +
-===== Parameters ===== +
- +
-The Multi-Market needs several groups of parameters: +
- +
- +
-==== Input Data set ==== +
- +
-<code ini> +
-; These perameters serve to resoleve the input collection placeholders +
- +
-; Server: Premium, Eightcap, BlackBull, Darwinex, MetaQuotes +
-server = Premium +
- +
-; The symbol of the original strategy +
-symbol = EURUSD +
- +
-; Timeframe to download and use. +
-; Available values: M1 M5 M15 M30 H1 H4 D1 +
-period = M30+
  
 +Count of strategies: 5
 +Collection exported: collections/Coll_Premium_Data_EURUSD_M30_MM.json
 </code> </code>
  
 +===== Settings and priority =====
  
-==== Input collection  ====+Multi-Market reads settings in this order (lowest to highest priority):
  
-<code ini> +  * default settings file: ''./bin/mm.settings.ini'' 
-; Points to one or more collections, or to a collection directory, for validation+  * user settings file(s): ''--settings my-mm.ini'' (or multiple files) 
-; Possible placeholders[SERVER], [SYMBOL], [PERIOD], [YEAR], [MONTH], [DAY] +  * CLI optionsfor example ''--count-of-tests 8''
-input = Coll_[SERVER]_[SYMBOL]_[PERIOD].json+
  
-; Filters the input collections by given text phrases. +Settings keys can be in snake casecamel caseor pascal case.
-; Useful when the "input" directory contains many collections. +
-; Possible placeholders: [SERVER][SYMBOL][PERIOD], [YEAR], [MONTH], [DAY] +
-input_match = +
-</code>+
  
-==== Data parameters  ====+When several files are passed with ''--settings'', each next file overrides keys from the previous one.
  
-<code ini> +Common aliases are accepted:
-; These parameters affect the initial data set and the fetched data+
  
-; Time zone offset in hours. UTC = 0 +  * ''settings'' and ''setting'' 
-time_zone = 0+  * ''test_servers'' and ''test_server'' 
 +  * ''test_periods'' and ''test_period'' 
 +  * ''test_symbols'' and ''test_symbol''
  
-; Cut data to maximum bars. 
-; Set it to 0 to load all available bars 
-max_data_bars = 100000 
  
-; This option is helpful to prevent frequent downloads of data files. +===== Settings topics =====
-; It accepts time in *minutes*, where 0 means the option is off. +
-; Example: if_missing_or_older_than 60 +
-;   It downloads a new data file if the current file is missing or was not updated in the last 60 minutes. +
-if_missing_or_older_than +
-</code>+
  
-==== Test data ====+Dedicated Multi-Market pages:
  
-<code ini> +  * [[mm-initial-data|Initial data set]] 
-; One or several servers to load and test +  * [[mm-fetch-parameters|Fetch parameters]] 
-; Valid server names: Premium, Eightcap, BlackBull, Darwinex, MetaQuotes +  * [[mm-test-markets|Test markets]] 
-test_servers = Premium+  * [[mm-tests|Multi-Market tests]]
  
-; One or several periods to load and test +Shared settings pages used by Multi-Market:
-; Valid period namesM1, M5, M15, M30, H1, H4, D1 +
-test_periods = M15+
  
-; The symbols to download and use for the MM validation. +  * [[input-collection|Input collection]] 
-; Example: test_symbols = EURUSD USDCHF GBPUSD USDJPY +  * [[output-collection|Output collection]] 
-; Use "auto" to allow the program to select the symbols automatically. +  * [[data-horizon|Data horizon]] 
-test_symbols = auto +  * [[out-of-sample|Out of sample]] 
-</code>+  * [[trading-session|Trading session]] 
 +  * [[account-settings|Account settings]] 
 +  * [[backtester|Backtester]] 
 +  * [[acceptance-criteria|Acceptance criteria]] 
 +  * [[miscellaneous|Miscellaneous]] 
 +  * [[settings-files|Settings files]]
  
-==== Multi-Market tests ==== 
  
-<code ini> +===== Related scripts =====
-; The count of the Multi Market tests to perform. +
-count_of_tests 5+
  
-; The minimum count of the passed tests. +  * [[fetch-js|Fetcher (fetch.js)]] 
-; A test is considered as "passed" if it passed the Acceptance Criteria. +  [[gen-js|Generator (gen.js)]]
-; Must be less than or equal to "count_of_tests"+
-min_passed_tests = 3 +
-</code> +
- +
- +
-==== Output collection ==== +
- +
-<code ini> +
-; Output collection filename for a newly generated or validated collection. +
-; Possible placeholders: [SERVER], [SYMBOL], [PERIOD], [YEAR], [MONTH], [DAY], [COUNT], [PROFIT] +
-; Placeholders can be used as directory names too. +
-; Example: output = ./collections/[SERVER]/[SYMBOL]/[PERIOD]/collection.json +
-output = Coll_[SERVER]_[SYMBOL]_[PERIOD]_MM.json +
- +
-; When "false", adds a suffix if the collection file already exists. +
-; When "true", it overwrites the file. +
-output_replace = false +
-</code> +
- +
-==== Account settings ==== +
- +
-<code ini> +
-account_currency = USD +
-initial_account  = 10000 +
-leverage         = 100 +
-</code> +
- +
- +
-==== Trading Session ==== +
- +
-<code ini> +
-session_open  = 00:00 +
-session_close = 24:00 +
-friday_close  = 24:00 +
- +
-trade_on_sunday = true +
- +
-close_at_session_close = false +
-close_at_friday_close  = false +
-</code> +
- +
- +
-==== Backtester ==== +
- +
-<code ini> +
-close_at_backtest_end = true +
-</code> +
- +
- +
-==== Acceptance criteria ==== +
- +
-<code ini> +
-; Set 0 to ignore a criterion (except "min_profit"). +
-max_average_pos_length = 0 +
-max_consecutive_losses = 0 +
-max_drawdown_percent   = 0 +
-max_equity_drawdown    = 0 +
-max_stagnation_days    = 0 +
-max_stagnation_percent = 0 +
-min_average_pos_length = 0 +
-min_count_of_trades    = 100 +
-min_profit             = 0 +
-min_profit_factor      = 0 +
-min_profit_per_day     = 0 +
-min_r_squared          = 0 +
-min_return_to_drawdown = 0 +
-min_win_loss_ratio     = 0 +
-min_m1_profit          = 0 +
-min_m1_profit_factor   = 0 +
-min_m1_count_of_trades = 0 +
-min_m3_profit          = 0 +
-min_m3_profit_factor   = 0 +
-min_m3_count_of_trades = 0 +
-min_y1_profit          = 0 +
-min_y1_profit_factor   = 0 +
-min_y1_count_of_trades = 0 +
-</code> +
- +
- +
-==== Miscellaneous ==== +
- +
-<code ini> +
-; Prevent showing output in the console (except errors) +
-; This option is useful if you run mm.js from another script in the background. +
-silent = false +
-</code>+