move order_book config out of experimental
This commit is contained in:
parent
4dfaf1d284
commit
b6b89a464f
@ -11,7 +11,18 @@
|
||||
"sell": 30
|
||||
},
|
||||
"bid_strategy": {
|
||||
"ask_last_balance": 0.0
|
||||
"ask_last_balance": 0.0,
|
||||
"use_order_book": false,
|
||||
"order_book_top": 1,
|
||||
"check_depth_of_market": {
|
||||
"enabled": false,
|
||||
"bids_to_ask_delta": 1
|
||||
}
|
||||
},
|
||||
"ask_strategy":{
|
||||
"use_order_book": false,
|
||||
"order_book_min": 1,
|
||||
"order_book_max": 9
|
||||
},
|
||||
"exchange": {
|
||||
"name": "bittrex",
|
||||
@ -37,21 +48,7 @@
|
||||
"experimental": {
|
||||
"use_sell_signal": false,
|
||||
"sell_profit_only": false,
|
||||
"ignore_roi_if_buy_signal": false,
|
||||
"check_depth_of_market": {
|
||||
"enabled": false,
|
||||
"bids_to_ask_delta": 1
|
||||
},
|
||||
"bid_strategy": {
|
||||
"use_order_book": false,
|
||||
"order_book_top": 2,
|
||||
"percent_from_top": 0
|
||||
},
|
||||
"ask_strategy":{
|
||||
"use_order_book": false,
|
||||
"order_book_min": 1,
|
||||
"order_book_max": 9
|
||||
}
|
||||
"ignore_roi_if_buy_signal": false
|
||||
},
|
||||
"telegram": {
|
||||
"enabled": true,
|
||||
|
@ -20,7 +20,18 @@
|
||||
"sell": 30
|
||||
},
|
||||
"bid_strategy": {
|
||||
"ask_last_balance": 0.0
|
||||
"ask_last_balance": 0.0,
|
||||
"use_order_book": false,
|
||||
"order_book_top": 1,
|
||||
"check_depth_of_market": {
|
||||
"enabled": false,
|
||||
"bids_to_ask_delta": 1
|
||||
}
|
||||
},
|
||||
"ask_strategy":{
|
||||
"use_order_book": false,
|
||||
"order_book_min": 1,
|
||||
"order_book_max": 9
|
||||
},
|
||||
"exchange": {
|
||||
"name": "bittrex",
|
||||
@ -46,21 +57,7 @@
|
||||
"experimental": {
|
||||
"use_sell_signal": false,
|
||||
"sell_profit_only": false,
|
||||
"ignore_roi_if_buy_signal": false,
|
||||
"check_depth_of_market": {
|
||||
"enabled": false,
|
||||
"bids_to_ask_delta": 1
|
||||
},
|
||||
"bid_strategy": {
|
||||
"use_order_book": false,
|
||||
"order_book_top": 2,
|
||||
"percent_from_top": 0
|
||||
},
|
||||
"ask_strategy":{
|
||||
"use_order_book": false,
|
||||
"order_book_min": 1,
|
||||
"order_book_max": 9
|
||||
}s
|
||||
"ignore_roi_if_buy_signal": false
|
||||
},
|
||||
"telegram": {
|
||||
"enabled": true,
|
||||
|
@ -31,6 +31,13 @@ The table below will list all configuration parameters.
|
||||
| `unfilledtimeout.buy` | 10 | Yes | How long (in minutes) the bot will wait for an unfilled buy order to complete, after which the order will be cancelled.
|
||||
| `unfilledtimeout.sell` | 10 | Yes | How long (in minutes) the bot will wait for an unfilled sell 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.use_order_book` | false | No | Allows buying of pair using the rates in Order Book Bids.
|
||||
| `bid_strategy.order_book_top` | 0 | No | Bot will use the top N rate in Order Book Bids. Ie. a value of 2 will allow the bot to pick the 2nd bid rate in Order Book Bids.
|
||||
| `bid_strategy.check_depth_of_market.enabled` | false | No | Does not buy if the % difference of buy orders and sell orders is met in Order Book.
|
||||
| `experimental.check_depth_of_market.bids_to_ask_delta` | 0 | No | The % difference of buy orders and sell orders found in Order Book. A value lesser than 1 means sell orders is greater, while value greater than 1 means buy orders is higher.
|
||||
| `ask_strategy.use_order_book` | false | No | Allows selling of open traded pair using the rates in Order Book Asks.
|
||||
| `ask_strategy.order_book_min` | 0 | No | Bot will scan from the top min to max Order Book Asks searching for a profitable rate.
|
||||
| `ask_strategy.order_book_max` | 0 | No | Bot will scan from the top min to max Order Book Asks searching for a profitable rate.
|
||||
| `exchange.name` | bittrex | Yes | Name of the exchange class to use. [List below](#user-content-what-values-for-exchangename).
|
||||
| `exchange.key` | key | No | API key to use for the exchange. Only required when you are in production mode.
|
||||
| `exchange.secret` | secret | No | API secret to use for the exchange. Only required when you are in production mode.
|
||||
@ -39,13 +46,6 @@ The table below will list all configuration parameters.
|
||||
| `experimental.use_sell_signal` | false | No | Use your sell strategy in addition of the `minimal_roi`.
|
||||
| `experimental.sell_profit_only` | false | No | waits until you have made a positive profit before taking a sell decision.
|
||||
| `experimental.ignore_roi_if_buy_signal` | false | No | Does not sell if the buy-signal is still active. Takes preference over `minimal_roi` and `use_sell_signal`
|
||||
| `experimental.check_depth_of_market` | false | No | Does not sell if the % difference of buy orders and sell orders is met in Order Book.
|
||||
| `experimental.bids_to_ask_delta` | 0 | No | The % difference of buy orders and sell orders found in Order Book. A value lesser than 1 means sell orders is greater, while value greater than 1 means buy orders is higher.
|
||||
| `experimental.bid_strategy.use_order_book` | false | No | Allows buying of pair using the rates in Order Book Bids.
|
||||
| `experimental.bid_strategy.order_book_top` | 0 | No | Bot will use the top N rate in Order Book Bids. Ie. a value of 2 will allow the bot to pick the 2nd bid rate in Order Book Bids.
|
||||
| `experimental.ask_strategy.use_order_book` | false | No | Allows selling of open traded pair using the rates in Order Book Asks.
|
||||
| `experimental.ask_strategy.order_book_min` | 0 | No | Bot will scan from the top min to max Order Book Asks searching for a profitable rate.
|
||||
| `experimental.ask_strategy.order_book_max` | 0 | No | Bot will scan from the top min to max Order Book Asks searching for a profitable rate.
|
||||
| `telegram.enabled` | true | Yes | Enable or not the usage of Telegram.
|
||||
| `telegram.token` | token | No | Your Telegram bot token. Only required if `telegram.enabled` is `true`.
|
||||
| `telegram.chat_id` | chat_id | No | Your personal Telegram account id. Only required if `telegram.enabled` is `true`.
|
||||
|
@ -78,41 +78,35 @@ CONF_SCHEMA = {
|
||||
'type': 'number',
|
||||
'minimum': 0,
|
||||
'maximum': 1,
|
||||
'exclusiveMaximum': False
|
||||
'exclusiveMaximum': False,
|
||||
'use_order_book': {'type': 'boolean'},
|
||||
'order_book_top': {'type': 'number', 'maximum': 20, 'minimum': 1},
|
||||
'check_depth_of_market': {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'enabled': {'type': 'boolean'},
|
||||
'bids_to_ask_delta': {'type': 'number', 'minimum': 0},
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
'required': ['ask_last_balance']
|
||||
},
|
||||
'ask_strategy': {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'use_order_book': {'type': 'boolean'},
|
||||
'order_book_min': {'type': 'number', 'minimum': 1},
|
||||
'order_book_max': {'type': 'number', 'minimum': 1, 'maximum': 50}
|
||||
}
|
||||
},
|
||||
'exchange': {'$ref': '#/definitions/exchange'},
|
||||
'experimental': {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'use_sell_signal': {'type': 'boolean'},
|
||||
'sell_profit_only': {'type': 'boolean'},
|
||||
'ignore_roi_if_buy_signal_true': {'type': 'boolean'},
|
||||
'check_depth_of_market': {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'enabled': {'type': 'boolean'},
|
||||
'bids_to_ask_delta': {'type': 'number', 'minimum': 0},
|
||||
}
|
||||
},
|
||||
'bid_strategy': {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'percent_from_top': {'type': 'number', 'minimum': 0},
|
||||
'use_order_book': {'type': 'boolean'},
|
||||
'order_book_top': {'type': 'number', 'maximum': 20, 'minimum': 1}
|
||||
}
|
||||
},
|
||||
'ask_strategy': {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'use_order_book': {'type': 'boolean'},
|
||||
'order_book_min': {'type': 'number', 'minimum': 1},
|
||||
'order_book_max': {'type': 'number', 'minimum': 1, 'maximum': 50}
|
||||
}
|
||||
}
|
||||
'ignore_roi_if_buy_signal_true': {'type': 'boolean'}
|
||||
}
|
||||
},
|
||||
'telegram': {
|
||||
|
@ -247,11 +247,11 @@ class FreqtradeBot(object):
|
||||
ticker_rate = ticker['ask'] + balance * (ticker['last'] - ticker['ask'])
|
||||
|
||||
used_rate = ticker_rate
|
||||
experimental_bid_strategy = self.config.get('experimental', {}).get('bid_strategy', {})
|
||||
if 'use_order_book' in experimental_bid_strategy and\
|
||||
experimental_bid_strategy.get('use_order_book', False):
|
||||
config_bid_strategy = self.config.get('bid_strategy', {})
|
||||
if 'use_order_book' in config_bid_strategy and\
|
||||
config_bid_strategy.get('use_order_book', False):
|
||||
logger.info('Getting price from order book')
|
||||
order_book_top = experimental_bid_strategy.get('order_book_top', 1)
|
||||
order_book_top = config_bid_strategy.get('order_book_top', 1)
|
||||
order_book = self.exchange.get_order_book(pair, order_book_top)
|
||||
logger.debug('order_book %s', order_book)
|
||||
# top 1 = index 0
|
||||
@ -359,11 +359,11 @@ class FreqtradeBot(object):
|
||||
(buy, sell) = self.strategy.get_signal(_pair, interval, thistory)
|
||||
|
||||
if buy and not sell:
|
||||
experimental_check_depth_of_market = self.config.get('experimental', {}).\
|
||||
bidstrat_check_depth_of_market = self.config.get('bid_strategy', {}).\
|
||||
get('check_depth_of_market', {})
|
||||
if (experimental_check_depth_of_market.get('enabled', False)) and\
|
||||
(experimental_check_depth_of_market.get('bids_to_ask_delta', 0) > 0):
|
||||
if self._check_depth_of_market_buy(_pair, experimental_check_depth_of_market):
|
||||
if (bidstrat_check_depth_of_market.get('enabled', False)) and\
|
||||
(bidstrat_check_depth_of_market.get('bids_to_ask_delta', 0) > 0):
|
||||
if self._check_depth_of_market_buy(_pair, bidstrat_check_depth_of_market):
|
||||
return self.execute_buy(_pair, stake_amount)
|
||||
else:
|
||||
return False
|
||||
@ -551,12 +551,12 @@ class FreqtradeBot(object):
|
||||
(buy, sell) = self.strategy.get_signal(trade.pair, self.strategy.ticker_interval,
|
||||
ticker)
|
||||
|
||||
experimental_ask_strategy = self.config.get('experimental', {}).get('ask_strategy', {})
|
||||
if experimental_ask_strategy.get('use_order_book', False):
|
||||
config_ask_strategy = self.config.get('ask_strategy', {})
|
||||
if config_ask_strategy.get('use_order_book', False):
|
||||
logger.info('Using order book for selling...')
|
||||
# logger.debug('Order book %s',orderBook)
|
||||
order_book_min = experimental_ask_strategy.get('order_book_min', 1)
|
||||
order_book_max = experimental_ask_strategy.get('order_book_max', 1)
|
||||
order_book_min = config_ask_strategy.get('order_book_min', 1)
|
||||
order_book_max = config_ask_strategy.get('order_book_max', 1)
|
||||
|
||||
order_book = self.exchange.get_order_book(trade.pair, order_book_max)
|
||||
|
||||
|
@ -102,7 +102,18 @@ def default_conf():
|
||||
"sell": 30
|
||||
},
|
||||
"bid_strategy": {
|
||||
"ask_last_balance": 0.0
|
||||
"ask_last_balance": 0.0,
|
||||
"use_order_book": False,
|
||||
"order_book_top": 1,
|
||||
"check_depth_of_market": {
|
||||
"enabled": False,
|
||||
"bids_to_ask_delta": 1
|
||||
}
|
||||
},
|
||||
"ask_strategy": {
|
||||
"use_order_book": False,
|
||||
"order_book_min": 1,
|
||||
"order_book_max": 1
|
||||
},
|
||||
"exchange": {
|
||||
"name": "bittrex",
|
||||
@ -116,22 +127,6 @@ def default_conf():
|
||||
"NEO/BTC"
|
||||
]
|
||||
},
|
||||
"experimental": {
|
||||
"check_depth_of_market": {
|
||||
"enabled": False,
|
||||
"bids_to_ask_delta": 1
|
||||
},
|
||||
"bid_strategy": {
|
||||
"percent_from_top": 0,
|
||||
"use_order_book": False,
|
||||
"order_book_top": 1
|
||||
},
|
||||
"ask_strategy": {
|
||||
"use_order_book": False,
|
||||
"order_book_min": 1,
|
||||
"order_book_max": 1
|
||||
}
|
||||
},
|
||||
"telegram": {
|
||||
"enabled": True,
|
||||
"token": "token",
|
||||
|
@ -1889,8 +1889,8 @@ def test_get_real_amount_open_trade(default_conf, mocker):
|
||||
|
||||
def test_order_book_depth_of_market(default_conf, ticker, limit_buy_order, fee, markets, mocker,
|
||||
order_book_l2):
|
||||
default_conf['experimental']['check_depth_of_market']['enabled'] = True
|
||||
default_conf['experimental']['check_depth_of_market']['bids_to_ask_delta'] = 0.1
|
||||
default_conf['bid_strategy']['check_depth_of_market']['enabled'] = True
|
||||
default_conf['bid_strategy']['check_depth_of_market']['bids_to_ask_delta'] = 0.1
|
||||
patch_RPCManager(mocker)
|
||||
mocker.patch('freqtrade.exchange.Exchange.get_order_book', order_book_l2)
|
||||
mocker.patch.multiple(
|
||||
@ -1924,9 +1924,9 @@ def test_order_book_depth_of_market(default_conf, ticker, limit_buy_order, fee,
|
||||
|
||||
def test_order_book_depth_of_market_high_delta(default_conf, ticker, limit_buy_order,
|
||||
fee, markets, mocker, order_book_l2):
|
||||
default_conf['experimental']['check_depth_of_market']['enabled'] = True
|
||||
default_conf['bid_strategy']['check_depth_of_market']['enabled'] = True
|
||||
# delta is 100 which is impossible to reach. hence check_depth_of_market will return false
|
||||
default_conf['experimental']['check_depth_of_market']['bids_to_ask_delta'] = 100
|
||||
default_conf['bid_strategy']['check_depth_of_market']['bids_to_ask_delta'] = 100
|
||||
patch_RPCManager(mocker)
|
||||
mocker.patch('freqtrade.exchange.Exchange.get_order_book', order_book_l2)
|
||||
mocker.patch.multiple(
|
||||
@ -1958,8 +1958,8 @@ def test_order_book_bid_strategy1(mocker, default_conf, order_book_l2, markets)
|
||||
get_order_book=order_book_l2
|
||||
)
|
||||
default_conf['exchange']['name'] = 'binance'
|
||||
default_conf['experimental']['bid_strategy']['use_order_book'] = True
|
||||
default_conf['experimental']['bid_strategy']['order_book_top'] = 2
|
||||
default_conf['bid_strategy']['use_order_book'] = True
|
||||
default_conf['bid_strategy']['order_book_top'] = 2
|
||||
default_conf['bid_strategy']['ask_last_balance'] = 0
|
||||
default_conf['telegram']['enabled'] = False
|
||||
|
||||
@ -1979,8 +1979,8 @@ def test_order_book_bid_strategy2(mocker, default_conf, order_book_l2, markets)
|
||||
get_order_book=order_book_l2
|
||||
)
|
||||
default_conf['exchange']['name'] = 'binance'
|
||||
default_conf['experimental']['bid_strategy']['use_order_book'] = True
|
||||
default_conf['experimental']['bid_strategy']['order_book_top'] = 2
|
||||
default_conf['bid_strategy']['use_order_book'] = True
|
||||
default_conf['bid_strategy']['order_book_top'] = 2
|
||||
default_conf['bid_strategy']['ask_last_balance'] = 0
|
||||
default_conf['telegram']['enabled'] = False
|
||||
|
||||
@ -2000,8 +2000,8 @@ def test_order_book_bid_strategy3(default_conf, mocker, order_book_l2, markets)
|
||||
get_order_book=order_book_l2
|
||||
)
|
||||
default_conf['exchange']['name'] = 'binance'
|
||||
default_conf['experimental']['bid_strategy']['use_order_book'] = True
|
||||
default_conf['experimental']['bid_strategy']['order_book_top'] = 1
|
||||
default_conf['bid_strategy']['use_order_book'] = True
|
||||
default_conf['bid_strategy']['order_book_top'] = 1
|
||||
default_conf['bid_strategy']['ask_last_balance'] = 0
|
||||
default_conf['telegram']['enabled'] = False
|
||||
|
||||
@ -2022,12 +2022,12 @@ def test_check_depth_of_market_buy(default_conf, mocker, order_book_l2, markets)
|
||||
)
|
||||
default_conf['telegram']['enabled'] = False
|
||||
default_conf['exchange']['name'] = 'binance'
|
||||
default_conf['experimental']['check_depth_of_market']['enabled'] = True
|
||||
default_conf['bid_strategy']['check_depth_of_market']['enabled'] = True
|
||||
# delta is 100 which is impossible to reach. hence function will return false
|
||||
default_conf['experimental']['check_depth_of_market']['bids_to_ask_delta'] = 100
|
||||
default_conf['bid_strategy']['check_depth_of_market']['bids_to_ask_delta'] = 100
|
||||
freqtrade = FreqtradeBot(default_conf)
|
||||
|
||||
conf = default_conf['experimental']['check_depth_of_market']
|
||||
conf = default_conf['bid_strategy']['check_depth_of_market']
|
||||
assert freqtrade._check_depth_of_market_buy('ETH/BTC', conf) is False
|
||||
|
||||
|
||||
@ -2038,9 +2038,9 @@ def test_order_book_ask_strategy(default_conf, limit_buy_order, limit_sell_order
|
||||
"""
|
||||
mocker.patch('freqtrade.exchange.Exchange.get_order_book', order_book_l2)
|
||||
default_conf['exchange']['name'] = 'binance'
|
||||
default_conf['experimental']['ask_strategy']['use_order_book'] = True
|
||||
default_conf['experimental']['ask_strategy']['order_book_min'] = 1
|
||||
default_conf['experimental']['ask_strategy']['order_book_max'] = 2
|
||||
default_conf['ask_strategy']['use_order_book'] = True
|
||||
default_conf['ask_strategy']['order_book_min'] = 1
|
||||
default_conf['ask_strategy']['order_book_max'] = 2
|
||||
default_conf['telegram']['enabled'] = False
|
||||
patch_RPCManager(mocker)
|
||||
mocker.patch.multiple(
|
||||
|
Loading…
Reference in New Issue
Block a user