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