coinrust / crex

A Golang cryptocurrency trading API & Library. Support Binance, BitMEX, Deribit, Bybit, Huobi DM, OKEX Futures and more.
MIT License
512 stars 154 forks source link

策略的CONFIG 文件不支持 passphrase 参数 #20

Closed redkiller79 closed 4 years ago

redkiller79 commented 4 years ago

无法使用OKEX的进行交易 总是提示 result: status=400, message=400 Bad Request, body={"error_message":"OK-ACCESS-PASSPHRASE header is required","code":30004,"error_code":"30004","message":"OK-ACCESS-PASSPHRASE header is required"} 2020/10/03 15:08:05 Http error(400~500) result: status=400, message=400 Bad Request, body={"error_message":"OK-ACCESS-PASSPHRASE header is required","code":30004,"error_code":"30004","message":"OK-ACCESS-PASSPHRASE header is required"} 2020/10/03 15:08:05 Http error(400~500) result: status=400, message=400 Bad Request, body={"error_message":"OK-ACCESS-PASSPHRASE header is required","code":30004,"error_code":"30004","message":"OK-ACCESS-PASSPHRASE header is required"}

f0cii commented 4 years ago

OKEx配置中需要添加: passphrase。参考代码: ex := exchanges.NewExchange(exchanges.OkexFutures, //ApiProxyURLOption("socks5://127.0.0.1:1080"), // 使用代理 ApiAccessKeyOption("[accessKey]"), ApiSecretKeyOption("[secretKey]"), ApiPassPhraseOption("[passphrase]"), // 注意这个参数,OKEx需要指定此参数 ApiWebSocketOption(true)) // 开启 WebSocket

redkiller79 commented 4 years ago

在策略gambler-short的目录下的config.toml 里添加了PassPhrase 设置 任然提示这个错误

redkiller79 commented 4 years ago

crex-master/serve 下的server.go 里也缺少 PassPhrase 参数

redkiller79 commented 4 years ago

如果是直接在策略gambler-short的main.go里添加 你说的代码应该怎么添加 请教一下

f0cii commented 4 years ago

参考serve.go代码: https://github.com/coinrust/crex/blob/master/serve/serve.go 请更新最新版本crex v1.2.11,已经支持passphrase参数。

redkiller79 commented 4 years ago

我更新试试,希望和您多交流下量化策略

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: frankrap <notifications@github.com> 发送时间: 2020年10月3日 17:12 收件人: coinrust/crex <crex@noreply.github.com> 抄送: redkiller79 <655174@qq.com>, Author <author@noreply.github.com> 主题: 回复:[coinrust/crex] 策略的CONFIG 文件不支持 passphrase 参数 (#20)

参考serve.go代码: https://github.com/coinrust/crex/blob/master/serve/serve.go 请更新最新版本crex v1.2.11,已经支持passphrase参数。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

redkiller79 commented 4 years ago

2020/10/03 19:23:09 Currency: USDT 2020/10/03 19:23:09 Symbol: ETH-USDT-SWAP 2020/10/03 19:23:09 {"event":"login","success":true} Http error(400~500) result: status=400, message=400 Bad Request, body={"error_message":"Contract does not exist","code":35001,"error_code":"35001","message":"Contract does not exist"} 2020/10/03 19:23:09 Http error(400~500) result: status=400, message=400 Bad Request, body={"error_message":"Contract does not exist","code":35001,"error_code":"35001","message":"Contract does not exist"} 2020/10/03 19:23:09 Http error(400~500) result: status=400, message=400 Bad Request, body={"error_message":"Contract does not exist","code":35001,"error_code":"35001","message":"Contract does not exist"} 好像不支持OKEX的永久合约

redkiller79 commented 4 years ago

我把gambler-shortx下的配置i文件里的币种和标题换成任何都是提示 2020/10/03 19:48:25 Http error(400~500) result: status=400, message=400 Bad Request, body={"error_message":"Contract does not exist","code":35001,"error_code":"35001","message":"Contract does not exist"} 2020/10/03 19:48:25 Http error(400~500) result: status=400, message=400 Bad Request, body={"error_message":"Contract does not exist","code":35001,"error_code":"35001","message":"Contract does not exist"}

[option] currency = "BTC" # 货币 BTC symbol = "BTCUSD" # 标 BTCUSD

redkiller79 commented 4 years ago

https://github.com/frankrap/huobi-api/hbdm 已经无法引用

f0cii commented 4 years ago

应该可以引用,浏览器访问需要访问: https://github.com/frankrap/huobi-api/tree/master/hbdm go程序中可以直接引用 github.com/frankrap/huobi-api/hbdm

redkiller79 commented 4 years ago

都调试成功了,但是策略总在okex的永续合约提示价格有问题无法下单,火币的永续合约提示杠杆为空

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: frankrap <notifications@github.com> 发送时间: 2020年10月4日 09:22 收件人: coinrust/crex <crex@noreply.github.com> 抄送: redkiller79 <655174@qq.com>, Author <author@noreply.github.com> 主题: 回复:[coinrust/crex] 策略的CONFIG 文件不支持 passphrase 参数 (#20)