mirror of
https://github.com/Ichinga-Samuel/aiomql.git
synced 2026-08-20 07:18:08 +00:00
v4
This commit is contained in:
@@ -6,17 +6,19 @@ from aiomql.contrib.symbols import ForexSymbol
|
||||
|
||||
|
||||
async def test_bot():
|
||||
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||
syms = ['BTCUSD', 'SOLUSD', 'ETHUSD']
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
||||
)
|
||||
syms = ["BTCUSD", "SOLUSD", "ETHUSD"]
|
||||
symbols = [ForexSymbol(name=sym) for sym in syms]
|
||||
stgs = [Chaos(symbol=symbol, name='test_chaos') for symbol in symbols]
|
||||
strategies = [Chaos(symbol=symbol, name="test_chaos") for symbol in symbols]
|
||||
bot = Bot()
|
||||
assert bot.config.shutdown is False
|
||||
bot.executor.timeout = 30
|
||||
bot.add_strategies(strategies=stgs)
|
||||
bot.executor.timeout = 10
|
||||
bot.add_strategies(strategies=strategies)
|
||||
await bot.initialize()
|
||||
await bot.executor.execute()
|
||||
assert bot.executor.no_of_running_strategies == 3
|
||||
assert len(bot.executor.coroutines) == 1
|
||||
assert len(bot.executor.coroutine_threads) == 1
|
||||
assert bot.config.shutdown is True
|
||||
|
||||
Reference in New Issue
Block a user