2
0
forked from kodorvan/stcs

Added trigger price

This commit is contained in:
algizn97
2025-09-19 14:45:34 +05:00
parent 29bb6bd0a8
commit 49d4bb26bf
3 changed files with 36 additions and 5 deletions

View File

@@ -153,7 +153,8 @@ class User_Main_Settings(Base):
martingale_step = mapped_column(Integer(), default=1)
maximal_quantity = mapped_column(Integer(), default=10)
entry_order_type = mapped_column(String(10), default='Market')
limit_order_price = mapped_column(Numeric(18, 15), nullable=True)
limit_order_price = mapped_column(Numeric(18, 15), nullable=True, default=0)
trigger_price = mapped_column(Numeric(18, 15), nullable=True, default=0)
last_side = mapped_column(String(10), default='Buy')
trading_start_stop = mapped_column(Integer(), default=0)
@@ -306,3 +307,10 @@ async def async_main():
if not result.first():
logger.info("Заполение таблицы последнего направления")
await conn.execute(User_Main_Settings.__table__.insert().values(last_side=side))
order_type = ['Limit', 'Market']
for typ in order_type:
result = await conn.execute(select(User_Main_Settings).where(User_Main_Settings.entry_order_type == typ))
if not result.first():
logger.info("Заполение таблицы типов ордеров")
await conn.execute(User_Main_Settings.__table__.insert().values(entry_order_type=typ))