Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu下wtpy的HFT策略的问题 #110

Closed
jawa10 opened this issue Jun 14, 2023 · 1 comment
Closed

Ubuntu下wtpy的HFT策略的问题 #110

jawa10 opened this issue Jun 14, 2023 · 1 comment

Comments

@jawa10
Copy link

jawa10 commented Jun 14, 2023

你好,我参考发布在B站的《Linux环境下运行wtpy的HFT策略》,在Ubuntu下尝试HFT时,执行python run.py报错, 而之后尝试在windows10下能够正常运行,配置文件和代码都相同。

Ubuntu下的错误包括
(一)找不到文件,好像是文件名前多了"lib": libtts_thosttraderapi_se.so: cannot open shared object file: No such file or directory
(二) segmentation violation

这是运行后的全部信息
[06.14 22:32:54 - info ] WonderTrader HFT production framework initialziedversion: UNIX v0.9.7 Build@Apr 4 2023 08:54:27
[06.14 22:32:54 - info ] Trading sessions loaded
[06.14 22:32:54 - info ] Commodities configuration file ../common/commodities.json loaded
[06.14 22:32:54 - info ] Contracts configuration file ../common/contracts.json loaded, 5 exchanges
[06.14 22:32:54 - info ] Holidays loaded
[06.14 22:32:54 - info ] Hot rules loaded
[06.14 22:32:54 - info ] Trading environment initialized, engine name: HFT
[06.14 22:32:54 - info ] Running mode: Production
[06.14 22:32:54 - debug] Filters configuration file filters.yaml not exists
[06.14 22:32:54 - info ] 38 fee templates loaded
[06.14 22:32:54 - warning] RiskMon is not configured, portfilio fund will be updated every 5s
[06.14 22:32:54 - info ] WtDataReader initialized, rt dir is ../FUT_Data/rt/, hist dir is ../FUT_Data/his/, adjust_flag is 0
[06.14 22:32:54 - info ] No adjusting factor file configured, loading skipped
[06.14 22:32:54 - info ] Data manager initialized
[06.14 22:32:54 - info ] Action policies initialized
[06.14 22:32:54 - info ] Reading parser config from tdparsers.yaml...
[06.14 22:32:54 - info ] [parser0] Parser module /home/ubuntu/.conda/envs/wtpy/lib/python3.10/site-packages/wtpy/wrapper/linux/parsers/libParserCTP.so loaded
[06.14 22:32:54 - info ] [parser0] Parser initialzied, check_time: false
[06.14 22:32:54 - info ] 1 parsers loaded
[06.14 22:32:54 - info ] Reading trader config from tdtraders.yaml...
[06.14 22:32:54 - info ] [simnow] Risk control rule default of trading channel loaded
[06.14 22:32:54 - info ] [simnow] Trader module /home/ubuntu/.conda/envs/wtpy/lib/python3.10/site-packages/wtpy/wrapper/linux/traders/libTraderCTP.so loaded
/home/ubuntu/.conda/envs/wtpy/lib/python3.10/site-packages/wtpy/wrapper/linux/traders/libtts_thosttraderapi_se.so: cannot open shared object file: No such file or directory
[06.14 22:32:54 - info ] 1 traders loaded
[06.14 22:32:54 - info ] 1 parsers started
[06.14 22:32:54 - error] segmentation violation

