Merge branch 'main' into dev

This commit is contained in:
Ichinga Samuel
2024-12-01 23:26:17 +01:00
3 changed files with 4 additions and 6 deletions
+1 -2
View File
@@ -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:
+1 -3
View File
@@ -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
+2 -1
View File
@@ -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