From 99b4767bf44e2696370b383a8ece9c0d9d304641 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 18 Apr 2024 22:51:25 +0200 Subject: [PATCH] Fix typos discovered by codespell --- build_helpers/pre_commit_update.py | 2 +- docs/advanced-backtesting.md | 2 +- docs/backtesting.md | 2 +- docs/faq.md | 4 ++-- docs/freqai-parameter-table.md | 2 +- docs/rest-api.md | 2 +- docs/stoploss.md | 2 +- docs/strategy-advanced.md | 2 +- docs/strategy-customization.md | 2 +- docs/trade-object.md | 4 ++-- freqtrade/configuration/configuration.py | 2 +- freqtrade/data/dataprovider.py | 2 +- freqtrade/exchange/exchange.py | 14 +++++++------- freqtrade/exchange/gate.py | 2 +- freqtrade/exchange/okx.py | 2 +- freqtrade/freqai/RL/BaseEnvironment.py | 6 +++--- .../freqai/RL/BaseReinforcementLearningModel.py | 4 ++-- freqtrade/freqai/data_drawer.py | 2 +- freqtrade/freqai/data_kitchen.py | 6 +++--- freqtrade/freqai/freqai_interface.py | 2 +- .../prediction_models/PyTorchMLPClassifier.py | 2 +- .../prediction_models/PyTorchMLPRegressor.py | 2 +- .../PyTorchTransformerRegressor.py | 2 +- .../ReinforcementLearner_multiproc.py | 2 +- freqtrade/freqai/torch/PyTorchModelTrainer.py | 2 +- freqtrade/freqai/utils.py | 2 +- freqtrade/freqtradebot.py | 10 +++++----- freqtrade/optimize/backtesting.py | 4 ++-- freqtrade/persistence/custom_data.py | 2 +- freqtrade/persistence/trade_model.py | 6 +++--- freqtrade/plot/plotting.py | 4 ++-- freqtrade/plugins/pairlist/RemotePairList.py | 2 +- freqtrade/plugins/pairlist/VolumePairList.py | 2 +- freqtrade/plugins/protections/iprotection.py | 2 +- freqtrade/resolvers/iresolver.py | 2 +- freqtrade/rpc/external_message_consumer.py | 4 ++-- freqtrade/rpc/rpc.py | 2 +- freqtrade/rpc/telegram.py | 2 +- freqtrade/strategy/strategy_helper.py | 2 +- .../strategy_methods_advanced.j2 | 2 +- freqtrade/wallets.py | 2 +- freqtrade/worker.py | 2 +- scripts/ws_client.py | 4 ++-- tests/commands/test_commands.py | 2 +- tests/conftest.py | 2 +- tests/data/test_datahandler.py | 2 +- tests/exchange/test_exchange.py | 6 +++--- tests/freqai/test_freqai_datadrawer.py | 2 +- tests/freqtradebot/test_freqtradebot.py | 12 ++++++------ tests/optimize/test_backtest_detail.py | 4 ++-- tests/optimize/test_backtesting_adjust_position.py | 4 ++-- tests/optimize/test_lookahead_analysis.py | 2 +- tests/optimize/test_optimize_reports.py | 2 +- tests/persistence/test_persistence.py | 2 +- tests/plugins/test_pairlist.py | 4 ++-- tests/rpc/test_rpc_apiserver.py | 2 +- tests/strategy/test_interface.py | 2 +- tests/strategy/test_strategy_helpers.py | 2 +- tests/test_plotting.py | 4 ++-- 59 files changed, 93 insertions(+), 93 deletions(-) diff --git a/build_helpers/pre_commit_update.py b/build_helpers/pre_commit_update.py index e6b47d100..7774523d2 100644 --- a/build_helpers/pre_commit_update.py +++ b/build_helpers/pre_commit_update.py @@ -1,4 +1,4 @@ -# File used in CI to ensure pre-commit dependencies are kept uptodate. +# File used in CI to ensure pre-commit dependencies are kept up-to-date. import sys from pathlib import Path diff --git a/docs/advanced-backtesting.md b/docs/advanced-backtesting.md index e91842d64..563e5df08 100644 --- a/docs/advanced-backtesting.md +++ b/docs/advanced-backtesting.md @@ -36,7 +36,7 @@ freqtrade backtesting-analysis -c --analysis-groups 0 1 2 3 4 5 ``` This command will read from the last backtesting results. The `--analysis-groups` option is -used to specify the various tabular outputs showing the profit fo each group or trade, +used to specify the various tabular outputs showing the profit of each group or trade, ranging from the simplest (0) to the most detailed per pair, per buy and per sell tag (4): * 0: overall winrate and profit summary by enter_tag diff --git a/docs/backtesting.md b/docs/backtesting.md index 11510dc24..6cfc9597f 100644 --- a/docs/backtesting.md +++ b/docs/backtesting.md @@ -587,7 +587,7 @@ These precision values are based on current exchange limits (as described in the ## Improved backtest accuracy -One big limitation of backtesting is it's inability to know how prices moved intra-candle (was high before close, or viceversa?). +One big limitation of backtesting is it's inability to know how prices moved intra-candle (was high before close, or vice-versa?). So assuming you run backtesting with a 1h timeframe, there will be 4 prices for that candle (Open, High, Low, Close). While backtesting does take some assumptions (read above) about this - this can never be perfect, and will always be biased in one way or the other. diff --git a/docs/faq.md b/docs/faq.md index 95a9924f9..134765579 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -2,7 +2,7 @@ ## Supported Markets -Freqtrade supports spot trading, as well as (isolated) futures trading for some selected exchanges. Please refer to the [documentation start page](index.md#supported-futures-exchanges-experimental) for an uptodate list of supported exchanges. +Freqtrade supports spot trading, as well as (isolated) futures trading for some selected exchanges. Please refer to the [documentation start page](index.md#supported-futures-exchanges-experimental) for an up-to-date list of supported exchanges. ### Can my bot open short positions? @@ -14,7 +14,7 @@ In spot markets, you can in some cases use leveraged spot tokens, which reflect ### Can my bot trade options or futures? -Futures trading is supported for selected exchanges. Please refer to the [documentation start page](index.md#supported-futures-exchanges-experimental) for an uptodate list of supported exchanges. +Futures trading is supported for selected exchanges. Please refer to the [documentation start page](index.md#supported-futures-exchanges-experimental) for an up-to-date list of supported exchanges. ## Beginner Tips & Tricks diff --git a/docs/freqai-parameter-table.md b/docs/freqai-parameter-table.md index 055b7b45d..8f5dc0375 100644 --- a/docs/freqai-parameter-table.md +++ b/docs/freqai-parameter-table.md @@ -55,7 +55,7 @@ Mandatory parameters are marked as **Required** and have to be set in one of the | | **Data split parameters within the `freqai.data_split_parameters` sub dictionary** | `data_split_parameters` | Include any additional parameters available from scikit-learn `test_train_split()`, which are shown [here](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html) (external website).
**Datatype:** Dictionary. | `test_size` | The fraction of data that should be used for testing instead of training.
**Datatype:** Positive float < 1. -| `shuffle` | Shuffle the training data points during training. Typically, to not remove the chronological order of data in time-series forecasting, this is set to `False`.
**Datatype:** Boolean.
Defaut: `False`. +| `shuffle` | Shuffle the training data points during training. Typically, to not remove the chronological order of data in time-series forecasting, this is set to `False`.
**Datatype:** Boolean.
Default: `False`. ### Model training parameters diff --git a/docs/rest-api.md b/docs/rest-api.md index cf196559d..8acad7d8a 100644 --- a/docs/rest-api.md +++ b/docs/rest-api.md @@ -454,7 +454,7 @@ To properly configure your reverse proxy (securely), please consult it's documen - **Caddy**: Caddy v2 supports websockets out of the box, see the [documentation](https://caddyserver.com/docs/v2-upgrade#proxy) !!! Tip "SSL certificates" - You can use tools like certbot to setup ssl certificates to access your bot's UI through encrypted connection by using any fo the above reverse proxies. + You can use tools like certbot to setup ssl certificates to access your bot's UI through encrypted connection by using any of the above reverse proxies. While this will protect your data in transit, we do not recommend to run the freqtrade API outside of your private network (VPN, SSH tunnel). ### OpenAPI interface diff --git a/docs/stoploss.md b/docs/stoploss.md index 935950d06..19683aadd 100644 --- a/docs/stoploss.md +++ b/docs/stoploss.md @@ -240,7 +240,7 @@ When using leverage, the same principle is applied - with stoploss defining the Therefore, a stoploss of 10% on a 10x trade would trigger on a 1% price move. If your stake amount (own capital) was 100$ - this trade would be 1000$ at 10x (after leverage). -If price moves 1% - you've lost 10$ of your own capital - therfore stoploss will trigger in this case. +If price moves 1% - you've lost 10$ of your own capital - therefore stoploss will trigger in this case. Make sure to be aware of this, and avoid using too tight stoploss (at 10x leverage, 10% risk may be too little to allow the trade to "breath" a little). diff --git a/docs/strategy-advanced.md b/docs/strategy-advanced.md index debd5bc1b..c5a17c364 100644 --- a/docs/strategy-advanced.md +++ b/docs/strategy-advanced.md @@ -326,4 +326,4 @@ for val in self.buy_ema_short.range: dataframe = pd.concat(frames, axis=1) ``` -Freqtrade does however also counter this by running `dataframe.copy()` on the dataframe right after the `populate_indicators()` method - so performance implications of this should be low to non-existant. +Freqtrade does however also counter this by running `dataframe.copy()` on the dataframe right after the `populate_indicators()` method - so performance implications of this should be low to non-existent. diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index e368a8056..59efc0e02 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -776,7 +776,7 @@ The orderbook structure is aligned with the order structure from [ccxt](https:// Therefore, using `ob['bids'][0][0]` as demonstrated above will result in using the best bid price. `ob['bids'][0][1]` would look at the amount at this orderbook position. !!! Warning "Warning about backtesting" - The order book is not part of the historic data which means backtesting and hyperopt will not work correctly if this method is used, as the method will return uptodate values. + The order book is not part of the historic data which means backtesting and hyperopt will not work correctly if this method is used, as the method will return up-to-date values. ### *ticker(pair)* diff --git a/docs/trade-object.md b/docs/trade-object.md index 15a8b1938..fa8b2dbb1 100644 --- a/docs/trade-object.md +++ b/docs/trade-object.md @@ -126,7 +126,7 @@ An `Order` object will always be tied to it's corresponding [`Trade`](#trade-obj ### Order - Available attributes an Order object is typically attached to a trade. -Most properties here can be None as they are dependant on the exchange response. +Most properties here can be None as they are dependent on the exchange response. | Attribute | DataType | Description | |------------|-------------|-------------| @@ -141,7 +141,7 @@ Most properties here can be None as they are dependant on the exchange response. `amount` | float | Amount in base currency `filled` | float | Filled amount (in base currency) `remaining` | float | Remaining amount -`cost` | float | Cost of the order - usually average * filled (*Exchange dependant on futures, may contain the cost with or without leverage and may be in contracts.*) +`cost` | float | Cost of the order - usually average * filled (*Exchange dependent on futures, may contain the cost with or without leverage and may be in contracts.*) `stake_amount` | float | Stake amount used for this order. *Added in 2023.7.* `order_date` | datetime | Order creation date **use `order_date_utc` instead** `order_date_utc` | datetime | Order creation date (in UTC) diff --git a/freqtrade/configuration/configuration.py b/freqtrade/configuration/configuration.py index 4d945c23e..906d0a544 100644 --- a/freqtrade/configuration/configuration.py +++ b/freqtrade/configuration/configuration.py @@ -202,7 +202,7 @@ class Configuration: if self.args.get('show_sensitive'): logger.warning( - "Sensitive information will be shown in the upcomming output. " + "Sensitive information will be shown in the upcoming output. " "Please make sure to never share this output without redacting " "the information yourself.") diff --git a/freqtrade/data/dataprovider.py b/freqtrade/data/dataprovider.py index b737007c4..6fa6e4738 100644 --- a/freqtrade/data/dataprovider.py +++ b/freqtrade/data/dataprovider.py @@ -523,7 +523,7 @@ class DataProvider: Send custom RPC Notifications from your bot. Will not send any bot in modes other than Dry-run or Live. :param message: Message to be sent. Must be below 4096. - :param always_send: If False, will send the message only once per candle, and surpress + :param always_send: If False, will send the message only once per candle, and suppress identical messages. Careful as this can end up spaming your chat. Defaults to False diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index fbb9028c1..68a09bb94 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -758,7 +758,7 @@ class Exchange: def price_get_one_pip(self, pair: str, price: float) -> float: """ - Get's the "1 pip" value for this pair. + Gets the "1 pip" value for this pair. Used in PriceFilter to calculate the 1pip movements. """ precision = self.markets[pair]['precision']['price'] @@ -2007,7 +2007,7 @@ class Exchange: range(since_ms, until_ms or dt_ts(), one_call)] data: List = [] - # Chunk requests into batches of 100 to avoid overwelming ccxt Throttling + # Chunk requests into batches of 100 to avoid overwhelming ccxt Throttling for input_coro in chunks(input_coroutines, 100): results = await asyncio.gather(*input_coro, return_exceptions=True) @@ -2124,7 +2124,7 @@ class Exchange: Only used in the dataprovider.refresh() method. :param pair_list: List of 2 element tuples containing pair, interval to refresh :param since_ms: time since when to download, in milliseconds - :param cache: Assign result to _klines. Usefull for one-off downloads like for pairlists + :param cache: Assign result to _klines. Useful for one-off downloads like for pairlists :param drop_incomplete: Control candle dropping. Specifying None defaults to _ohlcv_partial_candle :return: Dict of [{(pair, timeframe): Dataframe}] @@ -2135,7 +2135,7 @@ class Exchange: input_coroutines, cached_pairs = self._build_ohlcv_dl_jobs(pair_list, since_ms, cache) results_df = {} - # Chunk requests into batches of 100 to avoid overwelming ccxt Throttling + # Chunk requests into batches of 100 to avoid overwhelming ccxt Throttling for input_coro in chunks(input_coroutines, 100): async def gather_stuff(): return await asyncio.gather(*input_coro, return_exceptions=True) @@ -2295,7 +2295,7 @@ class Exchange: since: Optional[int] = None, params: Optional[dict] = None) -> Tuple[List[List], Any]: """ - Asyncronously gets trade history using fetch_trades. + Asynchronously gets trade history using fetch_trades. Handles exchange errors, does one call to the exchange. :param pair: Pair to fetch trade data for :param since: Since as integer timestamp in milliseconds @@ -2352,7 +2352,7 @@ class Exchange: since: Optional[int] = None, from_id: Optional[str] = None) -> Tuple[str, List[List]]: """ - Asyncronously gets trade history using fetch_trades + Asynchronously gets trade history using fetch_trades use this when exchange uses id-based iteration (check `self._trades_pagination`) :param pair: Pair to fetch trade data for :param since: Since as integer timestamp in milliseconds @@ -2403,7 +2403,7 @@ class Exchange: async def _async_get_trade_history_time(self, pair: str, until: int, since: Optional[int] = None) -> Tuple[str, List[List]]: """ - Asyncronously gets trade history using fetch_trades, + Asynchronously gets trade history using fetch_trades, when the exchange uses time-based iteration (check `self._trades_pagination`) :param pair: Pair to fetch trade data for :param since: Since as integer timestamp in milliseconds diff --git a/freqtrade/exchange/gate.py b/freqtrade/exchange/gate.py index cb749cb66..42e79e63e 100644 --- a/freqtrade/exchange/gate.py +++ b/freqtrade/exchange/gate.py @@ -79,7 +79,7 @@ class Gate(Exchange): # As such, futures orders on gate will not contain a fee, which causes # a repeated "update fee" cycle and wrong calculations. # Therefore we patch the response with fees if it's not available. - # An alternative also contianing fees would be + # An alternative also containing fees would be # privateFuturesGetSettleAccountBook({"settle": "usdt"}) pair_fees = self._trading_fees.get(pair, {}) if pair_fees: diff --git a/freqtrade/exchange/okx.py b/freqtrade/exchange/okx.py index 6f1c46215..60b681f65 100644 --- a/freqtrade/exchange/okx.py +++ b/freqtrade/exchange/okx.py @@ -56,7 +56,7 @@ class Okx(Exchange): """ Exchange ohlcv candle limit OKX has the following behaviour: - * 300 candles for uptodate data + * 300 candles for up-to-date data * 100 candles for historic data * 100 candles for additional candles (not futures or spot). :param timeframe: Timeframe to check diff --git a/freqtrade/freqai/RL/BaseEnvironment.py b/freqtrade/freqai/RL/BaseEnvironment.py index b8548dd16..f53ab9d27 100644 --- a/freqtrade/freqai/RL/BaseEnvironment.py +++ b/freqtrade/freqai/RL/BaseEnvironment.py @@ -222,7 +222,7 @@ class BaseEnvironment(gym.Env): @abstractmethod def step(self, action: int): """ - Step depeneds on action types, this must be inherited. + Step depends on action types, this must be inherited. """ return @@ -326,7 +326,7 @@ class BaseEnvironment(gym.Env): def _update_unrealized_total_profit(self): """ - Update the unrealized total profit incase of episode end. + Update the unrealized total profit in case of episode end. """ if self._position in (Positions.Long, Positions.Short): pnl = self.get_unrealized_profit() @@ -357,7 +357,7 @@ class BaseEnvironment(gym.Env): """ return self.actions - # Keeping around incase we want to start building more complex environment + # Keeping around in case we want to start building more complex environment # templates in the future. # def most_recent_return(self): # """ diff --git a/freqtrade/freqai/RL/BaseReinforcementLearningModel.py b/freqtrade/freqai/RL/BaseReinforcementLearningModel.py index 5b98efb49..4542c7090 100644 --- a/freqtrade/freqai/RL/BaseReinforcementLearningModel.py +++ b/freqtrade/freqai/RL/BaseReinforcementLearningModel.py @@ -311,7 +311,7 @@ class BaseReinforcementLearningModel(IFreqaiModel): if not prices_train_old.empty: prices_train = prices_train_old rename_dict = rename_dict_old - logger.warning('Reinforcement learning module didnt find the correct raw prices ' + logger.warning('Reinforcement learning module didn't find the correct raw prices ' 'assigned in feature_engineering_standard(). ' 'Please assign them with:\n' 'dataframe["%-raw_close"] = dataframe["close"]\n' @@ -458,7 +458,7 @@ def make_env(MyRLEnv: Type[BaseEnvironment], env_id: str, rank: int, :param env_id: (str) the environment ID :param num_env: (int) the number of environment you wish to have in subprocesses - :param seed: (int) the inital seed for RNG + :param seed: (int) the initial seed for RNG :param rank: (int) index of the subprocess :param env_info: (dict) all required arguments to instantiate the environment. :return: (Callable) diff --git a/freqtrade/freqai/data_drawer.py b/freqtrade/freqai/data_drawer.py index e04535928..77462f311 100644 --- a/freqtrade/freqai/data_drawer.py +++ b/freqtrade/freqai/data_drawer.py @@ -280,7 +280,7 @@ class FreqaiDataDrawer: new_pred = pred_df.copy() # set new_pred values to nans (we want to signal to user that there was nothing - # historically made during downtime. The newest pred will get appeneded later in + # historically made during downtime. The newest pred will get appended later in # append_model_predictions) new_pred["date_pred"] = dataframe["date"] diff --git a/freqtrade/freqai/data_kitchen.py b/freqtrade/freqai/data_kitchen.py index 3b4c5d817..834399390 100644 --- a/freqtrade/freqai/data_kitchen.py +++ b/freqtrade/freqai/data_kitchen.py @@ -612,7 +612,7 @@ class FreqaiDataKitchen: pairs = self.freqai_config["feature_parameters"].get("include_corr_pairlist", []) for pair in pairs: - pair = pair.replace(':', '') # lightgbm doesnt like colons + pair = pair.replace(':', '') # lightgbm does not like colons pair_cols = [col for col in dataframe.columns if col.startswith("%") and f"{pair}_" in col] @@ -638,7 +638,7 @@ class FreqaiDataKitchen: pairs = self.freqai_config["feature_parameters"].get("include_corr_pairlist", []) current_pair = current_pair.replace(':', '') for pair in pairs: - pair = pair.replace(':', '') # lightgbm doesnt work with colons + pair = pair.replace(':', '') # lightgbm does not work with colons if current_pair != pair: dataframe = dataframe.merge(corr_dataframes[pair], how='left', on='date') @@ -841,7 +841,7 @@ class FreqaiDataKitchen: f = spy.stats.norm.fit(self.data_dictionary["train_labels"][label]) self.data["labels_mean"][label], self.data["labels_std"][label] = f[0], f[1] - # incase targets are classifications + # in case targets are classifications for label in self.unique_class_list: self.data["labels_mean"][label], self.data["labels_std"][label] = 0, 0 diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py index 60fae421b..77203b4f0 100644 --- a/freqtrade/freqai/freqai_interface.py +++ b/freqtrade/freqai/freqai_interface.py @@ -222,7 +222,7 @@ class IFreqaiModel(ABC): time.sleep(1) pair = self.train_queue[0] - # ensure pair is avaialble in dp + # ensure pair is available in dp if pair not in strategy.dp.current_whitelist(): self.train_queue.popleft() logger.warning(f'{pair} not in current whitelist, removing from train queue.') diff --git a/freqtrade/freqai/prediction_models/PyTorchMLPClassifier.py b/freqtrade/freqai/prediction_models/PyTorchMLPClassifier.py index 9aabdf7ad..a03a0c742 100644 --- a/freqtrade/freqai/prediction_models/PyTorchMLPClassifier.py +++ b/freqtrade/freqai/prediction_models/PyTorchMLPClassifier.py @@ -74,7 +74,7 @@ class PyTorchMLPClassifier(BasePyTorchClassifier): model.to(self.device) optimizer = torch.optim.AdamW(model.parameters(), lr=self.learning_rate) criterion = torch.nn.CrossEntropyLoss() - # check if continual_learning is activated, and retreive the model to continue training + # check if continual_learning is activated, and retrieve the model to continue training trainer = self.get_init_model(dk.pair) if trainer is None: trainer = PyTorchModelTrainer( diff --git a/freqtrade/freqai/prediction_models/PyTorchMLPRegressor.py b/freqtrade/freqai/prediction_models/PyTorchMLPRegressor.py index dc8dc4b61..ec5c0ba81 100644 --- a/freqtrade/freqai/prediction_models/PyTorchMLPRegressor.py +++ b/freqtrade/freqai/prediction_models/PyTorchMLPRegressor.py @@ -69,7 +69,7 @@ class PyTorchMLPRegressor(BasePyTorchRegressor): model.to(self.device) optimizer = torch.optim.AdamW(model.parameters(), lr=self.learning_rate) criterion = torch.nn.MSELoss() - # check if continual_learning is activated, and retreive the model to continue training + # check if continual_learning is activated, and retrieve the model to continue training trainer = self.get_init_model(dk.pair) if trainer is None: trainer = PyTorchModelTrainer( diff --git a/freqtrade/freqai/prediction_models/PyTorchTransformerRegressor.py b/freqtrade/freqai/prediction_models/PyTorchTransformerRegressor.py index b1f2eecc6..8f245ed83 100644 --- a/freqtrade/freqai/prediction_models/PyTorchTransformerRegressor.py +++ b/freqtrade/freqai/prediction_models/PyTorchTransformerRegressor.py @@ -80,7 +80,7 @@ class PyTorchTransformerRegressor(BasePyTorchRegressor): model.to(self.device) optimizer = torch.optim.AdamW(model.parameters(), lr=self.learning_rate) criterion = torch.nn.MSELoss() - # check if continual_learning is activated, and retreive the model to continue training + # check if continual_learning is activated, and retrieve the model to continue training trainer = self.get_init_model(dk.pair) if trainer is None: trainer = PyTorchTransformerTrainer( diff --git a/freqtrade/freqai/prediction_models/ReinforcementLearner_multiproc.py b/freqtrade/freqai/prediction_models/ReinforcementLearner_multiproc.py index f014da602..3fab83cff 100644 --- a/freqtrade/freqai/prediction_models/ReinforcementLearner_multiproc.py +++ b/freqtrade/freqai/prediction_models/ReinforcementLearner_multiproc.py @@ -63,6 +63,6 @@ class ReinforcementLearner_multiproc(ReinforcementLearner): is_masking_supported(self.eval_env))) # TENSORBOARD CALLBACK DOES NOT RECOMMENDED TO USE WITH MULTIPLE ENVS, - # IT WILL RETURN FALSE INFORMATIONS, NEVERTHLESS NOT THREAD SAFE WITH SB3!!! + # IT WILL RETURN FALSE INFORMATION, NEVERTHELESS NOT THREAD SAFE WITH SB3!!! actions = self.train_env.env_method("get_actions")[0] self.tensorboard_callback = TensorboardCallback(verbose=1, actions=actions) diff --git a/freqtrade/freqai/torch/PyTorchModelTrainer.py b/freqtrade/freqai/torch/PyTorchModelTrainer.py index a91513dcb..5c1db3c65 100644 --- a/freqtrade/freqai/torch/PyTorchModelTrainer.py +++ b/freqtrade/freqai/torch/PyTorchModelTrainer.py @@ -38,7 +38,7 @@ class PyTorchModelTrainer(PyTorchTrainerInterface): :param init_model: A dictionary containing the initial model/optimizer state_dict and model_meta_data saved by self.save() method. :param model_meta_data: Additional metadata about the model (optional). - :param data_convertor: convertor from pd.DataFrame to torch.tensor. + :param data_convertor: converter from pd.DataFrame to torch.tensor. :param n_steps: used to calculate n_epochs. The number of training iterations to run. iteration here refers to the number of times optimizer.step() is called. ignored if n_epochs is set. diff --git a/freqtrade/freqai/utils.py b/freqtrade/freqai/utils.py index 22d75bc16..8ac175e4d 100644 --- a/freqtrade/freqai/utils.py +++ b/freqtrade/freqai/utils.py @@ -178,7 +178,7 @@ def record_params(config: Dict[str, Any], full_path: Path) -> None: def get_timerange_backtest_live_models(config: Config) -> str: """ - Returns a formated timerange for backtest live/ready models + Returns a formatted timerange for backtest live/ready models :param config: Configuration dictionary :return: a string timerange (format example: '20220801-20220822') diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index a3ab559fa..e8149794e 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -64,7 +64,7 @@ class FreqtradeBot(LoggingMixin): # Init objects self.config = config exchange_config: ExchangeConfig = deepcopy(config['exchange']) - # Remove credentials from original exchange config to avoid accidental credentail exposure + # Remove credentials from original exchange config to avoid accidental credential exposure remove_exchange_credentials(config['exchange'], True) self.strategy: IStrategy = StrategyResolver.load_strategy(self.config) @@ -176,7 +176,7 @@ class FreqtradeBot(LoggingMixin): try: Trade.commit() except Exception: - # Exeptions here will be happening if the db disappeared. + # Exceptions here will be happening if the db disappeared. # At which point we can no longer commit anyway. pass @@ -227,7 +227,7 @@ class FreqtradeBot(LoggingMixin): self.strategy.analyze(self.active_pair_whitelist) with self._exit_lock: - # Check for exchange cancelations, timeouts and user requested replace + # Check for exchange cancellations, timeouts and user requested replace self.manage_open_orders() # Protect from collisions with force_exit. @@ -1291,12 +1291,12 @@ class FreqtradeBot(LoggingMixin): def manage_trade_stoploss_orders(self, trade: Trade, stoploss_orders: List[Dict]): """ - Perform required actions acording to existing stoploss orders of trade + Perform required actions according to existing stoploss orders of trade :param trade: Corresponding Trade :param stoploss_orders: Current on exchange stoploss orders :return: None """ - # If all stoploss orderd are canceled for some reason we add it again + # If all stoploss ordered are canceled for some reason we add it again canceled_sl_orders = [o for o in stoploss_orders if o['status'] in ('canceled', 'cancelled')] if ( diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 3581be1a6..1952c4fe7 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -297,7 +297,7 @@ class Backtesting: candle_type=CandleType.FUNDING_RATE ) - # For simplicity, assign to CandleType.Mark (might contian index candles!) + # For simplicity, assign to CandleType.Mark (might contain index candles!) mark_rates_dict = history.load_data( datadir=self.config['datadir'], pairs=self.pairlists.whitelist, @@ -1217,7 +1217,7 @@ class Backtesting: :return: DataFrame with trades (results of backtesting) """ self.prepare_backtest(self.enable_protections) - # Ensure wallets are uptodate (important for --strategy-list) + # Ensure wallets are up-to-date (important for --strategy-list) self.wallets.update() # Use dict of lists with data for performance # (looping lists is a lot faster than pandas DataFrames) diff --git a/freqtrade/persistence/custom_data.py b/freqtrade/persistence/custom_data.py index 81a9e7ad6..4d3bd5218 100644 --- a/freqtrade/persistence/custom_data.py +++ b/freqtrade/persistence/custom_data.py @@ -18,7 +18,7 @@ class _CustomData(ModelBase): """ CustomData database model Keeps records of metadata as key/value store - for trades or global persistant values + for trades or global persistent values One to many relationship with Trades: - One trade can have many metadata entries - One metadata entry can only be associated with one Trade diff --git a/freqtrade/persistence/trade_model.py b/freqtrade/persistence/trade_model.py index defeb0e3f..ebd706fd3 100644 --- a/freqtrade/persistence/trade_model.py +++ b/freqtrade/persistence/trade_model.py @@ -847,7 +847,7 @@ class LocalTrade: isclose(order.safe_amount_after_fee, amount_tr, abs_tol=MATH_CLOSE_PREC) or (not recalculating and order.safe_amount_after_fee > amount_tr) ): - # When recalculating a trade, only comming out to 0 can force a close + # When recalculating a trade, only coming out to 0 can force a close self.close(order.safe_price) else: self.recalc_trade_from_orders() @@ -1125,7 +1125,7 @@ class LocalTrade: prof = self.calculate_profit(exit_rate, exit_amount, float(avg_price)) close_profit_abs += prof.profit_abs if total_stake > 0: - # This needs to be calculated based on the last occuring exit to be aligned + # This needs to be calculated based on the last occurring exit to be aligned # with realized_profit. close_profit = (close_profit_abs / total_stake) * self.leverage else: @@ -1502,7 +1502,7 @@ class Trade(ModelBase, LocalTrade): id: Mapped[int] = mapped_column(Integer, primary_key=True) # type: ignore orders: Mapped[List[Order]] = relationship( - "Order", order_by="Order.id", cascade="all, delete-orphan", lazy="selectin", + "Order", order_by="Order.id", cascade="all, delete-orphan", lazy="selection", innerjoin=True) # type: ignore custom_data: Mapped[List[_CustomData]] = relationship( "_CustomData", cascade="all, delete-orphan", diff --git a/freqtrade/plot/plotting.py b/freqtrade/plot/plotting.py index e0aa2437a..e5173a29e 100644 --- a/freqtrade/plot/plotting.py +++ b/freqtrade/plot/plotting.py @@ -445,7 +445,7 @@ def generate_candlestick_graph( ) -> go.Figure: """ Generate the graph from the data generated by Backtesting or from DB - Volume will always be ploted in row2, so Row 1 and 3 are to our disposal for custom indicators + Volume will always be plotted in row2, so Row 1 and 3 are to our disposal for custom indicators :param pair: Pair to Display on the graph :param data: OHLCV DataFrame containing indicators and entry/exit signals :param trades: All trades created @@ -673,7 +673,7 @@ def plot_profit(config: Config) -> None: """ Plots the total profit for all pairs. Note, the profit calculation isn't realistic. - But should be somewhat proportional, and therefor useful + But should be somewhat proportional, and therefore useful in helping out to find a good algorithm. """ if 'timeframe' not in config: diff --git a/freqtrade/plugins/pairlist/RemotePairList.py b/freqtrade/plugins/pairlist/RemotePairList.py index 78e3c8351..0fe67968f 100644 --- a/freqtrade/plugins/pairlist/RemotePairList.py +++ b/freqtrade/plugins/pairlist/RemotePairList.py @@ -116,7 +116,7 @@ class RemotePairList(IPairList): "default": "filter", "options": ["filter", "append"], "description": "Processing mode", - "help": "Append pairs to incomming pairlist or filter them?", + "help": "Append pairs to incoming pairlist or filter them?", }, **IPairList.refresh_period_parameter(), "keep_pairlist_on_failure": { diff --git a/freqtrade/plugins/pairlist/VolumePairList.py b/freqtrade/plugins/pairlist/VolumePairList.py index 25e0a855d..acc6ad7e1 100644 --- a/freqtrade/plugins/pairlist/VolumePairList.py +++ b/freqtrade/plugins/pairlist/VolumePairList.py @@ -65,7 +65,7 @@ class VolumePairList(IPairList): self._tf_in_min = timeframe_to_minutes(self._lookback_timeframe) _tf_in_sec = self._tf_in_min * 60 - # wether to use range lookback or not + # whether to use range lookback or not self._use_range = (self._tf_in_min > 0) & (self._lookback_period > 0) if self._use_range & (self._refresh_period < _tf_in_sec): diff --git a/freqtrade/plugins/protections/iprotection.py b/freqtrade/plugins/protections/iprotection.py index 6057cbc29..378eccfef 100644 --- a/freqtrade/plugins/protections/iprotection.py +++ b/freqtrade/plugins/protections/iprotection.py @@ -110,7 +110,7 @@ class IProtection(LoggingMixin, ABC): Get lock end time """ max_date: datetime = max([trade.close_date for trade in trades if trade.close_date]) - # comming from Database, tzinfo is not set. + # coming from Database, tzinfo is not set. if max_date.tzinfo is None: max_date = max_date.replace(tzinfo=timezone.utc) diff --git a/freqtrade/resolvers/iresolver.py b/freqtrade/resolvers/iresolver.py index 1557f0f35..6295e845d 100644 --- a/freqtrade/resolvers/iresolver.py +++ b/freqtrade/resolvers/iresolver.py @@ -163,7 +163,7 @@ class IResolver: def load_object(cls, object_name: str, config: Config, *, kwargs: dict, extra_dir: Optional[str] = None) -> Any: """ - Search and loads the specified object as configured in hte child class. + Search and loads the specified object as configured in the child class. :param object_name: name of the module to import :param config: configuration dictionary :param extra_dir: additional directory to search for the given pairlist diff --git a/freqtrade/rpc/external_message_consumer.py b/freqtrade/rpc/external_message_consumer.py index 200d408e6..bb0b3139f 100644 --- a/freqtrade/rpc/external_message_consumer.py +++ b/freqtrade/rpc/external_message_consumer.py @@ -237,7 +237,7 @@ class ExternalMessageConsumer: continue except Exception as e: - # An unforseen error has occurred, log and continue + # An unforeseen error has occurred, log and continue logger.error("Unexpected error has occurred:") logger.exception(e) await asyncio.sleep(self.sleep_time) @@ -387,7 +387,7 @@ class ExternalMessageConsumer: ) if not did_append: - # We want an overlap in candles incase some data has changed + # We want an overlap in candles in case some data has changed n_missing += 1 # Set to None for all candles if we missed a full df's worth of candles n_missing = n_missing if n_missing < FULL_DATAFRAME_THRESHOLD else 1500 diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index a2a02cc68..58705b2cc 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -301,7 +301,7 @@ class RPC: for oo in trade.open_orders ] - # exemple: '*.**.**' trying to enter, exit and exit with 3 different orders + # example: '*.**.**' trying to enter, exit and exit with 3 different orders active_attempt_side_symbols_str = '.'.join(active_attempt_side_symbols) detail_trade = [ diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index 94fe8c22f..8121c4be6 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -488,7 +488,7 @@ class Telegram(RPCHandler): elif msg['type'] == RPCMessageType.WARNING: message = f"\N{WARNING SIGN} *Warning:* `{msg['status']}`" elif msg['type'] == RPCMessageType.EXCEPTION: - # Errors will contain exceptions, which are wrapped in tripple ticks. + # Errors will contain exceptions, which are wrapped in triple ticks. message = f"\N{WARNING SIGN} *ERROR:* \n {msg['status']}" elif msg['type'] == RPCMessageType.STARTUP: diff --git a/freqtrade/strategy/strategy_helper.py b/freqtrade/strategy/strategy_helper.py index b0fc538ca..5085063a3 100644 --- a/freqtrade/strategy/strategy_helper.py +++ b/freqtrade/strategy/strategy_helper.py @@ -78,7 +78,7 @@ def merge_informative_pair(dataframe: pd.DataFrame, informative: pd.DataFrame, # all indicators on the informative sample MUST be calculated before this point if ffill: # https://pandas.pydata.org/docs/user_guide/merging.html#timeseries-friendly-merging - # merge_ordered - ffill method is 2.5x faster than seperate ffill() + # merge_ordered - ffill method is 2.5x faster than separate ffill() dataframe = pd.merge_ordered(dataframe, informative, fill_method="ffill", left_on='date', right_on=date_merge, how='left') else: diff --git a/freqtrade/templates/strategy_subtemplates/strategy_methods_advanced.j2 b/freqtrade/templates/strategy_subtemplates/strategy_methods_advanced.j2 index 541c26e87..1783e818c 100644 --- a/freqtrade/templates/strategy_subtemplates/strategy_methods_advanced.j2 +++ b/freqtrade/templates/strategy_subtemplates/strategy_methods_advanced.j2 @@ -3,7 +3,7 @@ def bot_loop_start(self, current_time: datetime, **kwargs) -> None: """ Called at the start of the bot iteration (one loop). Might be used to perform pair-independent tasks - (e.g. gather some remote ressource for comparison) + (e.g. gather some remote resource for comparison) For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/ diff --git a/freqtrade/wallets.py b/freqtrade/wallets.py index 0d22feb36..96274e7fc 100644 --- a/freqtrade/wallets.py +++ b/freqtrade/wallets.py @@ -306,7 +306,7 @@ class Wallets: :raise: DependencyException if the available stake amount is too low """ stake_amount: float - # Ensure wallets are uptodate. + # Ensure wallets are up-to-date. if update: self.update() val_tied_up = Trade.total_open_trades_stakes() diff --git a/freqtrade/worker.py b/freqtrade/worker.py index fb89e7a2d..e9dbfa74b 100644 --- a/freqtrade/worker.py +++ b/freqtrade/worker.py @@ -137,7 +137,7 @@ class Worker: Throttles the given callable that it takes at least `min_secs` to finish execution. :param func: Any callable - :param throttle_secs: throttling interation execution time limit in seconds + :param throttle_secs: throttling iteration execution time limit in seconds :param timeframe: ensure iteration is executed at the beginning of the next candle. :param timeframe_offset: offset in seconds to apply to the next candle time. :return: Any (result of execution of func) diff --git a/scripts/ws_client.py b/scripts/ws_client.py index 5d27f512e..cf0d0c016 100755 --- a/scripts/ws_client.py +++ b/scripts/ws_client.py @@ -191,7 +191,7 @@ class ClientProtocol: self.logger.info("Empty DataFrame") async def _handle_default(self, name, type, data): - self.logger.info("Unkown message of type {type} received...") + self.logger.info("Unknown message of type {type} received...") self.logger.info(data) @@ -277,7 +277,7 @@ async def create_client( continue except Exception as e: - # An unforseen error has occurred, log and try reconnecting again + # An unforeseen error has occurred, log and try reconnecting again logger.error("Unexpected error has occurred:") logger.exception(e) diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index 789535a46..630950c81 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -1609,4 +1609,4 @@ def test_start_show_config(capsys, caplog): assert "Your combined configuration is:" in captured.out assert '"max_open_trades":' in captured.out assert '"secret": "REDACTED"' not in captured.out - assert log_has_re(r'Sensitive information will be shown in the upcomming output.*', caplog) + assert log_has_re(r'Sensitive information will be shown in the upcoming output.*', caplog) diff --git a/tests/conftest.py b/tests/conftest.py index d894a7908..a1baee706 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -49,7 +49,7 @@ def pytest_addoption(parser): def pytest_configure(config): config.addinivalue_line( - "markers", "longrun: mark test that is running slowly and should not be run regularily" + "markers", "longrun: mark test that is running slowly and should not be run regularly" ) if not config.option.longrun: setattr(config.option, 'markexpr', 'not longrun') diff --git a/tests/data/test_datahandler.py b/tests/data/test_datahandler.py index 25854b261..97c9e29ac 100644 --- a/tests/data/test_datahandler.py +++ b/tests/data/test_datahandler.py @@ -251,7 +251,7 @@ def test_datahandler__check_empty_df(testdatadir, caplog): # @pytest.mark.parametrize('datahandler', []) @pytest.mark.skip("All datahandlers currently support trades data.") def test_datahandler_trades_not_supported(datahandler, testdatadir, ): - # Currently disabled. Reenable should a new provider not support trades data. + # Currently disabled. Re-enable should a new provider not support trades data. dh = get_datahandler(testdatadir, datahandler) with pytest.raises(NotImplementedError): dh.trades_load('UNITTEST/ETH') diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py index df2da7a72..912d55adf 100644 --- a/tests/exchange/test_exchange.py +++ b/tests/exchange/test_exchange.py @@ -3830,7 +3830,7 @@ def test_ohlcv_candle_limit(default_conf, mocker, exchange_name): [ ("BTC/USDT", 'BTC', 'USDT', "binance", True, False, False, 'spot', {}, True), ("USDT/BTC", 'USDT', 'BTC', "binance", True, False, False, 'spot', {}, True), - # No seperating / + # No separating / ("BTCUSDT", 'BTC', 'USDT', "binance", True, False, False, 'spot', {}, True), ("BTCUSDT", None, "USDT", "binance", True, False, False, 'spot', {}, False), ("USDT/BTC", "BTC", None, "binance", True, False, False, 'spot', {}, False), @@ -4346,7 +4346,7 @@ def test_combine_funding_and_mark( ('binance', 0, 2, "2021-09-01 00:00:01", "2021-09-01 08:00:00", 30.0, -0.00091409999), ('binance', 0, 2, "2021-08-31 23:58:00", "2021-09-01 08:00:00", 30.0, -0.00091409999), ('binance', 0, 2, "2021-09-01 00:10:01", "2021-09-01 08:00:00", 30.0, -0.0002493), - # TODO: Uncoment once _calculate_funding_fees can pas time_in_ratio to exchange._get_funding_fee + # TODO: Uncomment once _calculate_funding_fees can pas time_in_ratio to exchange._get_funding_fee # ('kraken', "2021-09-01 00:00:00", "2021-09-01 08:00:00", 30.0, -0.0014937), # ('kraken', "2021-09-01 00:00:15", "2021-09-01 08:00:00", 30.0, -0.0008289), # ('kraken', "2021-09-01 01:00:14", "2021-09-01 08:00:00", 30.0, -0.0008289), @@ -4358,7 +4358,7 @@ def test_combine_funding_and_mark( ('gate', 0, 2, "2021-09-01 00:00:00", "2021-09-01 12:00:00", 30.0, -0.0009140999), ('gate', 1, 2, "2021-09-01 00:00:01", "2021-09-01 08:00:00", 30.0, -0.0002493), ('binance', 0, 2, "2021-09-01 00:00:00", "2021-09-01 08:00:00", 50.0, -0.0015235), - # TODO: Uncoment once _calculate_funding_fees can pas time_in_ratio to exchange._get_funding_fee + # TODO: Uncomment once _calculate_funding_fees can pas time_in_ratio to exchange._get_funding_fee # ('kraken', "2021-09-01 00:00:00", "2021-09-01 08:00:00", 50.0, -0.0024895), ]) def test__fetch_and_calculate_funding_fees( diff --git a/tests/freqai/test_freqai_datadrawer.py b/tests/freqai/test_freqai_datadrawer.py index 7e1a1c32e..548fad650 100644 --- a/tests/freqai/test_freqai_datadrawer.py +++ b/tests/freqai/test_freqai_datadrawer.py @@ -143,7 +143,7 @@ def test_get_timerange_from_backtesting_live_df_pred_not_found(mocker, freqai_co def test_set_initial_return_values(mocker, freqai_conf): """ Simple test of the set initial return values that ensures - we are concatening and ffilling values properly. + we are concatenating and ffilling values properly. """ strategy = get_patched_freqai_strategy(mocker, freqai_conf) diff --git a/tests/freqtradebot/test_freqtradebot.py b/tests/freqtradebot/test_freqtradebot.py index 0106e1b77..a6682fedf 100644 --- a/tests/freqtradebot/test_freqtradebot.py +++ b/tests/freqtradebot/test_freqtradebot.py @@ -285,7 +285,7 @@ def test_edge_overrides_stoploss(limit_order, fee, caplog, mocker, 'last': enter_price * buy_price_mult, }) - # stoploss shoud be hit + # stoploss should be hit assert freqtrade.handle_trade(trade) is not ignore_strat_sl if not ignore_strat_sl: assert log_has_re('Exit for NEO/BTC detected. Reason: stop_loss.*', caplog) @@ -1398,7 +1398,7 @@ def test_update_trade_state_sell( assert order.status == 'open' freqtrade.update_trade_state(trade, trade.open_orders_ids[-1], l_order) assert trade.amount == l_order['amount'] - # Wallet needs to be updated after closing a limit-sell order to reenable buying + # Wallet needs to be updated after closing a limit-sell order to re-enable buying assert wallet_mock.call_count == 1 assert not trade.is_open # Order is updated by update_trade_state @@ -3240,7 +3240,7 @@ def test_locked_pairs(default_conf_usdt, ticker_usdt, fee, ) trade.close(ticker_usdt_sell_down()['bid']) assert freqtrade.strategy.is_pair_locked(trade.pair, side='*') - # Boths sides are locked + # Both sides are locked assert freqtrade.strategy.is_pair_locked(trade.pair, side='long') assert freqtrade.strategy.is_pair_locked(trade.pair, side='short') @@ -4829,7 +4829,7 @@ def test_update_funding_fees( freqtrade.execute_entry('ETH/USDT', 123, is_short=is_short) freqtrade.execute_entry('LTC/USDT', 2.0, is_short=is_short) freqtrade.execute_entry('XRP/USDT', 123, is_short=is_short) - multipl = 1 if is_short else -1 + multiple = 1 if is_short else -1 trades = Trade.get_open_trades() assert len(trades) == 3 for trade in trades: @@ -4847,7 +4847,7 @@ def test_update_funding_fees( assert trade.funding_fees == pytest.approx(sum( trade.amount * mark_prices[trade.pair].iloc[1:2]['open'] * - funding_rates[trade.pair].iloc[1:2]['open'] * multipl + funding_rates[trade.pair].iloc[1:2]['open'] * multiple )) else: @@ -4859,7 +4859,7 @@ def test_update_funding_fees( trade.amount * mark_prices[trade.pair].iloc[1:2]['open'] * funding_rates[trade.pair].iloc[1:2]['open'] * - multipl + multiple )) diff --git a/tests/optimize/test_backtest_detail.py b/tests/optimize/test_backtest_detail.py index 71cb8ff34..54468910c 100644 --- a/tests/optimize/test_backtest_detail.py +++ b/tests/optimize/test_backtest_detail.py @@ -107,7 +107,7 @@ tc5 = BTContainer(data=[ trades=[BTrade(exit_reason=ExitType.ROI, open_tick=1, close_tick=3)] ) -# Test 6: Drops 3% / Recovers 6% Positive / Closes 1% positve, Stop-Loss triggers 2% Loss +# Test 6: Drops 3% / Recovers 6% Positive / Closes 1% positive, Stop-Loss triggers 2% Loss # stop-loss: 2% ROI: 5% tc6 = BTContainer(data=[ # D O H L C V EL XL ES Xs BT @@ -121,7 +121,7 @@ tc6 = BTContainer(data=[ trades=[BTrade(exit_reason=ExitType.STOP_LOSS, open_tick=1, close_tick=2)] ) -# Test 7: 6% Positive / 1% Negative / Close 1% Positve, ROI Triggers 3% Gain +# Test 7: 6% Positive / 1% Negative / Close 1% Positive, ROI Triggers 3% Gain # stop-loss: 2% ROI: 3% tc7 = BTContainer(data=[ # D O H L C V EL XL ES Xs BT diff --git a/tests/optimize/test_backtesting_adjust_position.py b/tests/optimize/test_backtesting_adjust_position.py index 322b292ff..983e4b47f 100644 --- a/tests/optimize/test_backtesting_adjust_position.py +++ b/tests/optimize/test_backtesting_adjust_position.py @@ -87,9 +87,9 @@ def test_backtest_position_adjustment(default_conf, fee, mocker, testdatadir) -> for _, t in results.iterrows(): ln = data_pair.loc[data_pair["date"] == t["open_date"]] - # Check open trade rate alignes to open rate + # Check open trade rate aligns to open rate assert ln is not None - # check close trade rate alignes to close rate or is between high and low + # check close trade rate aligns to close rate or is between high and low ln = data_pair.loc[data_pair["date"] == t["close_date"]] assert (round(ln.iloc[0]["open"], 6) == round(t["close_rate"], 6) or round(ln.iloc[0]["low"], 6) < round( diff --git a/tests/optimize/test_lookahead_analysis.py b/tests/optimize/test_lookahead_analysis.py index d7c4bc6fa..14840428d 100644 --- a/tests/optimize/test_lookahead_analysis.py +++ b/tests/optimize/test_lookahead_analysis.py @@ -152,7 +152,7 @@ def test_lookahead_helper_text_table_lookahead_analysis_instances(lookahead_conf assert data[0][2].__contains__('too few trades') assert len(data[0]) == 3 - # now check for an error which occured after enough trades + # now check for an error which occurred after enough trades analysis.total_signals = 12 analysis.false_entry_signals = 11 analysis.false_exit_signals = 10 diff --git a/tests/optimize/test_optimize_reports.py b/tests/optimize/test_optimize_reports.py index e573703c2..f38fcb885 100644 --- a/tests/optimize/test_optimize_reports.py +++ b/tests/optimize/test_optimize_reports.py @@ -129,7 +129,7 @@ def test_generate_backtest_stats(default_conf, testdatadir, tmp_path): assert strat_stats['backtest_start'] == min_date.strftime(DATETIME_PRINT_FORMAT) assert strat_stats['backtest_end'] == max_date.strftime(DATETIME_PRINT_FORMAT) assert strat_stats['total_trades'] == len(results['DefStrat']['results']) - # Above sample had no loosing trade + # Above sample had no losing trade assert strat_stats['max_drawdown_account'] == 0.0 # Retry with losing trade diff --git a/tests/persistence/test_persistence.py b/tests/persistence/test_persistence.py index 18f28da2b..a9c27a9b5 100644 --- a/tests/persistence/test_persistence.py +++ b/tests/persistence/test_persistence.py @@ -1871,7 +1871,7 @@ def test_get_trades__query(fee, is_short): # without orders there should be no join issued. query1 = Trade.get_trades_query([], include_orders=False) - # Empty "with-options -> default - selectin" + # Empty "with-options -> default - selection" assert query._with_options == () assert query1._with_options != () diff --git a/tests/plugins/test_pairlist.py b/tests/plugins/test_pairlist.py index 39f48f454..083640b80 100644 --- a/tests/plugins/test_pairlist.py +++ b/tests/plugins/test_pairlist.py @@ -605,7 +605,7 @@ def test_VolumePairList_whitelist_gen(mocker, whitelist_conf, shitcoinmarkets, t ([{"method": "VolumePairList", "number_assets": 5, "sort_key": "quoteVolume", "lookback_days": 1}], "BTC", "binance", "default_refresh_too_short"), # OperationalException expected - # ambigous configuration with lookback days and period + # ambiguous configuration with lookback days and period ([{"method": "VolumePairList", "number_assets": 5, "sort_key": "quoteVolume", "lookback_days": 1, "lookback_period": 1}], "BTC", "binance", "lookback_days_and_period"), # OperationalException expected @@ -617,7 +617,7 @@ def test_VolumePairList_whitelist_gen(mocker, whitelist_conf, shitcoinmarkets, t ([{"method": "VolumePairList", "number_assets": 5, "sort_key": "quoteVolume", "lookback_timeframe": "1m", "lookback_period": 2000, "refresh_period": 3600}], "BTC", "binance", "lookback_exceeds_exchange_request_size"), # OperationalException expected - # expecing pairs as given + # expecting pairs as given ([{"method": "VolumePairList", "number_assets": 5, "sort_key": "quoteVolume", "lookback_timeframe": "1d", "lookback_period": 1, "refresh_period": 86400}], "BTC", "binance", ['LTC/BTC', 'ETH/BTC', 'TKN/BTC', 'XRP/BTC', 'HOT/BTC']), diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index 9e5c820c3..0865ec1eb 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -1619,7 +1619,7 @@ def test_api_pair_history(botclient, mocker): assert 'data' in result data = result['data'] assert len(data) == 289 - # analyed DF has 30 columns + # analyzed DF has 30 columns assert len(result['columns']) == 30 assert len(data[0]) == 30 date_col_idx = [idx for idx, c in enumerate(result['columns']) if c == 'date'][0] diff --git a/tests/strategy/test_interface.py b/tests/strategy/test_interface.py index dbff49b57..a53eead95 100644 --- a/tests/strategy/test_interface.py +++ b/tests/strategy/test_interface.py @@ -81,7 +81,7 @@ def test_returns_latest_signal(ohlcv_history): assert _STRATEGY.get_entry_signal('ETH/BTC', '5m', mocked_history) == (None, None) _STRATEGY.config['trading_mode'] = 'futures' - # Short signal get's ignored as can_short is not set. + # Short signal gets ignored as can_short is not set. assert _STRATEGY.get_entry_signal('ETH/BTC', '5m', mocked_history) == (None, None) _STRATEGY.can_short = True diff --git a/tests/strategy/test_strategy_helpers.py b/tests/strategy/test_strategy_helpers.py index 22c7359bf..b7fb7dea1 100644 --- a/tests/strategy/test_strategy_helpers.py +++ b/tests/strategy/test_strategy_helpers.py @@ -253,7 +253,7 @@ def test_stoploss_from_open(side, profitrange): assert stoploss >= 0 # Technically the formula can yield values greater than 1 for shorts - # eventhough it doesn't make sense because the position would be liquidated + # even though it doesn't make sense because the position would be liquidated if side == 'long': assert stoploss <= 1 diff --git a/tests/test_plotting.py b/tests/test_plotting.py index 7f80a8588..185bfeaf1 100644 --- a/tests/test_plotting.py +++ b/tests/test_plotting.py @@ -125,7 +125,7 @@ def test_add_areas(default_conf, testdatadir, caplog): assert fig == fig2 assert log_has_re(r'Indicator "no_indicator" ignored\..*', caplog) - # everythin given in plot config, row 3 + # everything given in plot config, row 3 fig3 = add_areas(fig, 3, data, indicators) figure = fig3.layout.figure fill_macd = find_trace_in_fig_data(figure.data, "MACD Fill") @@ -495,7 +495,7 @@ def test_plot_profit(default_conf, mocker, testdatadir): # no main_plot, adds empty main_plot ([], [], {'subplots': {'RSI': {'rsi': {'color': 'red'}}}}, {'main_plot': {}, 'subplots': {'RSI': {'rsi': {'color': 'red'}}}}), - # indicator 1 / 2 should have prevelance + # indicator 1 / 2 should have prevalence (['sma', 'ema3'], ['macd'], {'main_plot': {'sma': {}}, 'subplots': {'RSI': {'rsi': {'color': 'red'}}}}, {'main_plot': {'sma': {}, 'ema3': {}}, 'subplots': {'Other': {'macd': {}}}}