而在windows下,看起来没有类似的错误:
[06.14 22:45:21 - info ] WonderTrader HFT production framework initialzied,version: X64 v0.9.7 Build@Apr 4 2023 10:13:38
[06.14 22:45:21 - info ] Trading sessions loaded
[06.14 22:45:21 - info ] Commodities configuration file ../common/commodities.json loaded
[06.14 22:45:21 - info ] Contracts configuration file ../common/contracts.json loaded, 5 exchanges
[06.14 22:45:21 - info ] Holidays loaded
[06.14 22:45:21 - info ] Hot rules loaded
[06.14 22:45:21 - info ] Trading environment initialized, engine name: HFT
[06.14 22:45:21 - info ] Running mode: Production
[06.14 22:45:21 - debug] Filters configuration file filters.yaml not exists
[06.14 22:45:21 - info ] 38 fee templates loaded
[06.14 22:45:21 - warning] RiskMon is not configured, portfilio fund will be updated every 5s
[06.14 22:45:21 - info ] WtDataReader initialized, rt dir is ../FUT_Data/rt/, hist dir is ../FUT_Data/his/, adjust_flag is 0
[06.14 22:45:21 - info ] No adjusting factor file configured, loading skipped
[06.14 22:45:21 - info ] Data manager initialized
[06.14 22:45:21 - info ] Action policies initialized
[06.14 22:45:21 - info ] Reading parser config from tdparsers.yaml...
[06.14 22:45:21 - info ] [parser0] Parser module C:/Users/xxxxx/.conda/envs/wtpy/lib/site-packages/wtpy/wrapper/x64/parsers/ParserCTP.dll loaded
[06.14 22:45:21 - info ] [parser0] Parser initialzied, check_time: false
[06.14 22:45:21 - info ] 1 parsers loaded
[06.14 22:45:21 - info ] Reading trader config from tdtraders.yaml...
[06.14 22:45:21 - info ] [simnow] Risk control rule default of trading channel loaded
[06.14 22:45:21 - info ] [simnow] Trader module C:/Users/xxxxx/.conda/envs/wtpy/lib/site-packages/wtpy/wrapper/x64/traders/TraderCTP.dll loaded
[06.14 22:45:21 - info ] 1 traders loaded
[06.14 22:45:21 - info ] 1 parsers started
[06.14 22:45:21 - info ] registerFront: tcp://121.37.80.177:20002
[06.14 22:45:21 - info ] 1 trading channels started
[06.14 22:45:21 - info ] Market Data subscribed: CFFEX.IF.2306
[06.14 22:45:21 - info ] Trading day 20230615 begun
press any key to exit
[06.14 22:45:21 - info ] [ParserCTP] Market data server connected
[06.14 22:45:21 - info ] [ParserCTP] Market data server logined, 20230614
[06.14 22:45:21 - info ] [ParserCTP] Market data of 653 contracts subscribed totally
[06.14 22:45:21 - info ] [TraderCTP][9999-6374] Login succeed, AppID: simnow_client_test, Sessionid: 141635, login time: 22:45:21...
[06.14 22:45:21 - info ] [TraderCTP][9999-6374] Login succeed, trading date: 20230615...
[06.14 22:45:21 - info ] [TraderCTP][9999-6374] Querying confirming state of settlement data...
[06.14 22:45:21 - info ] [TraderCTP][9999-6374] Confirming settlement data...
[06.14 22:45:21 - info ] [TraderCTP][9999-6374] Trading channel initialized...
[06.14 22:45:21 - info ] [simnow] Trader login succeed, trading date: 20230615
[06.14 22:45:22 - info ] [simnow] Position data updated
[06.14 22:45:25 - info ] [simnow] Trading channel ready
[06.14 22:45:26 - info ] 理论价格3956.700000,最新价:3956.600000
[06.14 22:45:26 - info ] 出现正向信号

以下是其他信息:

版本:
Ubuntu 20.04.3 LTS
Python 3.10.10
wtpy-0.9.7.2和wtpy-0.9.8都报错

目录:demos\hft_fut\

配置文件(使用的是OpenCTP的7x24环境):
tdparsers.yaml
parsers:

  • active: false
    bport: 9001
    filter: ''
    host: 127.0.0.1
    id: parser2
    module: ParserUDP
    sport: 3997
  • active: true
    broker: '9999'
    frontxxx: tcp://180.168.146.187:10211
    front: tcp://121.37.80.177:20004
    id: parser0
    module: ParserCTP
    user: xxx
    pass: xxx
    ctpmodule: tts_thostmduserapi_se
    localtime: true

tdtraders.yaml
traders:

  • active: true
    appid: simnow_client_test
    authcode: '0000000000000000'
    broker: '9999'
    frontxxx: tcp://180.168.146.187:10201
    front: tcp://121.37.80.177:20002
    id: simnow
    module: TraderCTP
    user: xxx
    pass: xxx
    ctpmodule: tts_thosttraderapi_se
    quick: true
    riskmon:
    active: true
    policy:
    default:
    cancel_stat_timespan: 10
    cancel_times_boundary: 20
    cancel_total_limits: 470
    order_stat_timespan: 10
    order_times_boundary: 20
@wondertrader
Copy link
Owner

最新dev已经修复,后面发布会在0.9.8版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants