Kill Switch
当机器人达到某个性能阈值时自动停止,该阈值可以是正数也可以是负数。此功能使用与history命令相同的性能计算方法。
Select your kill-switch mode (kill_switch_enabled/kill_switch_disabled) >>>
At what profit/loss rate would you like the bot to stop? (e.g. -5 equals 5 percent loss) >>>
您可以通过两种方式重新配置此功能:
- 在 Hummingbot 内部运行命令
config kill_switch_mode
和/或config kill_switch_mode.kill_switch_rate
。 - 使用文本编辑器编辑位于
hummingbot_conf
文件夹内的conf_client.yml
文件。
注意
在 Hummingbot 的过去版本(1.5.0 及以下版本)中,conf_client.yml
文件名为 conf_global.yml
请注意,当市场价格发生变化时,机器人的性能也会随之变化,可能触发 kill switch。例如,我们执行了 13 笔交易,我们的性能如下所示。
Inventory:
Market Asset Starting Current Net Delta Trade Delta
0 binance ETH 10.0000 11.0000 1.0000 3.0000
1 binance USDT 500.0000 297.1580 -202.8420 -610.6340
Markets:
Market Pair Start Price End Price Trades Trade Value Delta
0 binance ETHUSDT 203.913 202.7150000000 13 -2.48900000 USDT
Performance:
Started: 2020-05-26 10:28:03
Duration: 0 days 00:07:06
Total Trade Value Delta: -2.489 USDT
Return %: -0.0985 %
一段时间后,最终价格从 202.715 变更为 200.54,即使没有进行更多交易,我们机器人的性能也随之变化。由于kill_switch_rate
设置为-0.3
,这将停止策略。
Inventory:
Market Asset Starting Current Net Delta Trade Delta
0 binance ETH 10.0000 11.0000 1.0000 3.0000
1 binance USDT 500.0000 297.1580 -202.8420 -610.6340
Markets:
Market Pair Start Price End Price Trades Trade Value Delta
0 binance ETHUSDT 203.913 200.5400000000 13 -9.01400000 USDT
Performance:
Started: 2020-05-26 10:28:03
Duration: 0 days 02:09:13
Total Trade Value Delta: -9.014 USDT
Return %: -0.3598 %