The message about the Bybit profile output has been corrected when clicking the "Start" button, and messages regarding the requirement to connect the platform and incorrect API entries have been added. Messages about successful and erroneous changes to user settings have been added.
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'])
|
||||
martingale_factor = float(data_main_stgs['martingale_factor']) # Исправлено: было maximal_quantity
|
||||
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'])
|
||||
@@ -98,21 +98,6 @@ async def contract_long(tg_id, message, margin_mode):
|
||||
realised_pnl = float(position['unrealisedPnl'])
|
||||
|
||||
if realised_pnl > 0:
|
||||
print(f'''
|
||||
=====================
|
||||
=====Сделка=========
|
||||
===уСПЕШНЕАЯ================
|
||||
===================
|
||||
=================
|
||||
|
||||
{realised_pnl}
|
||||
|
||||
===============
|
||||
===============
|
||||
=============
|
||||
===============
|
||||
==============
|
||||
''')
|
||||
starting_quantity = next_quantity
|
||||
current_martingale_step = 0
|
||||
elif not realised_pnl:
|
||||
@@ -122,22 +107,6 @@ async def contract_long(tg_id, message, margin_mode):
|
||||
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
|
||||
@@ -209,7 +178,7 @@ async def contract_short(tg_id, message, margin_mode):
|
||||
setMarginMode=margin_mode # margin_type
|
||||
)
|
||||
|
||||
martingale_factor = float(data_main_stgs['martingale_factor'])
|
||||
martingale_factor = float(data_main_stgs['martingale_factor']) # Исправлено: было maximal_quantity
|
||||
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'])
|
||||
@@ -235,17 +204,16 @@ async def contract_short(tg_id, message, margin_mode):
|
||||
|
||||
realised_pnl = float(position['unrealisedPnl'])
|
||||
|
||||
if realised_pnl > 0: # Прибыльная сделка
|
||||
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
|
||||
|
||||
except Exception as e:
|
||||
print("Не получены позиции")
|
||||
next_quantity = starting_quantity
|
||||
|
Reference in New Issue
Block a user