====== Multi-Market (mm.js) ====== The Multi-Market script (mm.js) validates a collection against another markets. ===== Quick start ===== Validate a collection against 8 markets and export the strategies that pass 5 of 8 tests. 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 Output fetch: ..:: Express Generator Multi Market v2.70 ::.. Fetched: Premium Data EURUSD M30, From: 2018-02-13 20:30, To: 2026-02-20 22:00, Bars: 100000 Fetched: Premium Data GBPUSD M30, From: 2018-02-13 07:00, To: 2026-02-20 22:00, Bars: 100000 Fetched: Premium Data AUDUSD M30, From: 2018-02-13 17:00, To: 2026-02-20 22:00, Bars: 100000 Fetched: Premium Data NZDUSD M30, From: 2018-02-13 07:00, To: 2026-02-20 22:00, Bars: 100000 Fetched: Premium Data EURGBP M30, From: 2018-02-13 17:00, To: 2026-02-20 22:00, Bars: 100000 Fetched: Premium Data EURAUD M30, From: 2018-02-13 08:00, 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 Output validation: ... Market : Premium Data NZDUSD M30 From : 2018-02-13 07:00, To: 2026-02-20 22:00, Bars: 100000 Spread : 10, Swap long: -4.16, Swap short: -4.16, Commission: 6 USD Account: 10000 USD, Leverage: 100, Entry: 0.01 lots - Passed: 12, Calculated: 100 of 100 Market : Premium Data EURGBP M30 From : 2018-02-13 17:00, To: 2026-02-20 22:00, Bars: 100000 Spread : 10, Swap long: -15.22, Swap short: 5.52, Commission: 6 USD Account: 10000 USD, Leverage: 100, Entry: 0.01 lots ... Output stats and collection: 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 ===== 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. **mm.js** always loads the default settings file. Then we specify the parameters with custom settings files or CLI parameter. 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 ==== ; 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 ==== Input collection ==== ; Points to one or more collections, or to a collection directory, for validation. ; Possible placeholders: [SERVER], [SYMBOL], [PERIOD], [YEAR], [MONTH], [DAY] input = Coll_[SERVER]_[SYMBOL]_[PERIOD].json ; Filters the input collections by given text phrases. ; Useful when the "input" directory contains many collections. ; Possible placeholders: [SERVER], [SYMBOL], [PERIOD], [YEAR], [MONTH], [DAY] input_match = ==== Data parameters ==== ; These parameters affect the initial data set and the fetched data ; Time zone offset in hours. UTC = 0 time_zone = 0 ; 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. ; 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 = 0 ==== Test data ==== ; One or several servers to load and test ; Valid server names: Premium, Eightcap, BlackBull, Darwinex, MetaQuotes test_servers = Premium ; One or several periods to load and test ; Valid period names: M1, M5, M15, M30, H1, H4, D1 test_periods = M15 ; The symbols to download and use for the MM validation. ; Example: test_symbols = EURUSD USDCHF GBPUSD USDJPY ; Use "auto" to allow the program to select the symbols automatically. test_symbols = auto ==== Multi-Market tests ==== ; The count of the Multi Market tests to perform. count_of_tests = 5 ; The minimum count of the passed tests. ; A test is considered as "passed" if it passed the Acceptance Criteria. ; Must be less than or equal to "count_of_tests". min_passed_tests = 3 ==== Output collection ==== ; 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 ==== Account settings ==== account_currency = USD initial_account = 10000 leverage = 100 ==== Trading Session ==== 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 ==== Backtester ==== close_at_backtest_end = true ==== Acceptance criteria ==== ; 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 ==== Miscellaneous ==== ; 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