thrasher-corp / gocryptotrader Goto Github PK
View Code? Open in Web Editor NEWA cryptocurrency trading bot and framework supporting multiple exchanges written in Golang.
License: MIT License
A cryptocurrency trading bot and framework supporting multiple exchanges written in Golang.
License: MIT License
Hello,
There is a web/ folder in the repository which hasn't been updated for 5 months now.
I would like to know if there is still someone working on it or if it has been moved to another repository, etc?
Thanks a lot for all the work!
npm WARN deprecated [email protected]: ..psst! While Bower is maintained, we recommend Yarn and Webpack for *new* front-end projects! Yarn's advantage is security and reliability, and Webpack's is support for both CommonJS and AMD projects. Currently there's no migration path, but please help to create it: https://github.com/bower/bower/issues/2467 npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130 npm WARN deprecated [email protected]: Use uuid module instead
`npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
[email protected] start /home/eric/APP/GOPATH/src/github.com/thrasher-/gocryptotrader/web
node server.js
events.js:160
throw er; // Unhandled 'error' event
^
Error: listen EACCES 0.0.0.0:80
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at Server._listen2 (net.js:1245:19)
at listen (net.js:1294:10)
at Server.listen (net.js:1390:5)
at EventEmitter.listen (/home/eric/APP/GOPATH/src/github.com/thrasher-/gocryptotrader/web/node_modules/express/lib/application.js:618:24)
at Object. (/home/eric/APP/GOPATH/src/github.com/thrasher-/gocryptotrader/web/server.js:61:5)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
npm ERR! Linux 4.10.0-27-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-seed
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-seed
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/eric/APP/GOPATH/src/github.com/thrasher-/gocryptotrader/web/npm-debug.log
`
As websocket for BTCC enabled, I got the following error:
2016/11/18 20:51:09 BTCC Connected to Websocket.
2016/11/18 20:51:09 BTCC Websocket subscribing to channel: "marketdata_cnybtc".
2016/11/18 20:51:09 BTCC Websocket subscribing to channel: "grouporder_cnybtc".
2016/11/18 20:51:09 BTCC btccny: Last 774.326916 (5332.830000) High 777.974340 (5357.950000) Low 755
.040000 (5200.000000) Volume 2001814.166100
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
How to retrieve the order book directly from the bitfinex client? It looks like it only logs it to stdoutput
Push API
The best way to get public data updates on markets is via the push API, which pushes live ticker, order book, trade, and Trollbox updates over WebSockets using the WAMP protocol. In order to use the push API, connect to wss://api.poloniex.com and subscribe to the desired feed.
It is better to use the Push API than Public API for poloniex, limit calls of public API 6 per seconds. If I want to use this what is the steps for implementing this? there are 2 github reposotories for dealing with WAMP in golang turnpike and nexus. What do you think of them?
Heya!
Yes I am still stalking your project, is there any update on testing/releases?
Yours Faithfully,
RDash
runs well until this error:
error
2018/01/08 19:28:09 Currency recv: {"query":{"count":0,"created":"2018-01-08T18:28:07Z","lang":"en-US","results":null}}
2018/01/08 19:28:09 Fatal error retrieving config currencies. Error: yahoo returned zero currency data
What would be causing this:
13:14:45.664 main Requiring authentication to web client
13:14:45.707 main Listening to admins on port 3000
13:14:45.717 broker Exchange details { exchange: 'OkCoin',
pair: 'BTC/USD',
minTick: 0.01,
minSize: 0.01,
makeFee: 0.001,
takeFee: 0.002,
hasSelfTradePrevention: false }
13:14:45.731 main Unhandled rejection! TypeError: Cannot read property 'value' of undefined
at new FairValueEngine (/opt/finbots/K/Krypto-trading-bot/app/server/fair-value.js:22:67)
at Object. (/opt/finbots/K/Krypto-trading-bot/app/server/main.js:204:22)
at next (native)
at fulfilled (/opt/finbots/K/Krypto-trading-bot/app/server/main.js:4:58)
at process._tickCallback (internal/process/next_tick.js:109:7)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3 Promise {
TypeError: Cannot read property 'value' of undefined
at new FairValueEngine (/opt/finbots/K/Krypto-trading-bot/app/server/fair-value.js:22:67)
at Object. (/opt/finbots/K/Krypto-trading-bot/app/server/main.js:204:22)
at next (native)
at fulfilled (/opt/finbots/K/Krypto-trading-bot/app/server/main.js:4:58)
at process._tickCallback (internal/process/next_tick.js:109:7)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3 }
13:14:45.762 main Error THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END
13:14:47.462 okcoin Successfully connected to addChannel: ok_sub_spotusd_btc_depth_20
13:14:47.465 okcoin Successfully connected to addChannel: ok_sub_spotusd_btc_trades
13:14:47.467 okcoin Successfully connected to login
13:14:47.762 main Exit code 0
error: Forever detected script exited with code: 0
error: Script restart attempt #1
13:14:48.996 main Requiring authentication to web client
13:14:49.047 main Listening to admins on port 3000
13:14:49.067 broker Exchange details { exchange: 'OkCoin',
Thank you for your answer.
On Saturday, November 11th, Bitfinex will be making two small adjustments to REST API v1.
Does gocryptotrader support multi accounts on one exchange? What's the usage of ClientID?
Hello, What do you think of Unifying Response when all market or single market. It will be all like this [market{}, ] in regards to all or single market.
Now you return interface and the struct differ depends on what asked if you return just one struct and you put the currencypair as map it would be easy to deal with.
What do you think?
Hi! Could you change the api for HUOBI exchange, because of new updates on Huobi api? It will need to send privateSignature soon for authorized requests! I tried to do it by myself but was fallen.
I will be grateful for your help!
Any plans to support contracts exchanges like okex?
I noticed there isn't any operational metrics, or tracing enabled on any apis. If I add this as a PR would you be willing to take it?
The struct PoloniexAuthentictedTradeHistory is not used currently.
The function GetAuthenticatedTradeHistory should ideally be returning an array of the above struct. Instead it is using a wrong struct (PoloniexOrder).
Additionally, the struct PoloniexAuthentictedTradeHistory has to fixed. The Date field member should actually be:
Date string json:"date"
It is currently wrong as: Date string json:"data,string"
Hello there,
I am running into the following error:
go/src/github.com/thrasher-/gocryptotrader/poloniexwebsocket.go:135: not enough arguments in call to turnpike.NewWebsocketClient
Personally I know this is not production yet, personally I wanted to see how it works.
Regards,
RDash
I'm trying to get ticker updates across multiple exchanges. In config.json I have enabled those exchanges and the data is streaming in. Now I'm writing the client which can consume those tickers updates and I'm stumbled a bit, cause the records which are getting streamed in do not contain exchange information (from which exchange the ticker update came from). Now, since BTCUSD and BTC_USD tickers are not the same I could build a mapping for those things, but exchanges which I'm currently looking at have the same ticker ID.
I would like to know from which exchange those ticker updates came from. Is there a way of doing this already or we should build this feature?
The second thing I see which is missing is the timestamps. Shouldn't those ticker updates be timestamped when they are read from the exchange?
Thanks
`func main() {
// Binance client
binance := binance.New(API_KEY, API_SECRET)
// Get Exchange info
test, err := binance.GetExchangeInfo()
fmt.Println(err, test)
}`
Response:
[ ]
Some troubles with decoding? I don't need nil
How to solve it?
Maybe check out https://github.com/toorop/go-bittrex
See attached video demonstrating:
Ruled out causes:
{"Event":"SaveConfig","data":{"Cryptocurrencies":"BTC,LTC,ETH,XRP,NMC,NVC,PPC,XBT,DOGE,DASH","CurrencyExchangeProvider":"fixer","Exchanges":[{"Name":"ANX","Enabled":false,"......
Possible causes:
"Pairs":[{"Name":"BTCUSD","ParsedName":"BTCUSD","Enabled":false},{"Name":"BTCHKD","ParsedName":"BTCHKD","Enabled":true},{"Name":"BTCEUR","ParsedName":"BTCEUR","Enabled":true},{"Name":"BTCCAD","ParsedName":"BTCCAD","Enabled":true},{"Name":"BTCAUD","ParsedName":"BTCAUD","Enabled":true},{"Name":"BTCSGD","ParsedName":"BTCSGD","Enabled":true},{"Name":"BTCJPY","ParsedName":"BTCJPY","Enabled":true},{"Name":"BTCGBP","ParsedName":"BTCGBP","Enabled":true},{"Name":"BTCNZD","ParsedName":"BTCNZD","Enabled":true},{"Name":"LTCBTC","ParsedName":"LTCBTC","Enabled":true},{"Name":"DOGEBTC","ParsedName":"DOGEBTC","Enabled":true},{"Name":"STRBTC","ParsedName":"STRBTC","Enabled":true},{"Name":"XRPBTC","ParsedName":"XRPBTC","Enabled":true}]},
type PoloniexResultingTrades struct {
....
//Type string json:"type,string"
// this line is wrong and has to be changed to
Type string json:"type"
}
The field Type was being interpreted as string of a string which threw an error.
Please refer if needed: https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/RbQaqxStMiY
https://github.com/thrasher-/gocryptotrader/blob/4b98f01200ce574007bc56db79f01735903ff3b2/exchanges/okex/okex_types.go#L124
Should be {Vol float64 json:"vol,string"
}
I was trying to figure out why the travis builds are failing. I figured the tests get stuck at the binance module, meaning next tests won't execute and probably this causes the travis build to timeout or something like that.
As I'm pretty new to golang I'm not sure how to troubleshoot where exactly it gets stuck.
See below for commandline output:
$ go version
go version go1.10.2 windows/amd64
$ go test -race -coverprofile=profile.out -covermode=atomic -cover ./...
ok github.com/thrasher-/gocryptotrader 6.976s coverage: 31.4% of statements
ok github.com/thrasher-/gocryptotrader/common 2.556s coverage: 89.9% of statements
? github.com/thrasher-/gocryptotrader/communications [no test files]
ok github.com/thrasher-/gocryptotrader/communications/base 1.214s coverage: 40.3% of statements
ok github.com/thrasher-/gocryptotrader/communications/slack 1.874s coverage: 25.2% of statements
ok github.com/thrasher-/gocryptotrader/communications/smsglobal 1.488s coverage: 73.8% of statements
ok github.com/thrasher-/gocryptotrader/communications/smtpservice 1.686s coverage: 95.0% of statements
ok github.com/thrasher-/gocryptotrader/communications/telegram 1.750s coverage: 21.2% of statements
ok github.com/thrasher-/gocryptotrader/config 10.883s coverage: 64.0% of statements
ok github.com/thrasher-/gocryptotrader/currency 2.187s coverage: 82.6% of statements
ok github.com/thrasher-/gocryptotrader/currency/forexprovider 1.181s coverage: 0.0% of statements [no tests to run]
ok github.com/thrasher-/gocryptotrader/currency/forexprovider/base 1.198s coverage: 0.0% of statements [no tests to run]
ok github.com/thrasher-/gocryptotrader/currency/forexprovider/currencyconverterapi 3.356s coverage: 78.1% of statements
ok github.com/thrasher-/gocryptotrader/currency/forexprovider/currencylayer 2.611s coverage: 61.9% of statements
ok github.com/thrasher-/gocryptotrader/currency/forexprovider/fixer.io 2.002s coverage: 34.1% of statements
ok github.com/thrasher-/gocryptotrader/currency/forexprovider/openexchangerates 2.458s coverage: 47.4% of statements
ok github.com/thrasher-/gocryptotrader/currency/pair 1.174s coverage: 100.0% of statements
ok github.com/thrasher-/gocryptotrader/currency/symbol 1.332s coverage: 100.0% of statements
ok github.com/thrasher-/gocryptotrader/currency/translation 1.194s coverage: 100.0% of statements
ok github.com/thrasher-/gocryptotrader/events 1.180s coverage: 0.0% of statements [no tests to run]
ok github.com/thrasher-/gocryptotrader/exchanges 1.379s coverage: 100.0% of statements
ok github.com/thrasher-/gocryptotrader/exchanges/alphapoint 1.203s coverage: 1.9% of statements
ok github.com/thrasher-/gocryptotrader/exchanges/anx 3.332s coverage: 25.0% of statements
ok github.com/thrasher-/gocryptotrader/exchanges/binance 2.063s coverage: 64.5% of statements
Hi, may add some screens and a faq what the bot do, and how
Is there a way to refer to an XRP Tag within the PortfolioAddresses in the config? There seems to be a reference to XRP in the bitstamp code that refers to a 'destTag', but that's all I'm able to find.
In Poloniex code, the following code needs to be fixed
for x, _ := range resp.Bids {
- data := resp.Asks[x]
+ data := resp.Bids[x]
price, _ := strconv.ParseFloat(data[0].(string), 64)
amount := data[1].(float64)
ob.Bids = append(ob.Bids, PoloniexOrderbookItem{Price: price, Amount: amount})
}
In poloniex.go, the below lines with hardcoded indexes are not correct.
tickerPrice.FirstCurrency = currency[0:3]
tickerPrice.SecondCurrency = currency[3:]
The ticker result is sometimes as shown below where there are there more than 4 chars in the ticker code:
USDT_DASH: {
.....
},
Yahoo is down and fixer now requires user registration. Working on a commit which should be ready in the next 24 hours.
I'd love to be able to specify a timeout for all API requests. For example I would not be happy if my buyLimit or sellLimit takes too long to execute in a highly volatile market.
Even better is to also be able to provide my own custom HTTP handler where I can set other configurations along with timeout.
Currently the API uses a default HTTP handler as can be seen here: https://github.com/thrasher-/gocryptotrader/blob/9671368f596c2b33253a374294f2ab5fb0838dc4/common/common.go#L277
@toorop achieves this in his Bittrex API by providing a NewWithCustomHttpClient() constructor: https://github.com/toorop/go-bittrex/blob/48e6248b8c9b29d3eb8ce0359a0f794fc17000e5/bittrex.go#L27
Please let me know if I wasn't clear enough.
Thanks for sharing this codebase! It's proving very useful!
As websocket for BTCC enabled, I got the following error:
2016/11/18 20:51:09 BTCC Connected to Websocket.
2016/11/18 20:51:09 BTCC Websocket subscribing to channel: "marketdata_cnybtc".
2016/11/18 20:51:09 BTCC Websocket subscribing to channel: "grouporder_cnybtc".
2016/11/18 20:51:09 BTCC btccny: Last 774.326916 (5332.830000) High 777.974340 (5357.950000) Low 755
.040000 (5200.000000) Volume 2001814.166100
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
float64
2016/11/18 20:51:10 json: invalid use of ,string struct tag, trying to unmarshal unquoted value into
PS D:\Projects\Go\Learning> go get github.com/thrasher-/gocryptotrader
package golang.org/x/net/websocket: unrecognized import path "golang.org/x/net/websocket" (https fetch: Get https://golang.org/x/net/websocket?go-get=1: dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)
I have followed your steps, but it does not run.
go get github.com/thrasher-/gocryptotrader
cd $GOPATH/src/github.com/thrasher-/gocryptotrader
go install
cp $GOPATH/src/github.com/thrasher-/gocryptotrader/config_example.dat $GOPATH/bin/config.da
./$GOPATH/bin/gocryptotrader
output:
...
...
goroutine 113 [running]:
net/url.url.Values.Set(...)
/usr/local/Cellar/go/1.9.2/libexec/src/net/url/url.go:790
github.com/thrasher-/gocryptotrader/exchanges/bitfinex.(*Bitfinex).UpdateOrderbook(0xc42007fd40, 0x0, 0x0, 0xc42001c300, 0x3, 0xc42001c303, 0x3, 0xc420018c50, 0x4, 0x0, ...)
/Users/aidas/go/src/github.com/thrasher-/gocryptotrader/exchanges/bitfinex/bitfinex_wrapper.go:83 +0xb1
main.OrderbookUpdaterRoutine()
/Users/aidas/go/src/github.com/thrasher-/gocryptotrader/routines.go:255 +0x67f
created by main.main
/Users/aidas/go/src/github.com/thrasher-/gocryptotrader/main.go:205 +0x10b2
I have also tried docker docker-compose up
but it says:
Building web
ERROR: Cannot locate specified Dockerfile: Dockerfile
Hi, I'm new to this package, but I was wondering why coin values are represented as float64's? Will this not lead to rounding issues when multiple conversions are performed with these value, and perhaps in the end one would "loose" a small fraction of a coin due to rounding/float64 math? Would it not be better to represent coin values using the Decimal package?
Hello.
Thanks for your answers.
When I compile for Windows. Like discribed here:
go get github.com/thrasher-/gocryptotrader
cd %GOPATH%\src\github.com\thrasher-\gocryptotrader
go install
copy %GOPATH%\src\github.com\thrasher-\gocryptotrader\config_example.json %GOPATH%\bin\config.json
I run the gocryptotrader binary than encrypt standart config.json (without changes)
It asks me a password I'm entering from config file ("Password")
And it asks to repeat and after entering it continuing to asking password again and again and nothing changes. And even if I change password in config it will repeating same.
What I do wrong?
When following the compilig instructions, I get the following error on
go get github.com/thrasher-/gocryptotrader
:
# github.com/thrasher-/gocryptotrader
../../golang/src/github.com/thrasher-/gocryptotrader/poloniexwebsocket.go:136:40: not enough arguments in call to turnpike.NewWebsocketClient
have (turnpike.Serialization, string, nil)
want (turnpike.Serialization, string, *tls.Config, turnpike.DialFunc)
../../golang/src/github.com/thrasher-/gocryptotrader/poloniexwebsocket.go:158:24: not enough arguments in call to c.Subscribe
have (string, func([]interface {}, map[string]interface {}))
want (string, map[string]interface {}, turnpike.EventHandler)
../../golang/src/github.com/thrasher-/gocryptotrader/poloniexwebsocket.go:162:24: not enough arguments in call to c.Subscribe
have (string, func([]interface {}, map[string]interface {}))
want (string, map[string]interface {}, turnpike.EventHandler)
../../golang/src/github.com/thrasher-/gocryptotrader/poloniexwebsocket.go:168:25: not enough arguments in call to c.Subscribe
have (string, func([]interface {}, map[string]interface {}))
want (string, map[string]interface {}, turnpike.EventHandler)
Cant follow through and try this great lib
If i want to say test gdax only, then it fails. I edited the testdata/configtest.json to only have gdax.
I can see some hardcoded strings for Btifinex so probably issue is something to do with this, so maybe a more programmatic test that reads the config and just tests whatever the config requires is needed ?.
I can try to help with this.
There is not exists a Dockerfile in web directory, but refenerced in docker-compose.yml
Hey, in Readme i think there is an error, Binance supports streaming api!
It is redirecting to coinbase
for example in here (g *GDAX) Setup(exch config.ExchangeConfig)
the Verbose and Websocket flags being written to
and here
func (g *GDAX) Run()
, this time Verbose and Websocket flags being read, since both are separate go routines.
Issue is mainly caused by calling the ReloadExchange function. Do we need to reload, are these flags meant to be modified?. Is loading and unloading not sufficient?.
Hi! I am using websocket on OKEX and I added available pair neo_eth
which OKEX. The request succeeds 1 time in 4 and fails 3 times.
I changed the error to print the strings being compared:
// CheckSymbol checks to see if the string is a valid symbol for okex
func (o *OKEX) CheckSymbol(symbol string) error {
if !common.StringDataCompare(o.CurrencyPairs, symbol) {
return fmt.Errorf("invalid symbol string: `symbol`=`%s`, `o.CurrencyPairs`=`%s`", symbol, o.CurrencyPairs)
}
return nil
}
This results
2018/02/17 18:04:54 OKEX NEO-ETH SPOT: Orderbook Bids len: 150 Amount: 1689730.667599 neo. Total value: 79.612156 Asks len: 45 Amount: 271.975099 neo. Total value: 62.996811
2018/02/17 18:04:54 Failed to get neo_eth OKEX orderbook. Error: invalid symbol string: `symbol`=`neo_eth`, `o.CurrencyPairs`=`[btc_usd ltc_usd eth_usd etc_usd bch_usd]`
2018/02/17 18:04:54 Failed to get neo_eth OKEX orderbook. Error: invalid symbol string: `symbol`=`neo_eth`, `o.CurrencyPairs`=`[btc_usd ltc_usd eth_usd etc_usd bch_usd]`
2018/02/17 18:04:54 Failed to get neo_eth OKEX orderbook. Error: invalid symbol string: `symbol`=`neo_eth`, `o.CurrencyPairs`=`[btc_usd ltc_usd eth_usd etc_usd bch_usd]`
This is when using this config for OKEX:
{
"Name": "OKEX",
"Enabled": true,
"Verbose": false,
"Websocket": true,
"UseSandbox": false,
"RESTPollingDelay": 10,
"AuthenticatedAPISupport": true,
"APIKey": "******",
"APISecret": "******",
"AvailablePairs": "neo_eth,ltc_btc,eth_btc,etc_btc,bch_btc,btc_usdt,eth_usdt,ltc_usdt,etc_usdt,bch_usdt,etc_eth,bt1_btc,bt2_btc,btg_btc,qtum_btc,hsr_btc,neo_btc,gas_btc,qtum_usdt,hsr_usdt,neo_usdt,gas_usdt,btc_usd,ltc_usd,eth_usd,etc_usd,bch_usd",
"EnabledPairs": "neo_eth",
"BaseCurrencies": "USD",
"AssetTypes": "SPOT,this_week,next_week,quarter",
"ConfigCurrencyPairFormat": {
"Uppercase": false,
"Delimiter": "_"
},
"RequestCurrencyPairFormat": {
"Uppercase": false,
"Delimiter": "_"
}
So why do I get 3 errors fetching an array of [btc_usd ltc_usd eth_usd etc_usd bch_usd]
? I have not enabled those pairs.
Thanks!
So, as such, I'm curious what your next steps, etc might be :).
https://github.com/thrasher-/gocryptotrader/blob/b8e4f497a32479bf13c09a99f3b2840c4ff6a74b/exchanges/okcoin/okcoin_types.go#L120
https://github.com/thrasher-/gocryptotrader/blob/b8e4f497a32479bf13c09a99f3b2840c4ff6a74b/exchanges/okcoin/okcoin_types.go#L123
should be
type Trades struct {
Amount float64 json:"amount"
Date int64 json:"date"
DateMS int64 json:"date_ms"
Price float64 json:"price"
TradeID int64 json:"tid"
Type string json:"type"
}
if not, it will has an error "json: invalid use of ,string struct tag, trying to unmarshal unquoted value into float64"
Have you by any chance done any work on the liqui.io api?
The bug can be fixed if you change as follows.
e.g., bittrexAPIGetBalances => bittrexAPIBuyLimit
func (b *Bittrex) PlaceBuyLimit(currencyPair string, quantity, rate float64) ([]UUID, error) { .... path := fmt.Sprintf("%s/%s", bittrexAPIURL, bittrexAPIGetBalances) .
2018/04/23 17:03:37 New websocket client connected. Connected clients: 1. Limit 1. 2018/04/23 17:03:37 GET /ws ws 2.5198ms 2018/04/23 17:03:37 Websocket req: auth 2018/04/23 17:03:37 Websocket client authenticated successfully
...
`panic: concurrent write to websocket connection
goroutine 139 [running]:
github.com/gorilla/websocket.(*Conn).flushFrame(0xc0422db680, 0x1, 0x0, 0x0, 0x0, 0x0, 0xc04228b9b0)
C:/Users/User/gocode/src/github.com/gorilla/websocket/conn.go:519 +0x66d
github.com/gorilla/websocket.(*messageWriter).Close(0xc042208018, 0xab0a20, 0xc042216780)
C:/Users/User/gocode/src/github.com/gorilla/websocket/conn.go:642 +0x82
github.com/gorilla/websocket.(*Conn).WriteJSON(0xc0422db680, 0xab0a20, 0xc042216780, 0xc042216780, 0x40bab963d70a3d71)
C:/Users/User/gocode/src/github.com/gorilla/websocket/json.go:27 +0x119
main.BroadcastWebsocketMessage(0xb49b50, 0x4, 0xc042134730, 0x4, 0xb50f76, 0xd, 0xaf7080, 0xc042148080, 0xc04228bb60, 0x411a1c)
C:/Users/User/gocode/src/github.com/thrasher-/gocryptotrader/websocket.go:121 +0xf4
main.relayWebsocketEvent(0xaf7080, 0xc042148080, 0xb50f76, 0xd, 0xc042134730, 0x4, 0xb49b50, 0x4)
C:/Users/User/gocode/src/github.com/thrasher-/gocryptotrader/routines.go:169 +0xf0
main.TickerUpdaterRoutine()
C:/Users/User/gocode/src/github.com/thrasher-/gocryptotrader/routines.go:215 +0x7d3
created by main.main
C:/Users/User/gocode/src/github.com/thrasher-/gocryptotrader/main.go:129 +0xb12`
Happy to make any adjustments in the front end if needed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.