diff --git a/martin_binance/__init__.py b/martin_binance/__init__.py index d948a4b..55a5cb3 100644 --- a/martin_binance/__init__.py +++ b/martin_binance/__init__.py @@ -6,7 +6,7 @@ __author__ = "Jerry Fedorenko" __copyright__ = "Copyright © 2021 Jerry Fedorenko aka VM" __license__ = "MIT" -__version__ = "1.3.1b5" +__version__ = "1.3.1" __maintainer__ = "Jerry Fedorenko" __contact__ = "https://github.com/DogsTailFarmer" @@ -30,6 +30,7 @@ LAST_STATE_PATH = None BACKTEST_PATH = None + def init(): if CONFIG_FILE.exists(): print(f"Client config found at {CONFIG_FILE}") @@ -52,4 +53,4 @@ def init(): if __name__ == '__main__': - init() \ No newline at end of file + init() diff --git a/martin_binance/backtest/OoTSP.py b/martin_binance/backtest/OoTSP.py index 39190bc..ffeebd1 100644 --- a/martin_binance/backtest/OoTSP.py +++ b/martin_binance/backtest/OoTSP.py @@ -6,7 +6,7 @@ __author__ = "Jerry Fedorenko" __copyright__ = "Copyright © 2021 Jerry Fedorenko aka VM" __license__ = "MIT" -__version__ = "1.3.1b5" +__version__ = "1.3.1" __maintainer__ = "Jerry Fedorenko" __contact__ = "https://github.com/DogsTailFarmer" @@ -21,6 +21,7 @@ PARAMS_FLOAT = ['PRICE_SHIFT', 'KBB'] + def try_trade(mbs, **kwargs): for key, value in kwargs.items(): print(key, value) @@ -64,7 +65,7 @@ def objective(trial): message="Enter number of cycles, from 50 to 500", ignore=lambda x: x["mode"] == "Plot from saved", default='150', - validate=lambda _, c: 2 <= int(c) < 500, + validate=lambda _, c: 10 <= int(c) < 500, ), ] diff --git a/martin_binance/executor.py b/martin_binance/executor.py index a7cb1dd..43ef175 100644 --- a/martin_binance/executor.py +++ b/martin_binance/executor.py @@ -4,7 +4,7 @@ __author__ = "Jerry Fedorenko" __copyright__ = "Copyright © 2021 Jerry Fedorenko aka VM" __license__ = "MIT" -__version__ = "1.3.0-4" +__version__ = "1.3.1" __maintainer__ = "Jerry Fedorenko" __contact__ = 'https://github.com/DogsTailFarmer' ################################################################## @@ -1675,7 +1675,7 @@ def collect_assets(self) -> (): fs = f2d(0) return ff, fs - def message_log(self, msg: str, log_level=LogLevel.INFO, tlg: bool = False, color=Style.WHITE) -> None: + def message_log(self, msg: str, log_level=LogLevel.INFO, tlg=False, color=Style.WHITE) -> None: if tlg and color == Style.WHITE: color = Style.B_WHITE if log_level in (LogLevel.ERROR, LogLevel.CRITICAL): diff --git a/martin_binance/margin_wrapper.py b/martin_binance/margin_wrapper.py index 0249e4a..049805e 100644 --- a/martin_binance/margin_wrapper.py +++ b/martin_binance/margin_wrapper.py @@ -4,7 +4,7 @@ __author__ = "Jerry Fedorenko" __copyright__ = "Copyright © 2021 Jerry Fedorenko aka VM" __license__ = "MIT" -__version__ = "1.3.0-3" +__version__ = "1.3.1" __maintainer__ = "Jerry Fedorenko" __contact__ = "https://github.com/DogsTailFarmer" @@ -842,7 +842,8 @@ def session_data_handler(cls): ds = pd.Series(cls.s_order_book) ds.to_pickle(Path(raw_path, "order_book.pkl")) # Save klines snapshot - json.dump(cls.klines, open(Path(raw_path, "klines.json"), 'w')) + with open(Path(raw_path, "klines.json"), 'w') as f: + json.dump(cls.klines, f) # Save candles for k, v in cls.candles.items(): ds = pd.Series(v) diff --git a/pyproject.toml b/pyproject.toml index c9a0a73..636884a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,8 @@ dependencies = [ "pandas==2.0.2", "dash==2.10.2", "future==0.18.3", - "inquirer==3.1.3" + "inquirer==3.1.3", + "scikit-learn==1.2.2", ] [tool.flit.module] diff --git a/requirements.txt b/requirements.txt index 66bf06d..1996cca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,4 +16,5 @@ plotly==5.15.0 pandas==2.0.2 dash==2.10.2 future==0.18.3 -inquirer==3.1.3 \ No newline at end of file +inquirer==3.1.3 +scikit-learn==1.2.2 \ No newline at end of file