fix app/telegram/handlers/handlers.py, fix app/telegram/functions/functions.py || change two buttons "Начать торговлю" || fix text registration message, fix text profile || delete app/services/Bybit/config.py || delete comments
This commit is contained in:
@@ -71,7 +71,7 @@ async def contract_long(tg_id, message, margin_mode):
|
||||
setMarginMode=margin_mode # margin_type
|
||||
)
|
||||
|
||||
martingale_factor = float(data_main_stgs['martingale_factor']) # Исправлено: было maximal_quantity
|
||||
martingale_factor = float(data_main_stgs['martingale_factor'])
|
||||
max_martingale_steps = int(data_main_stgs['maximal_quantity'])
|
||||
starting_quantity = float(data_main_stgs['starting_quantity'])
|
||||
max_risk_percent = float(data_risk_management_stgs['max_risk_deal'])
|
||||
@@ -172,23 +172,7 @@ async def contract_long(tg_id, message, margin_mode):
|
||||
orderLinkId=f"deal_{SYMBOL}_{time.time()}"
|
||||
)
|
||||
|
||||
await info_access_open_deal(message, SYMBOL, data_main_stgs['trading_mode'], margin_mode, data_main_stgs['size_leverage'], next_quantity)
|
||||
|
||||
print(f'''
|
||||
=====================
|
||||
===================
|
||||
===================
|
||||
===================
|
||||
=================
|
||||
|
||||
{r}
|
||||
|
||||
===============
|
||||
===============
|
||||
=============
|
||||
===============
|
||||
==============
|
||||
''')
|
||||
await info_access_open_deal(message, SYMBOL, data_main_stgs['trading_mode'], margin_mode, data_main_stgs['size_leverage'], next_quantity)
|
||||
|
||||
except exceptions.InvalidRequestError as e:
|
||||
await message.answer('Недостаточно баланса')
|
||||
@@ -225,7 +209,7 @@ async def contract_short(tg_id, message, margin_mode):
|
||||
setMarginMode=margin_mode # margin_type
|
||||
)
|
||||
|
||||
martingale_factor = float(data_main_stgs['martingale_factor']) # Исправлено: было maximal_quantity
|
||||
martingale_factor = float(data_main_stgs['martingale_factor'])
|
||||
max_martingale_steps = int(data_main_stgs['maximal_quantity'])
|
||||
starting_quantity = float(data_main_stgs['starting_quantity'])
|
||||
max_risk_percent = float(data_risk_management_stgs['max_risk_deal'])
|
||||
@@ -251,47 +235,17 @@ async def contract_short(tg_id, message, margin_mode):
|
||||
|
||||
realised_pnl = float(position['unrealisedPnl'])
|
||||
|
||||
if realised_pnl > 0:
|
||||
print(f'''
|
||||
=====================
|
||||
=====Сделка=========
|
||||
===уСПЕШНЕАЯ================
|
||||
===================
|
||||
=================
|
||||
|
||||
{realised_pnl}
|
||||
|
||||
===============
|
||||
===============
|
||||
=============
|
||||
===============
|
||||
==============
|
||||
''')
|
||||
if realised_pnl > 0: # Прибыльная сделка
|
||||
starting_quantity = next_quantity
|
||||
current_martingale_step = 0
|
||||
elif not realised_pnl:
|
||||
next_quantity = starting_quantity
|
||||
current_martingale_step += 1
|
||||
else:
|
||||
else: # Убыточная сделка
|
||||
current_martingale_step += 1
|
||||
next_quantity = last_quantity * martingale_factor
|
||||
starting_quantity = next_quantity
|
||||
|
||||
print(f'''
|
||||
======СДЕЛКА===============
|
||||
=====УБЫТОЧНАЯ==============
|
||||
===================
|
||||
===================
|
||||
=================
|
||||
|
||||
{realised_pnl}
|
||||
|
||||
===============
|
||||
===============
|
||||
=============
|
||||
===============
|
||||
==============
|
||||
''')
|
||||
except Exception as e:
|
||||
print("Не получены позиции")
|
||||
next_quantity = starting_quantity
|
||||
@@ -324,23 +278,7 @@ async def contract_short(tg_id, message, margin_mode):
|
||||
orderLinkId=f"deal_{SYMBOL}_{time.time()}"
|
||||
)
|
||||
|
||||
await info_access_open_deal(message, SYMBOL, data_main_stgs['trading_mode'], margin_mode, data_main_stgs['size_leverage'], next_quantity)
|
||||
|
||||
print(f'''
|
||||
=====================
|
||||
===================
|
||||
===================
|
||||
===================
|
||||
=================
|
||||
|
||||
{r}
|
||||
|
||||
===============
|
||||
===============
|
||||
=============
|
||||
===============
|
||||
==============
|
||||
''')
|
||||
await info_access_open_deal(message, SYMBOL, data_main_stgs['trading_mode'], margin_mode, data_main_stgs['size_leverage'], next_quantity)
|
||||
|
||||
except exceptions.InvalidRequestError as e:
|
||||
await message.answer('Недостаточно баланса')
|
||||
|
Reference in New Issue
Block a user