Skip to content

Commit 59f4076

Browse files
committed
Add order_executors to templates
1 parent 4874e1b commit 59f4076

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
from investing_bot_framework.core.context import BotContext
2-
from investing_bot_framework.core.context.states.setup_state import SetupState
3-
from investing_bot_framework.core.context.states.data_providing_state import DataProvidingState
4-
from investing_bot_framework.core.context.states.strategy_state import StrategyState
2+
from investing_bot_framework.core.states.templates.setup_state import SetupState
3+
from investing_bot_framework.core.states.templates.data_providing_state import DataProvidingState
4+
from investing_bot_framework.core.states.templates.strategy_state import StrategyState
5+
from investing_bot_framework.core.states.templates.ordering_state import OrderingState
56

67
# Import custom components
78
from bot.data_providers.data_providers import MyDataProvider
89
from bot.strategies.strategies import MyStrategy
10+
from bot.order_executors.order_executors import MyOrderExecutor
911

1012
# Register Initial state
1113
context = BotContext()
@@ -16,3 +18,6 @@ DataProvidingState.register_data_providers([MyDataProvider()])
1618

1719
# Register all strategies
1820
StrategyState.register_strategies([MyStrategy()])
21+
22+
# Register all order executors
23+
OrderingState.register_order_executors([MyOrderExecutor()])

investing_bot_framework/templates/bot_project_directory/bot_project_template/configuration/settings.py-template

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ BASE_DIR = str(Path(__file__).parent.parent)
1212

1313
LOG_FILE_NAME = 'log'
1414

15-
LOG_PATH = "{}{}.log".format(BASE_DIR, LOG_FILE_NAME)
15+
LOG_DIR = '{}/logs'.format(BASE_DIR)
16+
17+
LOG_PATH = "{}/{}.log".format(LOG_DIR, LOG_FILE_NAME)
18+
19+
if not os.path.isdir(LOG_DIR):
20+
os.mkdir(LOG_DIR)
1621

1722
if DEBUG:
1823
logging_level = "DEBUG"

investing_bot_framework/templates/bot_project_directory/bot_project_template/order_executors/__init__.py-template

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from investing_bot_framework.core.order_executors import OrderExecutor
2+
3+
4+
class MyOrderExecutor(OrderExecutor):
5+
6+
def execute_orders(self) -> None:
7+
pass

investing_bot_framework/templates/bot_project_directory/bot_project_template/strategies/strategies.py-templace renamed to investing_bot_framework/templates/bot_project_directory/bot_project_template/strategies/strategies.py-template

File renamed without changes.

0 commit comments

Comments
 (0)