Unfilled Order timeout - better documentation and variable naming

This commit is contained in:
Stephen Dade 2018-01-04 10:35:57 +11:00
parent 7169ad557f
commit b5d2cfecc7
5 changed files with 6 additions and 6 deletions

View File

@ -11,7 +11,7 @@
"0": 0.04 "0": 0.04
}, },
"stoploss": -0.10, "stoploss": -0.10,
"opentradetimeout": 600, "unfilledtimeout": 600,
"bid_strategy": { "bid_strategy": {
"ask_last_balance": 0.0 "ask_last_balance": 0.0
}, },

View File

@ -21,7 +21,7 @@ The table below will list all configuration parameters.
| `dry_run` | true | Yes | Define if the bot must be in Dry-run or production mode. | `dry_run` | true | Yes | Define if the bot must be in Dry-run or production mode.
| `minimal_roi` | See below | Yes | Set the threshold in percent the bot will use to sell a trade. More information below. | `minimal_roi` | See below | Yes | Set the threshold in percent the bot will use to sell a trade. More information below.
| `stoploss` | -0.10 | No | Value of the stoploss in percent used by the bot. More information below. | `stoploss` | -0.10 | No | Value of the stoploss in percent used by the bot. More information below.
| `opentradetimeout` | 0 | No | The number of minutes until an open trade will be cancelled. | `unfilledtimeout` | 0 | No | How long (in minutes) the bot will wait for an unfilled order to complete, after which the order will be cancelled.
| `bid_strategy.ask_last_balance` | 0.0 | Yes | Set the bidding price. More information below. | `bid_strategy.ask_last_balance` | 0.0 | Yes | Set the bidding price. More information below.
| `exchange.name` | bittrex | Yes | Name of the exchange class to use. | `exchange.name` | bittrex | Yes | Name of the exchange class to use.
| `exchange.key` | key | No | API key to use for the exchange. Only required when you are in production mode. | `exchange.key` | key | No | API key to use for the exchange. Only required when you are in production mode.

View File

@ -98,7 +98,7 @@ def _process(nb_assets: Optional[int] = 0) -> bool:
# Check if we can sell our current pair # Check if we can sell our current pair
state_changed = handle_trade(trade) or state_changed state_changed = handle_trade(trade) or state_changed
if 'opentradetimeout' in _CONF and trade.open_order_id: if 'unfilledtimeout' in _CONF and trade.open_order_id:
# Check and handle any timed out trades # Check and handle any timed out trades
check_handle_timedout(trade) check_handle_timedout(trade)
@ -125,7 +125,7 @@ def check_handle_timedout(trade: Trade) -> bool:
:param trade: Trade instance :param trade: Trade instance
:return: True if the trade is timed out, false otherwise :return: True if the trade is timed out, false otherwise
""" """
timeoutthreashold = datetime.utcnow() - timedelta(minutes=_CONF['opentradetimeout']) timeoutthreashold = datetime.utcnow() - timedelta(minutes=_CONF['unfilledtimeout'])
order = exchange.get_order(trade.open_order_id) order = exchange.get_order(trade.open_order_id)
if trade.open_date < timeoutthreashold: if trade.open_date < timeoutthreashold:

View File

@ -218,7 +218,7 @@ CONF_SCHEMA = {
'minProperties': 1 'minProperties': 1
}, },
'stoploss': {'type': 'number', 'maximum': 0, 'exclusiveMaximum': True}, 'stoploss': {'type': 'number', 'maximum': 0, 'exclusiveMaximum': True},
'opentradetimeout': {'type': 'integer', 'minimum': 0}, 'unfilledtimeout': {'type': 'integer', 'minimum': 0},
'bid_strategy': { 'bid_strategy': {
'type': 'object', 'type': 'object',
'properties': { 'properties': {

View File

@ -25,7 +25,7 @@ def default_conf():
"0": 0.04 "0": 0.04
}, },
"stoploss": -0.10, "stoploss": -0.10,
"opentradetimeout": 600, "unfilledtimeout": 600,
"bid_strategy": { "bid_strategy": {
"ask_last_balance": 0.0 "ask_last_balance": 0.0
}, },