mirror of
https://github.com/Ichinga-Samuel/aiomql.git
synced 2026-07-27 20:27:43 +00:00
Merge branch 'main' into dev
This commit is contained in:
@@ -105,8 +105,6 @@ class BackTester:
|
||||
Args:
|
||||
coroutine (Coroutine): A coroutine to be executed
|
||||
on_separate_thread (bool): Run the coroutine
|
||||
**kwargs (dict): keyword arguments for the coroutine
|
||||
|
||||
Returns:
|
||||
|
||||
"""
|
||||
@@ -200,6 +198,7 @@ class BackTester:
|
||||
"volume_real": tick.volume_real,
|
||||
}
|
||||
strategy.symbol.set_attributes(**info)
|
||||
strategy.symbol.initialized = True
|
||||
self.executor.add_strategy(strategy=strategy)
|
||||
return True
|
||||
except Exception as err:
|
||||
|
||||
@@ -105,7 +105,6 @@ class Bot:
|
||||
|
||||
Args:
|
||||
function (Callable): A function to be executed
|
||||
**kwargs: Keyword arguments for the function
|
||||
"""
|
||||
self.executor.add_function(function=function, kwargs=kwargs)
|
||||
|
||||
@@ -115,8 +114,6 @@ class Bot:
|
||||
Args:
|
||||
coroutine (Coroutine): A coroutine to be executed
|
||||
on_separate_thread (bool): Run the coroutine
|
||||
**kwargs (dict): keyword arguments for the coroutine
|
||||
|
||||
Returns:
|
||||
|
||||
"""
|
||||
@@ -189,6 +186,7 @@ class Bot:
|
||||
info["select"] = select
|
||||
tick = Tick(**tick._asdict())
|
||||
strategy.symbol.tick = tick
|
||||
strategy.symbol.initialized = True
|
||||
strategy.symbol.set_attributes(**info)
|
||||
self.executor.add_strategy(strategy=strategy)
|
||||
return True
|
||||
|
||||
@@ -27,7 +27,7 @@ class Symbol(_Base, SymbolInfo):
|
||||
Full properties are on the SymbolInfo Object.
|
||||
Make sure Symbol is always initialized with a name argument
|
||||
"""
|
||||
|
||||
initialized: bool
|
||||
tick: Tick
|
||||
account: Account
|
||||
|
||||
@@ -109,6 +109,7 @@ class Symbol(_Base, SymbolInfo):
|
||||
info_tick = await self.info_tick()
|
||||
await self.book_add()
|
||||
if info is not None and info_tick is not None:
|
||||
self.initialized = True
|
||||
return True
|
||||
logger.warning("Unable to initialize %s", self.name)
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user