From 4dce8475f4c35c57a9ae2f72946114ee851c5f86 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:41:50 +0100 Subject: [PATCH 01/28] ags -> args --- sysproduction/data/risk.py | 2 +- systems/forecast_scale_cap.py | 2 +- systems/rawdata.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sysproduction/data/risk.py b/sysproduction/data/risk.py index 759ba3bd61..7b5fc578a1 100644 --- a/sysproduction/data/risk.py +++ b/sysproduction/data/risk.py @@ -182,7 +182,7 @@ def get_daily_ts_stdev_of_prices(data, instrument_code): # volconfig contains 'func' and some other arguments # we turn func which could be a string into a function, and then - # call it with the other ags + # call it with the other args volfunction = resolve_function(volconfig.pop("func")) vol = volfunction(dailyreturns, **volconfig) diff --git a/systems/forecast_scale_cap.py b/systems/forecast_scale_cap.py index 872cc059d3..1848ca6b93 100644 --- a/systems/forecast_scale_cap.py +++ b/systems/forecast_scale_cap.py @@ -259,7 +259,7 @@ def _get_forecast_scalar_estimated_from_instrument_code( # The config contains 'func' and some other arguments # we turn func which could be a string into a function, and then - # call it with the other ags + # call it with the other args cs_forecasts = self._get_cross_sectional_forecasts_for_instrument( instrument_code, rule_variation_name diff --git a/systems/rawdata.py b/systems/rawdata.py index bb7992dc2a..ef0421d1d0 100644 --- a/systems/rawdata.py +++ b/systems/rawdata.py @@ -208,7 +208,7 @@ def daily_returns_volatility(self, instrument_code: str) -> pd.Series: # volconfig contains 'func' and some other arguments # we turn func which could be a string into a function, and then - # call it with the other ags + # call it with the other args vol_multiplier = volconfig.pop("multiplier_to_get_daily_vol") volfunction = resolve_function(volconfig.pop("func")) From 64fd6f27c7b74619bbe184c017fa507c2cc43ec9 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:42:12 +0100 Subject: [PATCH 02/28] spelling --- systems/provided/dynamic_small_system_optimise/greedy_algo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systems/provided/dynamic_small_system_optimise/greedy_algo.py b/systems/provided/dynamic_small_system_optimise/greedy_algo.py index 54fda05aca..018c6cf4ed 100644 --- a/systems/provided/dynamic_small_system_optimise/greedy_algo.py +++ b/systems/provided/dynamic_small_system_optimise/greedy_algo.py @@ -25,7 +25,7 @@ def greedy_algo_across_integer_values( ) if new_best_value < best_value: - # reached a new optimium + # reached a new optimum best_value = new_best_value best_solution = new_solution else: From 6b053a187d55d0cc66790abc042795957cb6f925 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:42:33 +0100 Subject: [PATCH 03/28] fix float format, long lines --- .../provided/dynamic_small_system_optimise/optimisation.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/systems/provided/dynamic_small_system_optimise/optimisation.py b/systems/provided/dynamic_small_system_optimise/optimisation.py index f3de876b82..fb145bd736 100644 --- a/systems/provided/dynamic_small_system_optimise/optimisation.py +++ b/systems/provided/dynamic_small_system_optimise/optimisation.py @@ -127,13 +127,14 @@ def is_tracking_error_of_prior_smaller_than_buffer(self) -> bool: if tracking_error_smaller_than_buffer: self.log.debug( - "Tracking error of current positions vs unrounded optimal is %.4f smaller than buffer %4.f, no trades needed" + "Tracking error of current positions vs unrounded optimal is %.4f " + "smaller than buffer %.4f, no trades needed" % (tracking_error, tracking_error_buffer) ) else: self.log.debug( - "Tracking error of current positions vs unrounded optimal is %.4f larger than buffer %.4f" - % (tracking_error, tracking_error_buffer) + "Tracking error of current positions vs unrounded optimal is %.4f " + "larger than buffer %.4f" % (tracking_error, tracking_error_buffer) ) return tracking_error_smaller_than_buffer From 98e2ffbac4738283044cfca5027810378f5187a8 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:43:06 +0100 Subject: [PATCH 04/28] grammar, punctuation --- systems/accounts/account_instruments.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/systems/accounts/account_instruments.py b/systems/accounts/account_instruments.py index c0f24bda27..f7c4714882 100644 --- a/systems/accounts/account_instruments.py +++ b/systems/accounts/account_instruments.py @@ -13,7 +13,7 @@ class accountInstruments(accountCosts, accountBufferingSystemLevel): - # dont' cache: just a switch method + # don't cache: just a switch method @dont_cache def pandl_for_instrument( self, instrument_code: str, delayfill: bool = True, roundpositions: bool = True @@ -184,7 +184,8 @@ def _pandl_for_instrument_with_cash_costs( ) -> accountCurve: if not roundpositions: self.log.warning( - "Using roundpositions=False with cash costs may lead to inaccurate costs (fixed costs, eg commissions will be overstated!!!" + "Using roundpositions=False with cash costs may lead to inaccurate " + "costs (fixed costs, eg commissions will be overstated!!!)" ) raw_costs = self.get_raw_cost_data(instrument_code) From 1e3970b81da123fb89115cd52f47e31107f5fa98 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:43:23 +0100 Subject: [PATCH 05/28] spelling --- sysquant/estimators/pooled_correlation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysquant/estimators/pooled_correlation.py b/sysquant/estimators/pooled_correlation.py index 2a93ca51c8..f065afa698 100644 --- a/sysquant/estimators/pooled_correlation.py +++ b/sysquant/estimators/pooled_correlation.py @@ -23,7 +23,7 @@ def pooled_correlation_estimator( ## Will need to keep this to adjust lookbacks length_adjustment = len(downsampled_data) - ## We do this to ensure same frequency throughout once concatendate + ## We do this to ensure same frequency throughout once concatenated data_at_common_frequency = downsampled_data.reindex_to_common_index() # Make into one giant dataframe From ba4c50644e812c14226bba3a31ba7ae15d0cfd09 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:43:37 +0100 Subject: [PATCH 06/28] spelling --- sysquant/estimators/correlations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sysquant/estimators/correlations.py b/sysquant/estimators/correlations.py index 3a3d7244a8..f20f7d911a 100644 --- a/sysquant/estimators/correlations.py +++ b/sysquant/estimators/correlations.py @@ -196,10 +196,10 @@ def without_missing_data(self): def quantize(self, quant_factor=0.2): as_pd = self.as_pd() - multipier = 1 / quant_factor - multiplied_pd = as_pd * multipier + multiplier = 1 / quant_factor + multiplied_pd = as_pd * multiplier multiplied_pd_rounded = multiplied_pd.round() - pd_quantized = multiplied_pd_rounded / multipier + pd_quantized = multiplied_pd_rounded / multiplier return correlationEstimate( values=pd_quantized.values, columns=pd_quantized.columns From d32a093a1dc1dbac390b10799ce3ef40c1bb3b26 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:44:12 +0100 Subject: [PATCH 07/28] remove space at line start --- sysproduction/update_total_capital.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysproduction/update_total_capital.py b/sysproduction/update_total_capital.py index 709d5a8e08..de324a2a03 100644 --- a/sysproduction/update_total_capital.py +++ b/sysproduction/update_total_capital.py @@ -50,7 +50,7 @@ def update_margin(self): margin_data.add_total_margin_entry(margin_in_base_currency) margin_series = margin_data.get_series_of_total_margin() - log.debug("Recent margin\n %s" % str(margin_series.tail(10))) + log.debug("Recent margin\n%s" % str(margin_series.tail(10))) def update_capital(self): data = self.data From 7ab2239d2a66119d36861d901f82ca0a4abe97f0 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:44:30 +0100 Subject: [PATCH 08/28] punctuation --- sysproduction/interactive_update_roll_status.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sysproduction/interactive_update_roll_status.py b/sysproduction/interactive_update_roll_status.py index bf9f568858..62a6f15ec5 100644 --- a/sysproduction/interactive_update_roll_status.py +++ b/sysproduction/interactive_update_roll_status.py @@ -566,7 +566,8 @@ def manually_update_roll_state_for_code( ) if roll_state_suggested == ASK_FOR_STATE: print( - "No specific state suggested: recommend one of Force, Force_Outright or Close)" + "No specific state suggested: recommend one of Force, " + "Force_Outright or Close" ) default_state = roll_data.original_roll_status.name else: From d585dd2277c93ea2696a5c42393b9e0fbeafe1ce Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:44:42 +0100 Subject: [PATCH 09/28] spelling --- sysinit/futures/seed_price_data_from_IB.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysinit/futures/seed_price_data_from_IB.py b/sysinit/futures/seed_price_data_from_IB.py index 04091844c4..b916d30d3d 100644 --- a/sysinit/futures/seed_price_data_from_IB.py +++ b/sysinit/futures/seed_price_data_from_IB.py @@ -21,7 +21,7 @@ def seed_price_data_from_IB(instrument_code): ## This returns yyyymmdd strings, where we have the actual expiry date for contract_date in list_of_contracts: - ## We do this slightly tortorous thing because there are energy contracts + ## We do this slightly tortuous thing because there are energy contracts ## which don't expire in the month they are labelled with ## So for example, CRUDE_W 202106 actually expires on 20210528 From b616ee41dad7406e2bd8c016068f7376764d4ea3 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:45:05 +0100 Subject: [PATCH 10/28] fix bad import --- sysinit/futures/barchart_futures_contract_prices.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sysinit/futures/barchart_futures_contract_prices.py b/sysinit/futures/barchart_futures_contract_prices.py index 1d7486d5f3..6b7a22bcd4 100644 --- a/sysinit/futures/barchart_futures_contract_prices.py +++ b/sysinit/futures/barchart_futures_contract_prices.py @@ -7,7 +7,7 @@ from syscore.dateutils import month_from_contract_letter from sysinit.futures.contract_prices_from_csv_to_arctic import ( - init_arctic_with_csv_futures_contract_prices, + init_db_with_csv_futures_contract_prices, ) @@ -100,9 +100,7 @@ def strip_file_names(pathname): def transfer_barchart_prices_to_arctic(datapath): strip_file_names(datapath) - init_arctic_with_csv_futures_contract_prices( - datapath, csv_config=barchart_csv_config - ) + init_db_with_csv_futures_contract_prices(datapath, csv_config=barchart_csv_config) if __name__ == "__main__": From 7b65718fdd09532ae334afd53d2faed0f3945221 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:45:21 +0100 Subject: [PATCH 11/28] remove copy pasted content --- sysexecution/algos/algo_limit_orders.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/sysexecution/algos/algo_limit_orders.py b/sysexecution/algos/algo_limit_orders.py index 9a5ba081ca..e396e1b718 100644 --- a/sysexecution/algos/algo_limit_orders.py +++ b/sysexecution/algos/algo_limit_orders.py @@ -1,20 +1,5 @@ -""" -Simplest possible execution method, one market order -""" -from copy import copy -from sysexecution.orders.named_order_objects import missing_order -from sysproduction.data.broker import dataBroker - from sysexecution.algos.algo import Algo, limit_price_from_input, limit_order_type -from sysexecution.algos.common_functions import ( - post_trade_processing, - MESSAGING_FREQUENCY, - cancel_order, -) -from sysdata.data_blob import dataBlob -from sysexecution.orders.contract_orders import contractOrder from sysexecution.order_stacks.broker_order_stack import orderWithControls -from sysexecution.orders.broker_orders import market_order_type class algoLimit(Algo): From 433fb81d4fca5b8a0d1e30524032e2964686fa5b Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:45:39 +0100 Subject: [PATCH 12/28] spelling --- sysdata/sim/sim_data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdata/sim/sim_data.py b/sysdata/sim/sim_data.py index fa06c3a91e..743a396298 100644 --- a/sysdata/sim/sim_data.py +++ b/sysdata/sim/sim_data.py @@ -270,7 +270,7 @@ def _get_fx_data(self, currency1: str, currency2: str) -> fxPrices: Get the FX rate currency1/currency2 between two currencies Or return None if not available - (Normally we'd over ride this with a specific source) + (Normally we'd override this with a specific source) """ @@ -287,7 +287,7 @@ def _get_fx_data_from_start_date( Get the FX rate currency1/currency2 between two currencies Or return None if not available - (Normally we'd over ride this with a specific source) + (Normally we'd override this with a specific source) """ From caeb46fade48c28333de45deeef2b5295ec64906 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:46:19 +0100 Subject: [PATCH 13/28] spelling, formatting --- sysdata/production/capital.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sysdata/production/capital.py b/sysdata/production/capital.py index 7cb974b063..cf51753365 100644 --- a/sysdata/production/capital.py +++ b/sysdata/production/capital.py @@ -236,8 +236,10 @@ class totalCapitalCalculationData(object): def __init__(self, capital_data: capitalData, calc_method="full"): """ - Calculation methods are: full- all profits and losses go to capital, half - profits past the HWM are not added, - fixed - capital is unaffected by profits and losses (not reccomended!) + Calculation methods are: + - full: all profits and losses go to capital + - half: profits past the HWM are not added + - fixed: capital is unaffected by profits and losses (not recommended!) :param capital_data: strategyCapitalData instance or something that inherits from it :param calc_method: method for going from profits to capital allocated From 8e945ec312e5733043c329f5ffa109f80851601b Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:46:40 +0100 Subject: [PATCH 14/28] spelling --- syscore/fileutils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/syscore/fileutils.py b/syscore/fileutils.py index c04e3f3b1b..4264110ede 100755 --- a/syscore/fileutils.py +++ b/syscore/fileutils.py @@ -8,7 +8,7 @@ from syscore.dateutils import SECONDS_PER_DAY -# DO NOTE DELETE: all these are unused: but are required to get the filename padding to work +# DO NOT DELETE: all these are unused: but are required to get the filename padding to work """ @@ -103,7 +103,7 @@ def get_file_or_folder_age_in_days(full_filename_with_ext: str) -> float: def resolve_path_and_filename_for_package( - path_and_filename: str, seperate_filename=None + path_and_filename: str, separate_filename=None ) -> str: """ A way of resolving relative and absolute filenames, and dealing with awkward OS specific things @@ -135,7 +135,7 @@ def resolve_path_and_filename_for_package( """ path_and_filename_as_list = transform_path_into_list(path_and_filename) - if seperate_filename is None: + if separate_filename is None: ( path_as_list, seperate_filename, @@ -147,7 +147,7 @@ def resolve_path_and_filename_for_package( resolved_pathname = get_pathname_from_list(path_as_list) - resolved_path_and_filename = os.path.join(resolved_pathname, seperate_filename) + resolved_path_and_filename = os.path.join(resolved_pathname, separate_filename) return resolved_path_and_filename From e693cb71c0c32c21f0158840a18acb8949875e20 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:47:07 +0100 Subject: [PATCH 15/28] grammar --- docs/production.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/production.md b/docs/production.md index 666ae4b1eb..dbf0f601f4 100644 --- a/docs/production.md +++ b/docs/production.md @@ -1964,7 +1964,7 @@ We can set the maximum allowable position that can be held in a given instrument Autopopulate uses current levels of risk to estimate the appropriate position limit. So it will make position limits smaller when risk is higher, and vice versa. It makes a lot of assumptions when setting limits: that all your strategies have the same risk limit (which you can set), and the same IDM (also can be modified), and that all instruments have the same instrument weight (which you can set). It does not use actual instrument weights, and it only sets limits that are global for a particular instrument. -The dynamic optimisation strategy will also use position limits in it's optimisation in production (not in backtests, since fixed position limits make no sense for a historical backtest). +The dynamic optimisation strategy will also use position limits in its optimisation in production (not in backtests, since fixed position limits make no sense for a historical backtest). #### Trade control / override @@ -2845,7 +2845,7 @@ The following are .csv configurations used in both production and sim: ### Set up configuration -The following are used when initialising the database with it's initial configuration, but will also be used in the simulation environment: +The following are used when initialising the database with its initial configuration, but will also be used in the simulation environment: - [/data/futures/csvconfig/spreadcosts.csv](/data/futures/csvconfig/spreadcosts.csv) From dec5d425d71455888901a8aadfdd711001166346 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:47:21 +0100 Subject: [PATCH 16/28] broken link --- docs/instruments.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/instruments.md b/docs/instruments.md index 7ebdc4bdbd..fbd072f92c 100644 --- a/docs/instruments.md +++ b/docs/instruments.md @@ -4,7 +4,7 @@ It will make no sense unless you've already read: - [Backtesting with pysystemtrade](/docs/backtesting.md) - [Storing futures and spot FX data](/docs/data.md) -- [Using pysystemtrade in production(/docs/production.md) +- [Using pysystemtrade in production](/docs/production.md) Table of Contents ================= @@ -350,7 +350,7 @@ Operating in the production environment is a bit more complex, due to the intera 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`, 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`. +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 From cd886e7237838b430e59a12a2f37d8ab61a2ca62 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:47:27 +0100 Subject: [PATCH 17/28] broken link --- docs/dashboard_and_monitor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dashboard_and_monitor.md b/docs/dashboard_and_monitor.md index e45ea789dd..846b72512a 100644 --- a/docs/dashboard_and_monitor.md +++ b/docs/dashboard_and_monitor.md @@ -2,7 +2,7 @@ This document describes how to monitor pysystemtrade in a production environment It will make no sense unless you've already read: -- [Using pysystemtrade in production(/docs/production.md) +- [Using pysystemtrade in production](/docs/production.md) Table of Contents ================= From 809d56b8d8f233201ed1667b3147503d66b9e8b5 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:47:43 +0100 Subject: [PATCH 18/28] spelling, formatting --- docs/backtesting.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/backtesting.md b/docs/backtesting.md index df5cc2ef20..3a7aaeb628 100644 --- a/docs/backtesting.md +++ b/docs/backtesting.md @@ -3997,13 +3997,12 @@ of forecasts. ### Working out net costs (both instrument and forecast weights) -Again I recommend you check out this [blog -post](https://qoppac.blogspot.com/2016/05/optimising-weights-with-costs.html). +Again I recommend you check out this [blog post](https://qoppac.blogspot.com/2016/05/optimising-weights-with-costs.html). ``` forecast_weight_estimate: ## can also be applied to instrument weights equalise_gross: False ## equalise gross returns so that only costs are used for optimisation - cost_multiplier: 0.0 ## multiply costs by this number. Zero means grosss returns used. Higher than 1 means costs will be inflated. Use zero if apply_cost_weight=True (see later) + cost_multiplier: 0.0 ## multiply costs by this number. Zero means gross returns used. Higher than 1 means costs will be inflated. Use zero if apply_cost_weight=True (see later) ``` From c92b58a10e994fd6aca3b1243c479a72740e69a2 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:48:18 +0100 Subject: [PATCH 19/28] pydoc param names, spelling --- systems/accounts/account_buffering_subsystem.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/systems/accounts/account_buffering_subsystem.py b/systems/accounts/account_buffering_subsystem.py index cf4d094752..b032f8023b 100644 --- a/systems/accounts/account_buffering_subsystem.py +++ b/systems/accounts/account_buffering_subsystem.py @@ -117,17 +117,17 @@ def apply_buffer( If we're rounding positions, then we floor and ceiling the buffers. - :param position: optimal position - :type position: pd.Series + :param optimal_position: optimal position + :type optimal_position: pd.Series :param pos_buffers: :type pos_buffers: Tx2 pd.dataframe, top_pos and bot_pos - :param trade_to_edge: Trade to the edge (TRue) or the optimal (False) + :param trade_to_edge: Trade to the edge (True) or the optimal (False) :type trade_to_edge: bool - :param round_positions: Produce rounded positions - :type round_positions: bool + :param roundpositions: Produce rounded positions + :type roundpositions: bool :returns: pd.Series """ @@ -185,7 +185,7 @@ def apply_buffer_single_period( :param bot_pos: bottom of buffer :type bot_pos: float - :param trade_to_edge: Trade to the edge (TRue) or the optimal (False) + :param trade_to_edge: Trade to the edge (True) or the optimal (False) :type trade_to_edge: bool :returns: float From 9ddeb36246887f9e0e893abe81c295e29b052bc0 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:48:47 +0100 Subject: [PATCH 20/28] pydoc param name --- sysdata/csv/csv_futures_contract_prices.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdata/csv/csv_futures_contract_prices.py b/sysdata/csv/csv_futures_contract_prices.py index 872b0db99f..79c9671e96 100644 --- a/sysdata/csv/csv_futures_contract_prices.py +++ b/sysdata/csv/csv_futures_contract_prices.py @@ -54,7 +54,7 @@ def _get_merged_prices_for_contract_object_no_checking( """ Read back the prices for a given contract object - :param contract_object: futuresContract + :param futures_contract_object: futuresContract :return: data """ From 88036906498a8a0fbf0bd9c68a7c2da6be54d688 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:49:05 +0100 Subject: [PATCH 21/28] pydoc param name. unused imports --- sysbrokers/IB/ib_orders.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sysbrokers/IB/ib_orders.py b/sysbrokers/IB/ib_orders.py index 6516579b06..7b486ae904 100644 --- a/sysbrokers/IB/ib_orders.py +++ b/sysbrokers/IB/ib_orders.py @@ -1,9 +1,5 @@ from ib_insync import Trade as ibTrade -from copy import copy - -import datetime - from sysbrokers.IB.ib_futures_contracts_data import ibFuturesContractData from sysbrokers.IB.ib_instruments_data import ibFuturesInstrumentData from sysbrokers.IB.ib_translate_broker_order_objects import ( @@ -456,7 +452,7 @@ def modify_limit_price_given_control_object( """ NOTE this does not update the internal state of orders, which will retain the original order - :param broker_orders_with_controls: + :param broker_order_with_controls: :param new_limit_price: :return: """ From 0b9f57965523e5624d70c7ad2ee9d0556392adc5 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 09:49:48 +0100 Subject: [PATCH 22/28] roll config moved to CSV --- sysinit/futures/safely_modify_roll_parameters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysinit/futures/safely_modify_roll_parameters.py b/sysinit/futures/safely_modify_roll_parameters.py index 29ddbf1902..f9d02e4adc 100644 --- a/sysinit/futures/safely_modify_roll_parameters.py +++ b/sysinit/futures/safely_modify_roll_parameters.py @@ -148,7 +148,7 @@ def safely_modify_roll_parameters(data: dataBlob): def modified_roll_parameters(data: dataBlob, instrument_code) -> rollParameters: - print("Existing roll parameters: Must be defined in database config") + print("Existing roll parameters: Must be defined in CSV config") data_contracts = dataContracts(data) roll_parameters = data_contracts.get_roll_parameters(instrument_code) print(str(roll_parameters)) From 3c872741e8c608badd8443ef3769ac4b5d02c80f Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Fri, 25 Oct 2024 10:03:34 +0100 Subject: [PATCH 23/28] pydoc param name --- sysproduction/reporting/data/rolls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysproduction/reporting/data/rolls.py b/sysproduction/reporting/data/rolls.py index 1ea3200e22..e3343c51cd 100644 --- a/sysproduction/reporting/data/rolls.py +++ b/sysproduction/reporting/data/rolls.py @@ -361,7 +361,7 @@ def get_or_infer_latest_price(new_multiple_prices, price_col: str = "PRICE"): If one can't be found, infer (There will always be a price in some column) - :param current_multiple_prices: futuresMultiplePrices + :param new_multiple_prices: futuresMultiplePrices :param price_col: one of 'PRICE','CARRY','FORWARD' :return: tuple: float, bool. Bool is true if the price is inferred, otherwise False """ From 59416d3bf124207c22d74f182a5178d93054ce2f Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Mon, 28 Oct 2024 10:10:34 +0000 Subject: [PATCH 24/28] Fix "Cut down order..." messages --- sysexecution/algos/algo_market.py | 2 +- sysexecution/algos/algo_original_best.py | 2 +- .../stack_handler/create_broker_orders_from_contract_orders.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sysexecution/algos/algo_market.py b/sysexecution/algos/algo_market.py index f0f0d3431a..cedc89a8e0 100644 --- a/sysexecution/algos/algo_market.py +++ b/sysexecution/algos/algo_market.py @@ -60,7 +60,7 @@ def prepare_and_submit_trade(self): if cut_down_contract_order.trade != contract_order.trade: self.data.log.debug( - "Cut down order to size %s from %s because of algo size limit" + "Cut down order from size %s to %s because of algo size limit" % (str(contract_order.trade), str(cut_down_contract_order.trade)), **log_attrs, ) diff --git a/sysexecution/algos/algo_original_best.py b/sysexecution/algos/algo_original_best.py index 0326be47a0..977f6cf740 100644 --- a/sysexecution/algos/algo_original_best.py +++ b/sysexecution/algos/algo_original_best.py @@ -102,7 +102,7 @@ def prepare_and_submit_trade(self) -> orderWithControls: ) if cut_down_contract_order.trade != contract_order.trade: data.log.debug( - "Cut down order to size %s from %s because of algo size limit" + "Cut down order from size %s to %s because of algo size limit" % (str(contract_order.trade), str(cut_down_contract_order.trade)), **log_attrs, ) diff --git a/sysexecution/stack_handler/create_broker_orders_from_contract_orders.py b/sysexecution/stack_handler/create_broker_orders_from_contract_orders.py index 25f764db79..029fbf1150 100644 --- a/sysexecution/stack_handler/create_broker_orders_from_contract_orders.py +++ b/sysexecution/stack_handler/create_broker_orders_from_contract_orders.py @@ -201,7 +201,7 @@ def liquidity_size_contract_order( if liquid_qty != contract_order_after_trade_limits.trade: self.log.debug( - "Cut down order to size %s from %s because of liquidity" + "Cut down order from size %s to %s because of liquidity" % (str(liquid_qty), str(contract_order_after_trade_limits.trade)), **contract_order_after_trade_limits.log_attributes(), method="temp", From 5229ee1310f6056098f031c46fb692b3e847b054 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Mon, 28 Oct 2024 10:39:38 +0000 Subject: [PATCH 25/28] spelling --- syscore/fileutils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syscore/fileutils.py b/syscore/fileutils.py index 4264110ede..b8ac73c324 100755 --- a/syscore/fileutils.py +++ b/syscore/fileutils.py @@ -138,7 +138,7 @@ def resolve_path_and_filename_for_package( if separate_filename is None: ( path_as_list, - seperate_filename, + separate_filename, ) = extract_filename_from_combined_path_and_filename_list( path_and_filename_as_list ) @@ -240,9 +240,9 @@ def extract_filename_from_combined_path_and_filename_list( extension = path_and_filename_as_list.pop() filename = path_and_filename_as_list.pop() - seperate_filename = ".".join([filename, extension]) + separate_filename = ".".join([filename, extension]) - return path_and_filename_as_list, seperate_filename + return path_and_filename_as_list, separate_filename def get_pathname_from_list(path_as_list: List[str]) -> str: From 4d6a91e61530db388c3cdfee15b693983deb8b02 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Mon, 28 Oct 2024 10:41:10 +0000 Subject: [PATCH 26/28] seperate_filename -> separate_filename --- sysdata/parquet/parquet_access.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdata/parquet/parquet_access.py b/sysdata/parquet/parquet_access.py index 3823a9e3b4..2f0d225521 100644 --- a/sysdata/parquet/parquet_access.py +++ b/sysdata/parquet/parquet_access.py @@ -62,7 +62,7 @@ def _get_filename_given_data_type_and_identifier( ): path = self._get_pathname_given_data_type(data_type) return resolve_path_and_filename_for_package( - path, seperate_filename="%s.%s" % (identifier, EXTENSION) + path, separate_filename="%s.%s" % (identifier, EXTENSION) ) def _get_pathname_given_data_type(self, data_type: str): From 24a8880b350ca8f678cc2b49b970f764e01fa794 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Mon, 28 Oct 2024 10:41:25 +0000 Subject: [PATCH 27/28] spelling --- sysdata/futures/spread_costs.py | 2 +- sysproduction/reporting/adhoc/dynamic_optimisation.py | 2 +- systems/accounts/account_costs.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sysdata/futures/spread_costs.py b/sysdata/futures/spread_costs.py index 98d01f10e8..11e1faa247 100644 --- a/sysdata/futures/spread_costs.py +++ b/sysdata/futures/spread_costs.py @@ -1,5 +1,5 @@ ## Expected slippage eg half bid-ask spread -## Used to be in instrument config, now seperate +## Used to be in instrument config, now separate import pandas as pd from sysdata.base_data import baseData from syslogging.logger import * diff --git a/sysproduction/reporting/adhoc/dynamic_optimisation.py b/sysproduction/reporting/adhoc/dynamic_optimisation.py index 95f6f59e70..b14f7be8e3 100644 --- a/sysproduction/reporting/adhoc/dynamic_optimisation.py +++ b/sysproduction/reporting/adhoc/dynamic_optimisation.py @@ -303,7 +303,7 @@ def dynamic_optimisation_text(data: dataBlob, strategy_name: str): if __name__ == "__main__": - ### Do two seperate reports, one graphical, one text + ### Do two separate reports, one graphical, one text data = dataBlob() ## interactively get backtest to use diff --git a/systems/accounts/account_costs.py b/systems/accounts/account_costs.py index c9d2c8e20b..efce48a6e1 100644 --- a/systems/accounts/account_costs.py +++ b/systems/accounts/account_costs.py @@ -29,7 +29,7 @@ def get_SR_cost_for_instrument_forecast( KEY OUTPUT """ - ## Calculate holding and transaction seperately, as the former could be pooled + ## Calculate holding and transaction separately, as the former could be pooled transaction_cost = self.get_SR_transaction_cost_for_instrument_forecast( instrument_code=instrument_code, rule_variation_name=rule_variation_name ) @@ -184,7 +184,7 @@ def get_SR_holding_cost_only(self, instrument_code: str) -> float: cost_per_trade = self.get_SR_cost_per_trade_for_instrument(instrument_code) hold_turnovers = self.get_rolls_per_year(instrument_code) * 2.0 - ## Assumes no benefit from spread trades i.e. do two seperate trades + ## Assumes no benefit from spread trades i.e. do two separate trades SR_cost_holding = hold_turnovers * cost_per_trade return SR_cost_holding From c807c7c21b3c3d3f0450c31e7d2ac3c1e5994ca7 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Mon, 28 Oct 2024 13:26:46 +0000 Subject: [PATCH 28/28] delete libreoffice temp file artifacts --- data/futures/roll_calendars_csv/.~lock.EU-AUTO.csv# | 1 - data/futures/roll_calendars_csv/.~lock.EU-BASIC.csv# | 1 - 2 files changed, 2 deletions(-) delete mode 100644 data/futures/roll_calendars_csv/.~lock.EU-AUTO.csv# delete mode 100644 data/futures/roll_calendars_csv/.~lock.EU-BASIC.csv# diff --git a/data/futures/roll_calendars_csv/.~lock.EU-AUTO.csv# b/data/futures/roll_calendars_csv/.~lock.EU-AUTO.csv# deleted file mode 100644 index 251ea09849..0000000000 --- a/data/futures/roll_calendars_csv/.~lock.EU-AUTO.csv# +++ /dev/null @@ -1 +0,0 @@ -,rob,RobLaptop,13.05.2021 12:04,file:///home/rob/.config/libreoffice/4; \ No newline at end of file diff --git a/data/futures/roll_calendars_csv/.~lock.EU-BASIC.csv# b/data/futures/roll_calendars_csv/.~lock.EU-BASIC.csv# deleted file mode 100644 index 74db0ad104..0000000000 --- a/data/futures/roll_calendars_csv/.~lock.EU-BASIC.csv# +++ /dev/null @@ -1 +0,0 @@ -,rob,RobLaptop,13.05.2021 12:03,file:///home/rob/.config/libreoffice/4; \ No newline at end of file