mirror of
https://github.com/Ichinga-Samuel/aiomql.git
synced 2026-08-22 16:28:08 +00:00
v4
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
line-length = 150
|
||||||
|
target-version = "py311"
|
||||||
|
[format]
|
||||||
|
skip-magic-trailing-comma=true
|
||||||
@@ -4,9 +4,7 @@ from typing import Type, Self, Iterable
|
|||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
from pandas import DataFrame, Series
|
from pandas import DataFrame, Series
|
||||||
import pandas as pd
|
|
||||||
import pandas_ta as ta
|
import pandas_ta as ta
|
||||||
import mplfinance as mplt
|
|
||||||
|
|
||||||
from ..core.constants import TimeFrame
|
from ..core.constants import TimeFrame
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ async def test_bot():
|
|||||||
symbols = [ForexSymbol(name=sym) for sym in syms]
|
symbols = [ForexSymbol(name=sym) for sym in syms]
|
||||||
strategies = [Chaos(symbol=symbol, name="test_chaos") for symbol in symbols]
|
strategies = [Chaos(symbol=symbol, name="test_chaos") for symbol in symbols]
|
||||||
bot = Bot()
|
bot = Bot()
|
||||||
assert bot.config.shutdown is False
|
bot.config.task_queue.worker_timeout = 2
|
||||||
bot.executor.timeout = 10
|
bot.executor.timeout = 10
|
||||||
bot.add_strategies(strategies=strategies)
|
bot.add_strategies(strategies=strategies)
|
||||||
await bot.initialize()
|
await bot.initialize()
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ def test_bot_sync():
|
|||||||
symbols = [ForexSymbol(name=sym) for sym in syms]
|
symbols = [ForexSymbol(name=sym) for sym in syms]
|
||||||
strategies = [Chaos(symbol=symbol, name="test_chaos") for symbol in symbols]
|
strategies = [Chaos(symbol=symbol, name="test_chaos") for symbol in symbols]
|
||||||
bot = Bot()
|
bot = Bot()
|
||||||
assert bot.config.shutdown is False
|
bot.config.task_queue.worker_timeout = 2
|
||||||
bot.executor.timeout = 10
|
bot.executor.timeout = 10
|
||||||
bot.add_strategies(strategies=strategies)
|
bot.add_strategies(strategies=strategies)
|
||||||
bot.initialize_sync()
|
bot.initialize_sync()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from datetime import datetime, UTC
|
from datetime import datetime, UTC
|
||||||
|
from math import ceil
|
||||||
from aiomql import TimeFrame
|
from aiomql import TimeFrame
|
||||||
from aiomql.core.backtesting import BackTestEngine
|
from aiomql.core.backtesting import BackTestEngine
|
||||||
from aiomql.core.backtesting.get_data import GetData
|
from aiomql.core.backtesting.get_data import GetData
|
||||||
@@ -304,7 +304,7 @@ class TestBackTestEngine:
|
|||||||
price_open=sym_info2.ask,
|
price_open=sym_info2.ask,
|
||||||
price_close=tp2,
|
price_close=tp2,
|
||||||
)
|
)
|
||||||
assert profit == profit2
|
assert ceil(profit) == ceil(profit2)
|
||||||
|
|
||||||
async def test_order_margin(self, bte2):
|
async def test_order_margin(self, bte2):
|
||||||
moment = datetime(2024, 2, 3, 12, 12, tzinfo=UTC)
|
moment = datetime(2024, 2, 3, 12, 12, tzinfo=UTC)
|
||||||
|
|||||||
Reference in New Issue
Block a user