partial sell

This commit is contained in:
Kavinkumar
2022-03-01 02:29:09 +05:30
parent dca83b070d
commit 027e11d859
6 changed files with 380 additions and 66 deletions

View File

@@ -1114,6 +1114,8 @@ def test_telegram_forcesell_down_handle(default_conf, update, ticker, fee,
'open_date': ANY,
'close_date': ANY,
'close_rate': ANY,
'stake_amount': 0.0009999999999054,
'sub_trade': False
} == last_msg
@@ -1169,6 +1171,8 @@ def test_forcesell_all_handle(default_conf, update, ticker, fee, mocker) -> None
'open_date': ANY,
'close_date': ANY,
'close_rate': ANY,
'stake_amount': 0.0009999999999054,
'sub_trade': False
} == msg
@@ -1891,11 +1895,11 @@ def test_send_msg_sell_notification(default_conf, mocker) -> None:
'*Unrealized Profit:* `-57.41% (loss: -0.05746268 ETH / -24.812 USD)`\n'
'*Buy Tag:* `buy_signal1`\n'
'*Sell Reason:* `stop_loss`\n'
'*Duration:* `1:00:00 (60.0 min)`\n'
'*Amount:* `1333.33333333`\n'
'*Open Rate:* `0.00007500`\n'
'*Current Rate:* `0.00003201`\n'
'*Close Rate:* `0.00003201`'
'*Close Rate:* `0.00003201`\n'
'*Duration:* `1:00:00 (60.0 min)`'
)
msg_mock.reset_mock()
@@ -1923,11 +1927,11 @@ def test_send_msg_sell_notification(default_conf, mocker) -> None:
'*Unrealized Profit:* `-57.41%`\n'
'*Buy Tag:* `buy_signal1`\n'
'*Sell Reason:* `stop_loss`\n'
'*Duration:* `1 day, 2:30:00 (1590.0 min)`\n'
'*Amount:* `1333.33333333`\n'
'*Open Rate:* `0.00007500`\n'
'*Current Rate:* `0.00003201`\n'
'*Close Rate:* `0.00003201`'
'*Close Rate:* `0.00003201`\n'
'*Duration:* `1 day, 2:30:00 (1590.0 min)`'
)
# Reset singleton function to avoid random breaks
telegram._rpc._fiat_converter.convert_amount = old_convamount
@@ -1994,10 +1998,10 @@ def test_send_msg_sell_fill_notification(default_conf, mocker) -> None:
'*Profit:* `-57.41%`\n'
'*Buy Tag:* `buy_signal1`\n'
'*Sell Reason:* `stop_loss`\n'
'*Duration:* `1 day, 2:30:00 (1590.0 min)`\n'
'*Amount:* `1333.33333333`\n'
'*Open Rate:* `0.00007500`\n'
'*Close Rate:* `0.00003201`'
'*Close Rate:* `0.00003201`\n'
'*Duration:* `1 day, 2:30:00 (1590.0 min)`'
)
@@ -2093,11 +2097,11 @@ def test_send_msg_sell_notification_no_fiat(default_conf, mocker) -> None:
'*Unrealized Profit:* `-57.41%`\n'
'*Buy Tag:* `buy_signal1`\n'
'*Sell Reason:* `stop_loss`\n'
'*Duration:* `2:35:03 (155.1 min)`\n'
'*Amount:* `1333.33333333`\n'
'*Open Rate:* `0.00007500`\n'
'*Current Rate:* `0.00003201`\n'
'*Close Rate:* `0.00003201`'
'*Close Rate:* `0.00003201`\n'
'*Duration:* `2:35:03 (155.1 min)`'
)