diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..f60458b --- /dev/null +++ b/ruff.toml @@ -0,0 +1,4 @@ +line-length = 150 +target-version = "py311" +[format] +skip-magic-trailing-comma=true diff --git a/src/aiomql/lib/candle.py b/src/aiomql/lib/candle.py index 7f97d8e..87ea65d 100644 --- a/src/aiomql/lib/candle.py +++ b/src/aiomql/lib/candle.py @@ -4,9 +4,7 @@ from typing import Type, Self, Iterable from logging import getLogger from pandas import DataFrame, Series -import pandas as pd import pandas_ta as ta -import mplfinance as mplt from ..core.constants import TimeFrame diff --git a/tests/live/integration/test_bot.py b/tests/live/integration/test_bot.py index c03203b..bbc679d 100644 --- a/tests/live/integration/test_bot.py +++ b/tests/live/integration/test_bot.py @@ -14,7 +14,7 @@ async def test_bot(): symbols = [ForexSymbol(name=sym) for sym in syms] strategies = [Chaos(symbol=symbol, name="test_chaos") for symbol in symbols] bot = Bot() - assert bot.config.shutdown is False + bot.config.task_queue.worker_timeout = 2 bot.executor.timeout = 10 bot.add_strategies(strategies=strategies) await bot.initialize() diff --git a/tests/live/integration/test_bot_sync.py b/tests/live/integration/test_bot_sync.py index 5b6c26f..9bf8a75 100644 --- a/tests/live/integration/test_bot_sync.py +++ b/tests/live/integration/test_bot_sync.py @@ -14,7 +14,7 @@ def test_bot_sync(): symbols = [ForexSymbol(name=sym) for sym in syms] strategies = [Chaos(symbol=symbol, name="test_chaos") for symbol in symbols] bot = Bot() - assert bot.config.shutdown is False + bot.config.task_queue.worker_timeout = 2 bot.executor.timeout = 10 bot.add_strategies(strategies=strategies) bot.initialize_sync() diff --git a/tests/live/unit/test_backtest_engine.py b/tests/live/unit/test_backtest_engine.py index 39e3034..9b83a03 100644 --- a/tests/live/unit/test_backtest_engine.py +++ b/tests/live/unit/test_backtest_engine.py @@ -1,5 +1,5 @@ from datetime import datetime, UTC - +from math import ceil from aiomql import TimeFrame from aiomql.core.backtesting import BackTestEngine from aiomql.core.backtesting.get_data import GetData @@ -304,7 +304,7 @@ class TestBackTestEngine: price_open=sym_info2.ask, price_close=tp2, ) - assert profit == profit2 + assert ceil(profit) == ceil(profit2) async def test_order_margin(self, bte2): moment = datetime(2024, 2, 3, 12, 12, tzinfo=UTC)