From 76f2224794bb0c2d75399d87c2e116437b274b9b Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:18:36 +0000 Subject: [PATCH 01/21] spelling --- docs/backtesting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/backtesting.md b/docs/backtesting.md index 33ea650053..0c5de5bd5d 100644 --- a/docs/backtesting.md +++ b/docs/backtesting.md @@ -1718,7 +1718,7 @@ system.cache.get_cache_refs_for_instrument("EDOLLAR") ## if we change the config system.config.forecast_div_multiplier=100.0 -## ... then the result will be different without neeting to create a new system +## ... then the result will be different without needing to create a new system system.combForecast.get_combined_forecast("EDOLLAR") ``` From 610679b6bc749ae0e4aea9ba5bee54047dc77404 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:18:47 +0000 Subject: [PATCH 02/21] grammar --- docs/IB.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/IB.md b/docs/IB.md index 9134056e29..c5eb6f630d 100644 --- a/docs/IB.md +++ b/docs/IB.md @@ -297,7 +297,7 @@ You can use this directly if you are familiar with ib_insync eg `conn.ib.positio ### Make multiple connections -It's possible to have multiple connections to the IB Gateway, each from it's own process, but each connection must have a unique clientid. Used clientid's are stored in a the active database (usually mongoDB) to ensure we don't re-use active clientids. +It's possible to have multiple connections to the IB Gateway, each from its own process, but each connection must have a unique clientid. Used clientids are stored in the active database (usually mongoDB) to ensure we don't re-use active clientids. From 2795965acc4eae6b265078496bc906d458894c3e Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:19:06 +0000 Subject: [PATCH 03/21] fix shadow cost default --- docs/production_strategy_changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/production_strategy_changes.md b/docs/production_strategy_changes.md index 6007d1fe2d..5a5f1d1ad1 100644 --- a/docs/production_strategy_changes.md +++ b/docs/production_strategy_changes.md @@ -188,7 +188,7 @@ Under ignore_instruments in the .yaml configuration, I suggest you include only ### Set shadow cost -The shadow cost is a key variable which is set in the private_config.yaml file (*not* the backtest configuration file, since it is used 'outside' the backtest in the strategy order generation). The default value is 10, but you may want to initially begin with a very large value (eg 500) and gradually reduce it over the first few days. This will produce a more gradual adjustment from old to new strategy positions, although bear in mind that any strategy position with the wrong sign will immediately be closed regardless of the shadow_cost value unless you set this instrument to don't trade. +The shadow cost is a key variable which is set in the private_config.yaml file (*not* the backtest configuration file, since it is used 'outside' the backtest in the strategy order generation). The default value is 50, but you may want to initially begin with a very large value (eg 500) and gradually reduce it over the first few days. This will produce a more gradual adjustment from old to new strategy positions, although bear in mind that any strategy position with the wrong sign will immediately be closed regardless of the shadow_cost value unless you set this instrument to don't trade. ### Strategy backtest output of optimal positions From 1d4aceb645dbef7c76aeb082be6ad591ba1a87b2 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:19:17 +0000 Subject: [PATCH 04/21] spelling --- syscore/pandas/pdutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syscore/pandas/pdutils.py b/syscore/pandas/pdutils.py index 272af80866..6d1599e4f0 100755 --- a/syscore/pandas/pdutils.py +++ b/syscore/pandas/pdutils.py @@ -294,7 +294,7 @@ def make_df_from_list_of_named_tuple( field_name_for_index: str = arg_not_supplied, ): """ - Turn a list of named tuplies into a dataframe + Turn a list of named tuples into a dataframe The first element in the tuple will become the index >>> T = namedtuple('T', 'name value_a value_b') From 90d78ff12415bdaae68af26248936fa7b23e6eff Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:19:27 +0000 Subject: [PATCH 05/21] spelling --- sysexecution/algos/common_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysexecution/algos/common_functions.py b/sysexecution/algos/common_functions.py index 0ac8f7ff71..0d23d004a2 100644 --- a/sysexecution/algos/common_functions.py +++ b/sysexecution/algos/common_functions.py @@ -37,7 +37,7 @@ def cancel_order( data_broker = dataBroker(data) data_broker.cancel_order_given_control_object(broker_order_with_controls) - # Wait for cancel. It's vitual we do this since if a fill comes in before we finish it will screw + # Wait for cancel. It's vital we do this since if a fill comes in before we finish it will screw # everything up... timer = quickTimer(seconds=CANCEL_WAIT_TIME) not_cancelled = True From 3b5c02e21785da4c545532472f861125613a3c27 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:19:39 +0000 Subject: [PATCH 06/21] spelling --- sysexecution/stack_handler/cancel_and_modify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysexecution/stack_handler/cancel_and_modify.py b/sysexecution/stack_handler/cancel_and_modify.py index 733c08cb49..942e529c71 100644 --- a/sysexecution/stack_handler/cancel_and_modify.py +++ b/sysexecution/stack_handler/cancel_and_modify.py @@ -105,7 +105,7 @@ def list_of_orders_not_yet_cancelled( if order_is_cancelled: new_list_of_orders.remove(broker_order) self.log.debug( - "Order %s succesfully cancelled" % broker_order, + "Order %s successfully cancelled" % broker_order, **broker_order.log_attributes(), method="temp", ) From ab1b80684a13f2021210874630aa2f4266a6cb7d Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:19:50 +0000 Subject: [PATCH 07/21] spelling --- sysexecution/stack_handler/checks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysexecution/stack_handler/checks.py b/sysexecution/stack_handler/checks.py index ae3cafeefe..c76fc76d7a 100644 --- a/sysexecution/stack_handler/checks.py +++ b/sysexecution/stack_handler/checks.py @@ -45,7 +45,7 @@ def log_and_lock_position_break(self, contract: futuresContract): instrument_code = contract.instrument_code data_locks = dataLocks(self.data) if data_locks.is_instrument_locked(instrument_code): - # alread locked + # already locked return None else: self.log.critical("Break for %s: locking instrument" % (str(contract))) From faec617733706dbfe960d1acf961b8132978fa0c Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:20:42 +0000 Subject: [PATCH 08/21] inherite -> inherit --- sysobjects/production/optimal_positions.py | 2 +- sysquant/estimators/generic_estimator.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sysobjects/production/optimal_positions.py b/sysobjects/production/optimal_positions.py index 9dae45f819..35306e06eb 100644 --- a/sysobjects/production/optimal_positions.py +++ b/sysobjects/production/optimal_positions.py @@ -236,7 +236,7 @@ def _check_append_positions_okay( ) -## IMPORTANT NOTE: if you create a new kind of optimal position which does not inherite from +## IMPORTANT NOTE: if you create a new kind of optimal position which does not inherit from ## baseOptimalPosition directly, need to manually add it here MASTER_LIST_OF_OPTIMAL_POSITION_CLASSES = baseOptimalPosition.__subclasses__() diff --git a/sysquant/estimators/generic_estimator.py b/sysquant/estimators/generic_estimator.py index 489f78a5d7..4b30889d56 100644 --- a/sysquant/estimators/generic_estimator.py +++ b/sysquant/estimators/generic_estimator.py @@ -88,7 +88,7 @@ def get_estimate_for_fitperiod(self, fit_period: fitDates) -> Estimate: return estimate def get_estimate_for_fitperiod_with_data(self, fit_period: fitDates) -> Estimate: - raise NotImplementedError("Have to inherite from base class") + raise NotImplementedError("Have to inherit from base class") class genericEstimator(object): From 7d126a265b3c4717e314eee076fc20ab9e6d0b61 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:21:09 +0000 Subject: [PATCH 09/21] augemented -> augmented --- sysexecution/orders/broker_orders.py | 2 +- sysproduction/data/orders.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sysexecution/orders/broker_orders.py b/sysexecution/orders/broker_orders.py index efe3b6ff24..a50e92d76e 100644 --- a/sysexecution/orders/broker_orders.py +++ b/sysexecution/orders/broker_orders.py @@ -416,7 +416,7 @@ def create_new_broker_order_from_contract_order( ## Not very pretty but only used for diagnostic TCA class brokerOrderWithParentInformation(brokerOrder): @classmethod - def create_augemented_order( + def create_augmented_order( self, order: brokerOrder, instrument_order: instrumentOrder, diff --git a/sysproduction/data/orders.py b/sysproduction/data/orders.py index d7eb4cc95e..3725e67292 100644 --- a/sysproduction/data/orders.py +++ b/sysproduction/data/orders.py @@ -189,7 +189,7 @@ def get_historic_broker_order_from_order_id_with_execution_data( self.get_parent_instrument_order_for_historic_broker_order_id(order_id) ) - augmented_order = brokerOrderWithParentInformation.create_augemented_order( + augmented_order = brokerOrderWithParentInformation.create_augmented_order( order, contract_order=contract_order, instrument_order=instrument_order ) From 2776cb6ab36952cdc4e3ae73eb0a470553fa2777 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:25:00 +0000 Subject: [PATCH 10/21] overriden -> overridden --- docs/instruments.md | 4 ++-- docs/production.md | 18 +++++++++--------- .../IB/ib_futures_contract_price_data.py | 2 +- syscontrol/run_process.py | 2 +- .../arctic_futures_per_contract_prices.py | 2 +- sysdata/base_data.py | 4 ++-- sysdata/config/configdata.py | 2 +- sysdata/csv/csv_futures_contract_prices.py | 2 +- sysdata/mongodb/mongo_historic_orders.py | 4 ++-- .../parquet_futures_per_contract_prices.py | 2 +- sysdata/sim/sim_data.py | 4 ++-- sysexecution/algos/allocate_algo_to_order.py | 4 ++-- .../order_stacks/broker_order_stack.py | 2 +- .../order_stacks/contract_order_stack.py | 2 +- sysexecution/order_stacks/order_stack.py | 10 +++++----- sysobjects/production/tradeable_object.py | 4 ++-- .../reporting/adhoc/dynamic_optimisation.py | 2 +- .../vol_attenuation_forecast_scale_cap.py | 2 +- systems/trading_rules.py | 2 +- 19 files changed, 37 insertions(+), 37 deletions(-) diff --git a/docs/instruments.md b/docs/instruments.md index 882b1a4701..7ebdc4bdbd 100644 --- a/docs/instruments.md +++ b/docs/instruments.md @@ -348,9 +348,9 @@ Operating in the production environment is a bit more complex, due to the intera ## A note about configuration -When you're running in simulation things are relatively simple; configuration items are defined in defaults_yaml, but can be overriden by your private_config.yaml, and then also by your own backtest.yaml file. +When you're running in simulation things are relatively simple; configuration items are defined in defaults_yaml, but can be overridden by your private_config.yaml, and then also by your own backtest.yaml file. -Importantly, once we're out of the 'backtesting'' part of a production system, we can't see the backtest configuration (which after all is system specific, whereas generally in the production environment we're working with global parameters). So the priority order is `defaults.yaml`, overriden by `private_config.yaml`. The downstream code that produces strategy orders once the production backtest has generated optimal positions, and then trades those orders, will operate only on the configuration in `private_config.yaml` and `defaults.yaml`. +Importantly, once we're out of the 'backtesting'' part of a production system, we can't see the backtest configuration (which after all is system specific, whereas generally in the production environment we're working with global parameters). So the priority order is `defaults.yaml`, overridden by `private_config.yaml`. The downstream code that produces strategy orders once the production backtest has generated optimal positions, and then trades those orders, will operate only on the configuration in `private_config.yaml` and `defaults.yaml`. ## Reduce only and other constraints in static systems diff --git a/docs/production.md b/docs/production.md index 12c7e28197..019bdf6e1b 100644 --- a/docs/production.md +++ b/docs/production.md @@ -1719,7 +1719,7 @@ Linux script: Called by: `run_systems` -The code to run each strategies backtest is defined in the configuration parameter in the control_config.yaml file (or overriden in the private_control_config.yaml file): `process_configuration_methods/run_systems/strategy_name/`. For example: +The code to run each strategies backtest is defined in the configuration parameter in the control_config.yaml file (or overridden in the private_control_config.yaml file): `process_configuration_methods/run_systems/strategy_name/`. For example: ``` process_configuration_methods: @@ -1763,7 +1763,7 @@ Linux script: Called by: `run_strategy_order_generator` -The code to run each strategy's backtest is defined in the configuration parameter in the control_config.yaml file (or overriden in the private_control_config.yaml file): `process_configuration_methods/run_systems/strategy_name/`. For example: +The code to run each strategy's backtest is defined in the configuration parameter in the control_config.yaml file (or overridden in the private_control_config.yaml file): `process_configuration_methods/run_systems/strategy_name/`. For example: ``` @@ -2596,7 +2596,7 @@ Useful things to note about the crontab: #### Process configuration -Process configuration is governed by the following config parameters (in [/syscontrol/control_config.yaml](/syscontrol/control_config.yaml), or these will be overriden by /private/private_control_config.yaml): +Process configuration is governed by the following config parameters (in [/syscontrol/control_config.yaml](/syscontrol/control_config.yaml), or these will be overridden by /private/private_control_config.yaml): - `process_configuration_start_time`: when the process starts (default 00:01) - `process_configuration_stop_time`: when the process ends, regardless of any method configuration (default 23:50) @@ -2825,7 +2825,7 @@ The following are configuration options that are not in defaults.yaml and *may* - `email_server`: this is the outgoing server -The following are configuration options that are in defaults.yaml and can be overriden in private_config.yaml: +The following are configuration options that are in defaults.yaml and can be overridden in private_config.yaml: [Backup paths](#data-backup) - `backtest_store_directory` parent directory, backtests are stored under strategy_name subdirectory @@ -2864,7 +2864,7 @@ Outside of the backtest code, in production configuration options are pulled in ### Control config files -As discussed above, these are used purely for control and monitoring purposes in [/syscontrol/control_config.yaml](/syscontrol/control_config.yaml), overriden by /private/private_control_config.yaml). +As discussed above, these are used purely for control and monitoring purposes in [/syscontrol/control_config.yaml](/syscontrol/control_config.yaml), overridden by /private/private_control_config.yaml). ### Broker and data source specific configuration files @@ -2942,7 +2942,7 @@ You can also change other values in the interactive tool, but be careful and mak ## Strategies -Each strategy is defined in the config parameter `strategy_list`, found either in the defaults.yaml file or overriden in private yaml configuration. The following shows the parameters for an example strategy, named (appropriately enough) `example`. +Each strategy is defined in the config parameter `strategy_list`, found either in the defaults.yaml file or overridden in private yaml configuration. The following shows the parameters for an example strategy, named (appropriately enough) `example`. ``` strategy_list: @@ -2956,7 +2956,7 @@ strategy_list: ### Strategy capital -Strategy capital is allocated from [total capital](#capital). This is done by the scripted function, [update strategy capital](#allocate-capital-to-strategies). It is controlled by the configuration element below (in the defaults.yaml file, or overriden in private_config.yaml). +Strategy capital is allocated from [total capital](#capital). This is done by the scripted function, [update strategy capital](#allocate-capital-to-strategies). It is controlled by the configuration element below (in the defaults.yaml file, or overridden in private_config.yaml). ``` strategy_capital_allocation: @@ -2970,7 +2970,7 @@ The allocation calls the function specified, with any other parameters passed as #### Risk target -The actual risk a strategy will take depends on both it's capital and it's risk target. The risk target is set in the configuration option, `percentage_vol_target`, in the backtest configuration .yaml file for the relevant strategy (if not supplied, the defaults.yaml value is used; this is *not* overriden by private_config.yaml). Risk targets can be different across strategies. +The actual risk a strategy will take depends on both it's capital and it's risk target. The risk target is set in the configuration option, `percentage_vol_target`, in the backtest configuration .yaml file for the relevant strategy (if not supplied, the defaults.yaml value is used; this is *not* overridden by private_config.yaml). Risk targets can be different across strategies. #### Changing risk targets and/or capital @@ -3693,7 +3693,7 @@ V2X [20201118, 20201216] 2020-10-15 09:43:30 (1, -1) The strategy report is bespoke to a strategy; it will load the last backtest file generated and report diagnostics from it. On a daily basis it runs for all strategies. On an ad hoc basis, it can be run for all or a single strategy. -The strategy reporting is determined by the parameter `strategy_list/strategy_name/reporting_code/function` in default.yaml or overriden in the private config .yaml file. The 'classic' reporting function is `sysproduction.strategy_code.report_system_classic.report_system_classic` +The strategy reporting is determined by the parameter `strategy_list/strategy_name/reporting_code/function` in default.yaml or overridden in the private config .yaml file. The 'classic' reporting function is `sysproduction.strategy_code.report_system_classic.report_system_classic` Here is an example, with annotations added in quotes (""): diff --git a/sysbrokers/IB/ib_futures_contract_price_data.py b/sysbrokers/IB/ib_futures_contract_price_data.py index 82cc1c376c..7289a6c410 100644 --- a/sysbrokers/IB/ib_futures_contract_price_data.py +++ b/sysbrokers/IB/ib_futures_contract_price_data.py @@ -94,7 +94,7 @@ def has_merged_price_data_for_contract( """ Does IB have data for a given contract? - Overriden because we will have a problem matching expiry dates to nominal yyyymm dates + Overridden because we will have a problem matching expiry dates to nominal yyyymm dates :param contract_object: :return: bool """ diff --git a/syscontrol/run_process.py b/syscontrol/run_process.py index 0f6a46cfb0..9c1270638f 100644 --- a/syscontrol/run_process.py +++ b/syscontrol/run_process.py @@ -2,7 +2,7 @@ General class for 'running' processes We kick them all off in the crontab at a specific time (midnight is easiest), but their subsequent behaviour will - depend on various rules, as defined in ... attribute of defaults.yaml or overriden in private_config + depend on various rules, as defined in ... attribute of defaults.yaml or overridden in private_config - is my process marked as NO OPEN in process control (check database) - is it too early for me to run? (defined in .yaml) diff --git a/sysdata/arctic/arctic_futures_per_contract_prices.py b/sysdata/arctic/arctic_futures_per_contract_prices.py index ad64fea8e0..bcda327f8c 100644 --- a/sysdata/arctic/arctic_futures_per_contract_prices.py +++ b/sysdata/arctic/arctic_futures_per_contract_prices.py @@ -72,7 +72,7 @@ def _write_merged_prices_for_contract_object_no_checking( ): """ Write prices - CHECK prices are overriden on second write + CHECK prices are overridden on second write :param futures_contract_object: futuresContract :param futures_price_data: futuresContractPriceData diff --git a/sysdata/base_data.py b/sysdata/base_data.py index eb29b343ea..26884f837e 100644 --- a/sysdata/base_data.py +++ b/sysdata/base_data.py @@ -51,7 +51,7 @@ def __getitem__(self, keyname): """ raise Exception( - "__getitem__ not defined for baseData class: use a class where it has been overriden" + "__getitem__ not defined for baseData class: use a class where it has been overridden" ) def keys(self): @@ -66,7 +66,7 @@ def keys(self): """ raise Exception( - "keys() not defined for baseData class: use a class where it has been overriden" + "keys() not defined for baseData class: use a class where it has been overridden" ) diff --git a/sysdata/config/configdata.py b/sysdata/config/configdata.py index 48cefb0a59..bdf202388a 100644 --- a/sysdata/config/configdata.py +++ b/sysdata/config/configdata.py @@ -74,7 +74,7 @@ def __init__( """ - # this will normally be overriden by the base system + # this will normally be overridden by the base system self.log = get_logger( "config", {TYPE_LOG_LABEL: "config", STAGE_LOG_LABEL: "config"} ) diff --git a/sysdata/csv/csv_futures_contract_prices.py b/sysdata/csv/csv_futures_contract_prices.py index d243d088dd..e1b9f8fcba 100644 --- a/sysdata/csv/csv_futures_contract_prices.py +++ b/sysdata/csv/csv_futures_contract_prices.py @@ -114,7 +114,7 @@ def _write_merged_prices_for_contract_object_no_checking( ): """ Write prices - CHECK prices are overriden on second write + CHECK prices are overridden on second write :param futures_contract_object: futuresContract :param futures_price_data: futuresContractPriceData diff --git a/sysdata/mongodb/mongo_historic_orders.py b/sysdata/mongodb/mongo_historic_orders.py index 8c823ac033..406aa2cd76 100644 --- a/sysdata/mongodb/mongo_historic_orders.py +++ b/sysdata/mongodb/mongo_historic_orders.py @@ -61,7 +61,7 @@ def __repr__(self): return "%s (%s)" % (self._name, str(self.mongo_data)) def add_order_to_data(self, order: Order, ignore_duplication: bool = False): - # Duplicates will be overriden, so be careful + # Duplicates will be overridden, so be careful order_id = order.order_id no_existing_order = self.get_order_with_orderid(order_id) is missing_order if no_existing_order: @@ -76,7 +76,7 @@ def add_order_to_data(self, order: Order, ignore_duplication: bool = False): ) def _add_order_to_data_no_checking(self, order: Order): - # Duplicates will be overriden, so be careful + # Duplicates will be overridden, so be careful mongo_record = order.as_dict() self.mongo_data.add_data(order.order_id, mongo_record, allow_overwrite=True) diff --git a/sysdata/parquet/parquet_futures_per_contract_prices.py b/sysdata/parquet/parquet_futures_per_contract_prices.py index 580574c226..852ea2da16 100644 --- a/sysdata/parquet/parquet_futures_per_contract_prices.py +++ b/sysdata/parquet/parquet_futures_per_contract_prices.py @@ -67,7 +67,7 @@ def _write_merged_prices_for_contract_object_no_checking( ): """ Write prices - CHECK prices are overriden on second write + CHECK prices are overridden on second write :param futures_contract_object: futuresContract :param futures_price_data: futuresContractPriceData diff --git a/sysdata/sim/sim_data.py b/sysdata/sim/sim_data.py index 7763ccc016..fa06c3a91e 100644 --- a/sysdata/sim/sim_data.py +++ b/sysdata/sim/sim_data.py @@ -174,7 +174,7 @@ def get_raw_price(self, instrument_code: str) -> pd.Series: """ Default method to get instrument price at 'natural' frequency - Will usually be overriden when inherited with specific data source + Will usually be overridden when inherited with specific data source :param instrument_code: instrument to get prices for :type instrument_code: str @@ -194,7 +194,7 @@ def get_raw_price_from_start_date( """ Default method to get instrument price at 'natural' frequency - Will usually be overriden when inherited with specific data source + Will usually be overridden when inherited with specific data source :param instrument_code: instrument to get prices for :type instrument_code: str diff --git a/sysexecution/algos/allocate_algo_to_order.py b/sysexecution/algos/allocate_algo_to_order.py index 83981b7ec7..22b37e2b62 100644 --- a/sysexecution/algos/allocate_algo_to_order.py +++ b/sysexecution/algos/allocate_algo_to_order.py @@ -92,7 +92,7 @@ def check_and_if_required_allocate_algo_to_single_contract_order( # not used yet, but maybe in the future is_roll_order = instrument_order.roll_order - if algo_allocation_is_overriden_for_instrument( + if algo_allocation_is_overridden_for_instrument( contract_order=contract_order, config=config ): contract_order = allocate_algo_for_specific_instrument_with_override( @@ -143,7 +143,7 @@ def already_has_algo_allocated(contract_order: contractOrder) -> bool: return contract_order.algo_to_use != "" -def algo_allocation_is_overriden_for_instrument( +def algo_allocation_is_overridden_for_instrument( contract_order: contractOrder, config: AlgoConfig ) -> bool: instrument_code = contract_order.instrument_code diff --git a/sysexecution/order_stacks/broker_order_stack.py b/sysexecution/order_stacks/broker_order_stack.py index 52a4de8925..c3d6eb2c0d 100644 --- a/sysexecution/order_stacks/broker_order_stack.py +++ b/sysexecution/order_stacks/broker_order_stack.py @@ -31,7 +31,7 @@ def find_order_with_broker_tempid(self, broker_tempid: str): return missing_order def get_order_with_id_from_stack(self, order_id: int) -> brokerOrder: - # probably will be overriden in data implementation + # probably will be overridden in data implementation # only here so the appropriate type is shown as being returned order = self.stack.get(order_id, missing_order) diff --git a/sysexecution/order_stacks/contract_order_stack.py b/sysexecution/order_stacks/contract_order_stack.py index 276e44c1ed..d5b7c91e96 100644 --- a/sysexecution/order_stacks/contract_order_stack.py +++ b/sysexecution/order_stacks/contract_order_stack.py @@ -74,7 +74,7 @@ def release_order_from_algo_control(self, order_id: int): raise Exception(error_msg) def get_order_with_id_from_stack(self, order_id: int) -> contractOrder: - # probably will be overriden in data implementation + # probably will be overridden in data implementation # only here so the appropriate type is shown as being returned order = self.stack.get(order_id, missing_order) diff --git a/sysexecution/order_stacks/order_stack.py b/sysexecution/order_stacks/order_stack.py index 4e39ffc342..e2c95987fe 100644 --- a/sysexecution/order_stacks/order_stack.py +++ b/sysexecution/order_stacks/order_stack.py @@ -526,29 +526,29 @@ def _delete_entire_stack_without_checking_only_use_when_debugging(self): # LOW LEVEL OPERATIONS to include in specific implementation def _get_list_of_all_order_ids(self) -> list: - # probably will be overriden in data implementation + # probably will be overridden in data implementation raise NotImplementedError # deleting def _remove_order_with_id_from_stack_no_checking(self, order_id: int): - # probably will be overriden in data implementation + # probably will be overridden in data implementation raise NotImplementedError def _change_order_on_stack_no_checking(self, order_id: int, order: Order): # - # probably will be overriden in data implementation + # probably will be overridden in data implementation raise NotImplementedError def get_order_with_id_from_stack(self, order_id: int) -> Order: - # probably will be overriden in data implementation + # probably will be overridden in data implementation # return missing_order if not found raise NotImplementedError def _put_order_on_stack_no_checking(self, order: Order): - # probably will be overriden in data implementation + # probably will be overridden in data implementation raise NotImplementedError diff --git a/sysobjects/production/tradeable_object.py b/sysobjects/production/tradeable_object.py index 62f30f6b33..00c02a35bf 100644 --- a/sysobjects/production/tradeable_object.py +++ b/sysobjects/production/tradeable_object.py @@ -11,7 +11,7 @@ class tradeableObject(object): """ def __init__(self, object_name): - # probably overriden with nicer entry + # probably overridden with nicer entry self._key = object_name def __repr__(self): @@ -26,7 +26,7 @@ def __eq__(self, other): @property def key(self): - # probably overriden + # probably overridden return self._key diff --git a/sysproduction/reporting/adhoc/dynamic_optimisation.py b/sysproduction/reporting/adhoc/dynamic_optimisation.py index bf76dbfa1a..95f6f59e70 100644 --- a/sysproduction/reporting/adhoc/dynamic_optimisation.py +++ b/sysproduction/reporting/adhoc/dynamic_optimisation.py @@ -35,7 +35,7 @@ def get_notional_risk_target(): - ## might be overriden by strategy but we don't have the backtest .yaml here + ## might be overridden by strategy but we don't have the backtest .yaml here return 25.0 diff --git a/systems/provided/attenuate_vol/vol_attenuation_forecast_scale_cap.py b/systems/provided/attenuate_vol/vol_attenuation_forecast_scale_cap.py index f0343c8cf3..3f0c22ccb8 100644 --- a/systems/provided/attenuate_vol/vol_attenuation_forecast_scale_cap.py +++ b/systems/provided/attenuate_vol/vol_attenuation_forecast_scale_cap.py @@ -36,7 +36,7 @@ def get_raw_forecast_before_attenuation(self, instrument_code, rule_variation_na @diagnostic() def get_raw_forecast(self, instrument_code, rule_variation_name): - ## overriden method this will be called downstream so don't change name + ## overridden method this will be called downstream so don't change name raw_forecast_before_atten = self.get_raw_forecast_before_attenuation( instrument_code, rule_variation_name ) diff --git a/systems/trading_rules.py b/systems/trading_rules.py index f920ab6be2..1f36280b94 100644 --- a/systems/trading_rules.py +++ b/systems/trading_rules.py @@ -120,7 +120,7 @@ def _get_data_from_system(self, system: "System", instrument_code: str): """ # Following is a list of additional kwargs to pass to the data functions. Can be empty dicts - # Use copy as can be overriden + # Use copy as can be overridden list_of_data_str_references = self.data list_of_args_to_pass_to_data_calls = copy(self.data_args) From f4bac42f0548e9905adcbbe0ccd5a2a96a391552 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:25:35 +0000 Subject: [PATCH 11/21] spelling --- systems/tests/test_mp_optimise_over_time.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systems/tests/test_mp_optimise_over_time.py b/systems/tests/test_mp_optimise_over_time.py index 21d099e974..74a782685a 100644 --- a/systems/tests/test_mp_optimise_over_time.py +++ b/systems/tests/test_mp_optimise_over_time.py @@ -28,7 +28,7 @@ def test_pickling(self): # pickle net_returns_pkl_s = pkl.dumps(self.net_returns) - # unplickle + # unpickle net_returns = pkl.loads(net_returns_pkl_s) # attributes after unpicking From e6476474ea049e94e50aa963550adc21fc3196d6 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:26:09 +0000 Subject: [PATCH 12/21] grammar --- docs/production.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/production.md b/docs/production.md index 019bdf6e1b..2b0af24bb2 100644 --- a/docs/production.md +++ b/docs/production.md @@ -1719,7 +1719,7 @@ Linux script: Called by: `run_systems` -The code to run each strategies backtest is defined in the configuration parameter in the control_config.yaml file (or overridden in the private_control_config.yaml file): `process_configuration_methods/run_systems/strategy_name/`. For example: +The code to run each strategy's backtest is defined in the configuration parameter in the control_config.yaml file (or overridden in the private_control_config.yaml file): `process_configuration_methods/run_systems/strategy_name/`. For example: ``` process_configuration_methods: From c27f49fc54fe5a53cb8c61d7ee9b178f02de8a35 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:28:09 +0000 Subject: [PATCH 13/21] raise Exception, not str --- systems/forecast_combine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systems/forecast_combine.py b/systems/forecast_combine.py index 6c49094ae6..407da9f67e 100755 --- a/systems/forecast_combine.py +++ b/systems/forecast_combine.py @@ -1492,7 +1492,7 @@ def _get_fixed_fdm_scalar_value_from_config( ) else: log.critical(error_msg, instrument_code=instrument_code) - raise (error_msg) + raise Exception(error_msg) return fixed_div_mult From 64d5f0b26cef24f7d75d08862175546da1b54f0c Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:30:59 +0000 Subject: [PATCH 14/21] Can only see emails now, not logs or errors --- syslogdiag/email_via_db_interface.py | 2 +- sysproduction/interactive_diagnostics.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/syslogdiag/email_via_db_interface.py b/syslogdiag/email_via_db_interface.py index ebeea5625e..0c6155e557 100644 --- a/syslogdiag/email_via_db_interface.py +++ b/syslogdiag/email_via_db_interface.py @@ -110,7 +110,7 @@ def check_if_sent_in_last_day(last_time_email_sent: datetime.datetime): def send_warning_email(data, subject): - body = "To reduce email load, won't send any more emails with this subject today. Use 'interactive_diagnostics', 'logs, emails, and errors' to see stored messages" + body = "To reduce email load, won't send any more emails with this subject today. Use 'interactive_diagnostics', 'Emails' to see stored messages" send_email_and_record_date_or_store_on_fail(data, body, subject) diff --git a/sysproduction/interactive_diagnostics.py b/sysproduction/interactive_diagnostics.py index 0aec5b4502..d1e688352c 100644 --- a/sysproduction/interactive_diagnostics.py +++ b/sysproduction/interactive_diagnostics.py @@ -81,7 +81,7 @@ def interactive_diagnostics(): top_level_menu_of_options = { 0: "backtest objects", 1: "View instrument configuration", - 2: "logs, emails, and errors", + 2: "Emails", 3: "View prices", 4: "View capital", 5: "View positions & orders", From e2a8119eb9a1f2c00b116f8d5c231774288c5426 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:48:00 +0000 Subject: [PATCH 15/21] fix menu ID for broker orders --- sysproduction/interactive_order_stack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysproduction/interactive_order_stack.py b/sysproduction/interactive_order_stack.py index aeebab448a..e9d0cf0440 100644 --- a/sysproduction/interactive_order_stack.py +++ b/sysproduction/interactive_order_stack.py @@ -429,7 +429,7 @@ def create_manual_trade(data): ) print( - "For instant execution, you may want to do menu [1] create orders, menu [13] create broker orders" + "For instant execution, you may want to do menu [1] create orders, menu [12] create broker orders" ) return None From d0f3f8c81fb5a0a90753c197b5ebc1b8be690295 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:48:39 +0000 Subject: [PATCH 16/21] ago -> algo --- sysexecution/order_stacks/contract_order_stack.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sysexecution/order_stacks/contract_order_stack.py b/sysexecution/order_stacks/contract_order_stack.py index d5b7c91e96..db18eb5576 100644 --- a/sysexecution/order_stacks/contract_order_stack.py +++ b/sysexecution/order_stacks/contract_order_stack.py @@ -24,7 +24,9 @@ def add_controlling_algo_ref(self, order_id: int, control_algo_ref: str): existing_order = self.get_order_with_id_from_stack(order_id) if existing_order is missing_order: - error_msg = "Can't add controlling ago as order %d doesn't exist" % order_id + error_msg = ( + "Can't add controlling algo as order %d doesn't exist" % order_id + ) self.log.warning(error_msg) raise missingOrder(error_msg) @@ -48,7 +50,9 @@ def add_controlling_algo_ref(self, order_id: int, control_algo_ref: str): def release_order_from_algo_control(self, order_id: int): existing_order = self.get_order_with_id_from_stack(order_id) if existing_order is missing_order: - error_msg = "Can't add controlling ago as order %d doesn't exist" % order_id + error_msg = ( + "Can't add controlling algo as order %d doesn't exist" % order_id + ) self.log.warning(error_msg) raise missingOrder(error_msg) From bb1eb5f29b6cc7cc7a2740f8ba9bbd5190e1371c Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 09:49:50 +0000 Subject: [PATCH 17/21] missing ) --- sysproduction/interactive_order_stack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysproduction/interactive_order_stack.py b/sysproduction/interactive_order_stack.py index e9d0cf0440..281228830e 100644 --- a/sysproduction/interactive_order_stack.py +++ b/sysproduction/interactive_order_stack.py @@ -212,7 +212,7 @@ def create_balance_trade(data): def get_broker_order_details_for_balance_trade(data: dataBlob) -> brokerOrder: ans = true_if_answer_is_yes( - "Auto close an existing position (if not, manually enter details?" + "Auto close an existing position (if not, manually enter details)?" ) if ans: ( From 1d247c417d8ab24b33be92bee7a3a4fd05e3ec86 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 10:15:00 +0000 Subject: [PATCH 18/21] type not constructor --- sysdata/production/capital.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdata/production/capital.py b/sysdata/production/capital.py index facb8f996d..7cb974b063 100644 --- a/sysdata/production/capital.py +++ b/sysdata/production/capital.py @@ -309,7 +309,7 @@ def get_total_capital(self) -> pd.Series: def get_current_accumulated_pandl(self) -> float: return self.capital_data.get_current_pandl_account() - def get_profit_and_loss_account(self) -> pd.Series(): + def get_profit_and_loss_account(self) -> pd.Series: return self.capital_data.get_profit_and_loss_account_pd_series() def get_maximum_account(self) -> pd.Series: From ab64288c9bc5af9217b20e84b0027d8f52bed958 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 10:15:38 +0000 Subject: [PATCH 19/21] black --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0c49a280fe..0820d53cbc 100755 --- a/setup.py +++ b/setup.py @@ -98,7 +98,7 @@ def dir_this_file(): "statsmodels==0.14.0", "PyPDF2>=2.5.0", "pyarrow>=14.0.1", - "scikit-learn>1.3.0" + "scikit-learn>1.3.0", ], tests_require=["nose", "flake8"], extras_require=dict(), From 08506bcaf95a78a063b0e94d7d7be124e0f83460 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 10:17:27 +0000 Subject: [PATCH 20/21] print branch name in job --- .github/workflows/slow-test-develop.yml | 2 +- .github/workflows/slow-test-master.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/slow-test-develop.yml b/.github/workflows/slow-test-develop.yml index 9d1ea46dd3..55b45fa9d9 100644 --- a/.github/workflows/slow-test-develop.yml +++ b/.github/workflows/slow-test-develop.yml @@ -1,4 +1,4 @@ -name: Slow test +name: Slow test (develop) on: schedule: diff --git a/.github/workflows/slow-test-master.yml b/.github/workflows/slow-test-master.yml index db0ee9e0db..8b2b2d6dbb 100644 --- a/.github/workflows/slow-test-master.yml +++ b/.github/workflows/slow-test-master.yml @@ -1,4 +1,4 @@ -name: Slow test +name: Slow test (master) on: schedule: From bec93c5f5f96d8d230b2670263337be3106039f4 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Wed, 17 Jan 2024 11:17:43 +0000 Subject: [PATCH 21/21] remove unused method _resolve_names_and_add() --- sysdata/data_blob.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sysdata/data_blob.py b/sysdata/data_blob.py index d54f348fb8..22e9068768 100644 --- a/sysdata/data_blob.py +++ b/sysdata/data_blob.py @@ -237,10 +237,6 @@ def _get_specific_logger(self, class_object): return log - def _resolve_names_and_add(self, resolved_instance, new_name: str): - attr_name = self._get_new_name(class_name) - self._add_new_class_with_new_name(resolved_instance, attr_name) - def _get_new_name(self, class_name: str, use_prefix: str = arg_not_supplied) -> str: split_up_name = camel_case_split(class_name) attr_name = identifying_name(