GithubHelp home page GithubHelp logo

thrasher-corp / gocryptotrader Goto Github PK

View Code? Open in Web Editor NEW
2.9K 145.0 780.0 49.86 MB

A cryptocurrency trading bot and framework supporting multiple exchanges written in Golang.

License: MIT License

Go 98.37% HTML 0.33% CSS 0.13% JavaScript 0.10% TypeScript 0.84% Makefile 0.01% Smarty 0.01% Dockerfile 0.02% Shell 0.01% Batchfile 0.01% SCSS 0.19% PowerShell 0.01%
cryptocurrency trading-bot trading-platform golang exchange go cryptocurrency-trading-bot trading-framework algorithmic-trading algorithmic-trading-library

gocryptotrader's People

Contributors

140am avatar beadko avatar crackcomm avatar cranktakular avatar dackroyd avatar dependabot-preview[bot] avatar dependabot[bot] avatar ermalguni avatar gbjk avatar geseq avatar gloriouscode avatar herenow avatar khcchiu avatar lrascao avatar madcozbadd avatar marcofranssen avatar mshogin avatar rots avatar samuael avatar shazbert avatar soxipy avatar taltam avatar thrasher- avatar tk42 avatar vadimzhukck avatar vazha avatar woshidama323 avatar xtda avatar yangrq1018 avatar ydm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gocryptotrader's Issues

How to run this thing?

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

Websocket need to be replaced?

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.)

Error: yahoo returned zero currency data

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

Compiling Error

Hello there,

I am running into the following error:

github.com/thrasher-/gocryptotrader

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

[Bittrex] PlaceBuyLimit / PlaceSellLimit does not work

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) .

poloniex Push API in WAMP

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?

should remove tag `string`

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"

Initial empty state of WebUI

I have compiled and run GoCryptotrader. Have launched web UI. Now it looks like this:

gocrypto

I have used default config file.

All links in navbar (Dashboard, Wallets, Settings) do look the same โ€” empty. Is it normal? Or maybe I do something wrong?

Bitfinex API update

On Saturday, November 11th, Bitfinex will be making two small adjustments to REST API v1.

  1. Order Book (/v1/book): The default response will return 25 bid and 25 ask price points instead of the full snapshot. The "limit_bids" and "limit_asks" options will remain available to request a custom number of price points.
  2. Trades (/v1/trades): The default response will return the last 100 trades instead of 1000. The "limit_trades" option will remain available to request a custom number of trades.

Selective test option (test gdax only in ./testdata/configtest.json").

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.

API HTTP request timeout

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!

Possible missing data?

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

Huobi api changes

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!

BTCC Websocket Json error.

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

Metrics/tracing

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?

Unify Response when all market or single market

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?

BTCC Websocket Json erro.

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

liqui.io api

Have you by any chance done any work on the liqui.io api?

Release?

Heya!

Yes I am still stalking your project, is there any update on testing/releases?

Yours Faithfully,
RDash

Ripple XRP 'Tag' Field

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.

Concurrent websocket connection panic

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.

SaveConfig websocket event does not save/update config

See attached video demonstrating:
2018-05-07_19-45-32

Ruled out causes:

  • Front-end config caching
  • Sending inaccurate data. The config data sent with the event is accurate data. See attached cut response:
    {"Event":"SaveConfig","data":{"Cryptocurrencies":"BTC,LTC,ETH,XRP,NMC,NVC,PPC,XBT,DOGE,DASH","CurrencyExchangeProvider":"fixer","Exchanges":[{"Name":"ANX","Enabled":false,"......

Possible causes:

  • GCT Server does not save, just reloads on save event
  • GCT front-end appends extra data to the config object. 'SaveConfig' event sends extra data so GCT server may dismiss the event. No errors or logs are returned about it failing. See below for extra data attached per exchange:
    "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}]},

Hardcoded ticker name index in poloniex.go

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: {
    .....
},

Tests get stuck at binance module (Travis and Local)

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

socket.io error connect fair-value.js cannot read property of undefined

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.

Cannot checkout

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

Binance websocket

Hey, in Readme i think there is an error, Binance supports streaming api!

I'd like to help

So, as such, I'm curious what your next steps, etc might be :).

npm start error, which version does it need?

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
`

Unused struct and wrong fields

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"

Web interface

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!

[Bug] Asks/Bids data is the same in poloniex

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})
 	}

Data races in the exchanges Setup and Run functions

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?.

use of float64 to represent currency values

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?

OKEX "invalid symbol string" for every 4th websocket request

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!

Asking password again and again when running binary

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.