From 05184ea82e2a456158573bd907c56568d8767da8 Mon Sep 17 00:00:00 2001 From: Rob Carver Date: Tue, 5 Mar 2024 08:43:00 +0000 Subject: [PATCH] commit --- sysinit/futures/check_instrument_lists.py | 18 +++++++++++++++++- systems/provided/rob_system/run_system.py | 8 ++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/sysinit/futures/check_instrument_lists.py b/sysinit/futures/check_instrument_lists.py index e1811f2ee7..ea7bb88542 100644 --- a/sysinit/futures/check_instrument_lists.py +++ b/sysinit/futures/check_instrument_lists.py @@ -7,6 +7,7 @@ from syscore.interactive.progress_bar import progressBar from sysproduction.data.prices import diagPrices from sysproduction.data.instruments import diagInstruments +from systems.provided.rob_system.run_system import futures_system ## replace with your own diag_prices = diagPrices() @@ -63,4 +64,19 @@ def check_for_zero_commission(): if commission==0: zero_warnings.append(instrument_code) - return zero_warnings \ No newline at end of file + return zero_warnings + +def print_missing_and_no_trade_markets(): + system =futures_system() + all_instruments =system.data.get_instrument_list() + duplicates = system.get_list_of_duplicate_instruments_to_remove() + ignored = system.get_list_of_ignored_instruments_to_remove() + all_instruments_without_duplicates = [instrument_code for instrument_code in all_instruments if instrument_code not in duplicates and instrument_code not in ignored] + + configured_in_system = list(system.config.instrument_weights.keys()) ## not all will be traded + + missing= [instrument_code for instrument_code in all_instruments_without_duplicates if instrument_code not in configured_in_system] + missing.sort() + + print("Missing: %s" % missing) + print("No trade: %s" % system.get_list_of_markets_with_trading_restrictions()) diff --git a/systems/provided/rob_system/run_system.py b/systems/provided/rob_system/run_system.py index 7382d25f33..5a28faa65a 100644 --- a/systems/provided/rob_system/run_system.py +++ b/systems/provided/rob_system/run_system.py @@ -27,13 +27,17 @@ def futures_system( - sim_data=arg_not_supplied, config_filename="systems.provided.rob_system.config.yaml" + sim_data=arg_not_supplied, config_filename="systems.provided.rob_system.config.yaml", + rules = arg_not_supplied ): if sim_data is arg_not_supplied: sim_data = dbFuturesSimData() config = Config(config_filename) + if rules is arg_not_supplied: + rules = Rules() + system = System( [ Risk(), @@ -44,7 +48,7 @@ def futures_system( myFuturesRawData(), ForecastCombine(), volAttenForecastScaleCap(), - Rules(), + rules, ], sim_data, config,