introduction of new config with docs
This commit is contained in:
parent
d457d43999
commit
c77a6addf5
@ -13,6 +13,7 @@
|
||||
},
|
||||
"bid_strategy": {
|
||||
"ask_last_balance": 0.0,
|
||||
"timeout_even_if_buy_signal_valid": true,
|
||||
"use_order_book": false,
|
||||
"order_book_top": 1,
|
||||
"check_depth_of_market": {
|
||||
|
@ -13,6 +13,7 @@
|
||||
},
|
||||
"bid_strategy": {
|
||||
"use_order_book": false,
|
||||
"timeout_even_if_buy_signal_valid": true,
|
||||
"ask_last_balance": 0.0,
|
||||
"order_book_top": 1,
|
||||
"check_depth_of_market": {
|
||||
|
@ -26,6 +26,7 @@
|
||||
},
|
||||
"bid_strategy": {
|
||||
"use_order_book": false,
|
||||
"timeout_even_if_buy_signal_valid": true,
|
||||
"ask_last_balance": 0.0,
|
||||
"order_book_top": 1,
|
||||
"check_depth_of_market": {
|
||||
|
@ -13,6 +13,7 @@
|
||||
},
|
||||
"bid_strategy": {
|
||||
"use_order_book": false,
|
||||
"timeout_even_if_buy_signal_valid": true,
|
||||
"ask_last_balance": 0.0,
|
||||
"order_book_top": 1,
|
||||
"check_depth_of_market": {
|
||||
|
@ -61,6 +61,7 @@ Mandatory parameters are marked as **Required**, which means that they are requi
|
||||
| `unfilledtimeout.buy` | **Required.** How long (in minutes) the bot will wait for an unfilled buy order to complete, after which the order will be cancelled. [Strategy Override](#parameters-in-the-strategy).<br> ***Datatype:*** *Integer*
|
||||
| `unfilledtimeout.sell` | **Required.** How long (in minutes) the bot will wait for an unfilled sell order to complete, after which the order will be cancelled. [Strategy Override](#parameters-in-the-strategy).<br> ***Datatype:*** *Integer*
|
||||
| `bid_strategy.ask_last_balance` | **Required.** Set the bidding price. More information [below](#buy-price-without-orderbook).
|
||||
| `bid_strategy.timeout_even_if_buy_signal_valid` | **Required.** Choose whether you would prefer buy orders to [timeout even if buy signal was still valid](#timeout-even-if-buy-signal-valid). If false, your buy orders will not timeout and will ignore your unfilledtimeout for buy orders, so use this option wisely. <br>*Defaults to `true`.* <br> ***Datatype:*** *Boolean*
|
||||
| `bid_strategy.use_order_book` | Enable buying using the rates in [Order Book Bids](#buy-price-with-orderbook-enabled). <br> ***Datatype:*** *Boolean*
|
||||
| `bid_strategy.order_book_top` | Bot will use the top N rate in Order Book Bids to buy. I.e. a value of 2 will allow the bot to pick the 2nd bid rate in [Order Book Bids](#buy-price-with-orderbook-enabled). <br>*Defaults to `1`.* <br> ***Datatype:*** *Positive Integer*
|
||||
| `bid_strategy. check_depth_of_market.enabled` | Do not buy if the difference of buy orders and sell orders is met in Order Book. [Check market depth](#check-depth-of-market). <br>*Defaults to `false`.* <br> ***Datatype:*** *Boolean*
|
||||
|
@ -109,6 +109,8 @@ CONF_SCHEMA = {
|
||||
'minimum': 0,
|
||||
'maximum': 1,
|
||||
'exclusiveMaximum': False,
|
||||
},
|
||||
'timeout_even_if_buy_signal_valid': {'type': 'boolean'},
|
||||
'use_order_book': {'type': 'boolean'},
|
||||
'order_book_top': {'type': 'integer', 'maximum': 20, 'minimum': 1},
|
||||
'check_depth_of_market': {
|
||||
@ -119,7 +121,6 @@ CONF_SCHEMA = {
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
'required': ['ask_last_balance']
|
||||
},
|
||||
'ask_strategy': {
|
||||
|
@ -845,12 +845,26 @@ class FreqtradeBot:
|
||||
:return: True if order was fully cancelled
|
||||
"""
|
||||
reason = "cancelled due to timeout"
|
||||
|
||||
# running get_signal on historical data fetched
|
||||
(buy, sell) = self.strategy.get_signal(
|
||||
trade.pair, self.strategy.ticker_interval,
|
||||
self.dataprovider.ohlcv(trade.pair, self.strategy.ticker_interval))
|
||||
|
||||
# get config for bid strategy
|
||||
config_bid_strategy = self.config.get('bid_strategy', {})
|
||||
|
||||
# proceed to cancel buy order by timeout if timeout_even_if_buy_signal_valid
|
||||
# is true (original behaviour) -OR-
|
||||
# cancel buy order only if buying condition is no longer valid OR if there's
|
||||
# a sell signal present
|
||||
if config_bid_strategy.get('timeout_even_if_buy_signal_valid', True) or (not buy or sell):
|
||||
if order['status'] != 'canceled':
|
||||
corder = self.exchange.cancel_order(trade.open_order_id, trade.pair)
|
||||
else:
|
||||
# Order was cancelled already, so we can reuse the existing dict
|
||||
corder = order
|
||||
reason = "canceled on Exchange"
|
||||
reason = "canceled on exchange"
|
||||
|
||||
if corder.get('remaining', order['remaining']) == order['amount']:
|
||||
# if trade is not partially completed, just delete the trade
|
||||
@ -877,10 +891,10 @@ class FreqtradeBot:
|
||||
logger.warning("Could not update trade amount: %s", e)
|
||||
|
||||
trade.open_order_id = None
|
||||
logger.info('Partial buy order timeout for %s.', trade)
|
||||
logger.info(f"Partial buy order timeout for {trade.pair}")
|
||||
self.rpc.send_msg({
|
||||
'type': RPCMessageType.STATUS_NOTIFICATION,
|
||||
'status': f'Remaining buy order for {trade.pair} cancelled due to timeout'
|
||||
'status': f"Remaining buy order for {trade.pair} cancelled due to timeout"
|
||||
})
|
||||
return False
|
||||
|
||||
|
@ -216,6 +216,7 @@ def default_conf(testdatadir):
|
||||
},
|
||||
"bid_strategy": {
|
||||
"ask_last_balance": 0.0,
|
||||
"timeout_even_if_buy_signal_valid": True,
|
||||
"use_order_book": False,
|
||||
"order_book_top": 1,
|
||||
"check_depth_of_market": {
|
||||
|
Loading…
Reference in New Issue
Block a user