mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Add stop_loss_abs ...
This commit is contained in:
parent
6dec508c5e
commit
d2b7016dff
|
@ -281,7 +281,8 @@ class Trade(_DECL_BASE):
|
||||||
|
|
||||||
'sell_reason': self.sell_reason,
|
'sell_reason': self.sell_reason,
|
||||||
'sell_order_status': self.sell_order_status,
|
'sell_order_status': self.sell_order_status,
|
||||||
'stop_loss': self.stop_loss,
|
'stop_loss': self.stop_loss, # Deprecated - should not be used
|
||||||
|
'stop_loss_abs': self.stop_loss,
|
||||||
'stop_loss_ratio': self.stop_loss_pct if self.stop_loss_pct else None,
|
'stop_loss_ratio': self.stop_loss_pct if self.stop_loss_pct else None,
|
||||||
'stop_loss_pct': (self.stop_loss_pct * 100) if self.stop_loss_pct else None,
|
'stop_loss_pct': (self.stop_loss_pct * 100) if self.stop_loss_pct else None,
|
||||||
'stoploss_order_id': self.stoploss_order_id,
|
'stoploss_order_id': self.stoploss_order_id,
|
||||||
|
@ -289,7 +290,8 @@ class Trade(_DECL_BASE):
|
||||||
if self.stoploss_last_update else None),
|
if self.stoploss_last_update else None),
|
||||||
'stoploss_last_update_timestamp': (int(self.stoploss_last_update.timestamp() * 1000)
|
'stoploss_last_update_timestamp': (int(self.stoploss_last_update.timestamp() * 1000)
|
||||||
if self.stoploss_last_update else None),
|
if self.stoploss_last_update else None),
|
||||||
'initial_stop_loss': self.initial_stop_loss,
|
'initial_stop_loss': self.initial_stop_loss, # Deprecated - should not be used
|
||||||
|
'initial_stop_loss_abs': self.initial_stop_loss,
|
||||||
'initial_stop_loss_ratio': (self.initial_stop_loss_pct
|
'initial_stop_loss_ratio': (self.initial_stop_loss_pct
|
||||||
if self.initial_stop_loss_pct else None),
|
if self.initial_stop_loss_pct else None),
|
||||||
'initial_stop_loss_pct': (self.initial_stop_loss_pct * 100
|
'initial_stop_loss_pct': (self.initial_stop_loss_pct * 100
|
||||||
|
|
|
@ -81,12 +81,14 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
|
||||||
'current_profit': -0.00408133,
|
'current_profit': -0.00408133,
|
||||||
'current_profit_pct': -0.41,
|
'current_profit_pct': -0.41,
|
||||||
'stop_loss': 0.0,
|
'stop_loss': 0.0,
|
||||||
|
'stop_loss_abs': 0.0,
|
||||||
'stop_loss_pct': None,
|
'stop_loss_pct': None,
|
||||||
'stop_loss_ratio': None,
|
'stop_loss_ratio': None,
|
||||||
'stoploss_order_id': None,
|
'stoploss_order_id': None,
|
||||||
'stoploss_last_update': None,
|
'stoploss_last_update': None,
|
||||||
'stoploss_last_update_timestamp': None,
|
'stoploss_last_update_timestamp': None,
|
||||||
'initial_stop_loss': 0.0,
|
'initial_stop_loss': 0.0,
|
||||||
|
'initial_stop_loss_abs': 0.0,
|
||||||
'initial_stop_loss_pct': None,
|
'initial_stop_loss_pct': None,
|
||||||
'initial_stop_loss_ratio': None,
|
'initial_stop_loss_ratio': None,
|
||||||
'open_order': '(limit buy rem=0.00000000)',
|
'open_order': '(limit buy rem=0.00000000)',
|
||||||
|
@ -137,12 +139,14 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
|
||||||
'current_profit': ANY,
|
'current_profit': ANY,
|
||||||
'current_profit_pct': ANY,
|
'current_profit_pct': ANY,
|
||||||
'stop_loss': 0.0,
|
'stop_loss': 0.0,
|
||||||
|
'stop_loss_abs': 0.0,
|
||||||
'stop_loss_pct': None,
|
'stop_loss_pct': None,
|
||||||
'stop_loss_ratio': None,
|
'stop_loss_ratio': None,
|
||||||
'stoploss_order_id': None,
|
'stoploss_order_id': None,
|
||||||
'stoploss_last_update': None,
|
'stoploss_last_update': None,
|
||||||
'stoploss_last_update_timestamp': None,
|
'stoploss_last_update_timestamp': None,
|
||||||
'initial_stop_loss': 0.0,
|
'initial_stop_loss': 0.0,
|
||||||
|
'initial_stop_loss_abs': 0.0,
|
||||||
'initial_stop_loss_pct': None,
|
'initial_stop_loss_pct': None,
|
||||||
'initial_stop_loss_ratio': None,
|
'initial_stop_loss_ratio': None,
|
||||||
'open_order': '(limit buy rem=0.00000000)',
|
'open_order': '(limit buy rem=0.00000000)',
|
||||||
|
|
|
@ -518,12 +518,14 @@ def test_api_status(botclient, mocker, ticker, fee, markets):
|
||||||
'pair': 'ETH/BTC',
|
'pair': 'ETH/BTC',
|
||||||
'stake_amount': 0.001,
|
'stake_amount': 0.001,
|
||||||
'stop_loss': 0.0,
|
'stop_loss': 0.0,
|
||||||
|
'stop_loss_abs': 0.0,
|
||||||
'stop_loss_pct': None,
|
'stop_loss_pct': None,
|
||||||
'stop_loss_ratio': None,
|
'stop_loss_ratio': None,
|
||||||
'stoploss_order_id': None,
|
'stoploss_order_id': None,
|
||||||
'stoploss_last_update': None,
|
'stoploss_last_update': None,
|
||||||
'stoploss_last_update_timestamp': None,
|
'stoploss_last_update_timestamp': None,
|
||||||
'initial_stop_loss': 0.0,
|
'initial_stop_loss': 0.0,
|
||||||
|
'initial_stop_loss_abs': 0.0,
|
||||||
'initial_stop_loss_pct': None,
|
'initial_stop_loss_pct': None,
|
||||||
'initial_stop_loss_ratio': None,
|
'initial_stop_loss_ratio': None,
|
||||||
'trade_id': 1,
|
'trade_id': 1,
|
||||||
|
@ -636,12 +638,14 @@ def test_api_forcebuy(botclient, mocker, fee):
|
||||||
'pair': 'ETH/ETH',
|
'pair': 'ETH/ETH',
|
||||||
'stake_amount': 1,
|
'stake_amount': 1,
|
||||||
'stop_loss': None,
|
'stop_loss': None,
|
||||||
|
'stop_loss_abs': None,
|
||||||
'stop_loss_pct': None,
|
'stop_loss_pct': None,
|
||||||
'stop_loss_ratio': None,
|
'stop_loss_ratio': None,
|
||||||
'stoploss_order_id': None,
|
'stoploss_order_id': None,
|
||||||
'stoploss_last_update': None,
|
'stoploss_last_update': None,
|
||||||
'stoploss_last_update_timestamp': None,
|
'stoploss_last_update_timestamp': None,
|
||||||
'initial_stop_loss': None,
|
'initial_stop_loss': None,
|
||||||
|
'initial_stop_loss_abs': None,
|
||||||
'initial_stop_loss_pct': None,
|
'initial_stop_loss_pct': None,
|
||||||
'initial_stop_loss_ratio': None,
|
'initial_stop_loss_ratio': None,
|
||||||
'close_profit': None,
|
'close_profit': None,
|
||||||
|
|
|
@ -762,12 +762,14 @@ def test_to_json(default_conf, fee):
|
||||||
'sell_reason': None,
|
'sell_reason': None,
|
||||||
'sell_order_status': None,
|
'sell_order_status': None,
|
||||||
'stop_loss': None,
|
'stop_loss': None,
|
||||||
|
'stop_loss_abs': None,
|
||||||
'stop_loss_ratio': None,
|
'stop_loss_ratio': None,
|
||||||
'stop_loss_pct': None,
|
'stop_loss_pct': None,
|
||||||
'stoploss_order_id': None,
|
'stoploss_order_id': None,
|
||||||
'stoploss_last_update': None,
|
'stoploss_last_update': None,
|
||||||
'stoploss_last_update_timestamp': None,
|
'stoploss_last_update_timestamp': None,
|
||||||
'initial_stop_loss': None,
|
'initial_stop_loss': None,
|
||||||
|
'initial_stop_loss_abs': None,
|
||||||
'initial_stop_loss_pct': None,
|
'initial_stop_loss_pct': None,
|
||||||
'initial_stop_loss_ratio': None,
|
'initial_stop_loss_ratio': None,
|
||||||
'min_rate': None,
|
'min_rate': None,
|
||||||
|
@ -806,12 +808,14 @@ def test_to_json(default_conf, fee):
|
||||||
'amount': 100.0,
|
'amount': 100.0,
|
||||||
'stake_amount': 0.001,
|
'stake_amount': 0.001,
|
||||||
'stop_loss': None,
|
'stop_loss': None,
|
||||||
|
'stop_loss_abs': None,
|
||||||
'stop_loss_pct': None,
|
'stop_loss_pct': None,
|
||||||
'stop_loss_ratio': None,
|
'stop_loss_ratio': None,
|
||||||
'stoploss_order_id': None,
|
'stoploss_order_id': None,
|
||||||
'stoploss_last_update': None,
|
'stoploss_last_update': None,
|
||||||
'stoploss_last_update_timestamp': None,
|
'stoploss_last_update_timestamp': None,
|
||||||
'initial_stop_loss': None,
|
'initial_stop_loss': None,
|
||||||
|
'initial_stop_loss_abs': None,
|
||||||
'initial_stop_loss_pct': None,
|
'initial_stop_loss_pct': None,
|
||||||
'initial_stop_loss_ratio': None,
|
'initial_stop_loss_ratio': None,
|
||||||
'close_profit': None,
|
'close_profit': None,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user