Open xinmans opened 3 days ago
是有非整数碎股么
是有非整数碎股么
美股不区分碎股吧 港股有14股赠送的狗东碎股
盘后和夜盘不能支持吗? 现在美股全天候24小时都可以交易。
非RTH时段交易目前在美股市场不具备广泛性
可以支持下模拟盘成交下单吗? 实盘担心大亏损
参考券商模拟盘配置说明填充配置文件吧
脆股都卖了,但是还是报错
11-20 23:28:32.186|WARNING:流程异常: 11-20 23:28:38.399|ERROR:更新收工状态/持仓/现金/行情时出现错误: Traceback (most recent call last): File "/home/xinmans/mydev/HODL/hodl/store_hodl.py", line 368, in on_current self.prepare_chip()
File "/home/xinmans/mydev/HODL/hodl/store_hodl.py", line 166, in prepare_chip
chip_count = self.current_chip()
File "/home/xinmans/mydev/HODL/hodl/trade_mixin.py", line 96, in current_chip
return self.broker_proxy.query_chips()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/xinmans/mydev/HODL/hodl/proxy/broker_proxy.py", line 63, in query_chips
assert isinstance(chips, int)
~~~~~~~~~~^^^^^^^^^^^^
AssertionError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/xinmans/mydev/HODL/hodl/store_hodl.py", line 374, in on_current
raise error
hodl.exception_tools.PrepareError
11-20 23:28:38.401|WARNING:流程异常:
虽然你没提供出配置文件, 没有指出具体所管理的持仓是哪个, 我猜你可能填写的symbol代码并不能在持仓接口中正确对应到你期望的结果.
虽然你没提供出配置文件, 没有指出具体所管理的持仓是哪个, 我猜你可能填写的symbol代码并不能在持仓接口中正确对应到你期望的结果.
配置如下,所以意思是symbol = "AAPL"要修改成longport支持的symbol ?
[store.AAPL_longport] region = "US" currency = "USD" broker = "longport" symbol = "AAPL" trade_strategy = "hodl" trade_type = "stock" name = "apple" enable = true visible = true max_shares = 12345 state_file_path = "./state-{broker}-{symbol}-stage{stage}.json" state_archive_folder = "./hodl/archive-{broker}-{symbol}" buy_spread_rate = 0.0 sell_spread_rate = 0.004 buy_order_rate = 0.002 sell_order_rate = 0.002 precision = 2 shares_per_unit = 1 booting_check = true base_price_last_buy = true base_price_last_buy_days = 21 base_price_day_low = true base_price_tumble_protect = true base_price_using_broker = true tumble_protect_day_range = 7 tumble_protect_rsi = true tumble_protect_rsi_unlock_limit = 75 tumble_protect_rsi_warning_limit = 25 lock_position = true price_rate = 1.0 rework_level = 1 market_price_rate = 0.005 sleep_mode = true
持仓设置看起来没问题, 可能是broker节的设定关系 你可以直接在根目录 debug broker 对象, 了解连接环境:
from hodl.tools import *
from hodl.broker import *
v = VariableTools('/your/config/toml/path')
bc = v.broker_config_dict('longport')
broker = LongPortApi(
broker_config=bc,
symbol='AAPL',
name='',
)
broker.on_init()
print("cash:", broker.query_cash())
print("AAPL chips:", broker.query_chips())
11-19 00:13:25.442|WARNING:流程异常: 11-19 00:13:31.613|ERROR:更新收工状态/持仓/现金/行情时出现错误: Traceback (most recent call last): File "/home/xinmans/mydev/HODL/hodl/store_hodl.py", line 375, in on_current self.prepare_chip()