saniales / golang-crypto-trading-bot Goto Github PK
View Code? Open in Web Editor NEWA golang implementation of a console-based trading bot for cryptocurrency exchanges
License: GNU General Public License v3.0
A golang implementation of a console-based trading bot for cryptocurrency exchanges
License: GNU General Public License v3.0
see attached file
On some exchanges we have correct on other we have wrong ordering
I think that it can maybe helpfully. What do you think?
The bot should be able to know order status (eg. if an order is still open or is closed)
I have configured a yaml file like the following:
simulation_mode: true
exchange_configs:
- exchange: binance
public_key: aaa
secret_key: bbb
deposit_addresses: {}
fake_balances:
USDT: 35
strategies:
- strategy: prueba
markets:
- market: BTC-USDT
bindings:
- exchange: binance
market_name: BTCUSDT
I get an API error ([] <APIError> code=-1105, msg=Parameter 'interval' was empty.
) when I try to get the candles ( wrappers[0].GetCandles(markets[0])
).
The problem is in binance.go
file, line 236: binanceCandles, err := wrapper.api.NewKlinesService().Symbol(MarketNameFor(market, wrapper)).Do(context.Background())
NewKlinesService
create a new Klines service without Interval
field, only with the client (c
):
type KlinesService struct {
c *Client
symbol string
interval string
limit *int
startTime *int64
endTime *int64
}
func (c *Client) NewKlinesService() *KlinesService {
return &KlinesService{c: c}
}
Then (as you can see above), it calls a Symbol
method to set the symbol, but it never calls to Interval
method to set it.
Orderbook algorithm to group and cache data from hitbtc websocket does not work properly
Elements continue to miss and are not updated
http://docs.coinigy.apiary.io/
This will allow the bot to work with many exchanges with only a single interface. The title is very self-explanatory - take their 30 day trial and see if you like what you can do with it.
If we want to do a multi exchange strategy with an exchange which supports websocket and another one which does not, there should be a transparent switch to enable websocket or not
When running go get github.com/saniales/golang-crypto-trading-bot
the following is outputted to stdout/err:
github.com/saniales/golang-crypto-trading-bot imports
github.com/saniales/golang-crypto-trading-bot/cmd imports
github.com/saniales/golang-crypto-trading-bot/exchanges imports
github.com/adshao/go-binance: cannot find module providing package github.com/adshao/go-binance
Not sure but looks like a dependency broke
We should support HitBTC Exchange API
Add continuous integration
README at least must be changed
It should be possible to attach a logger to the bot
It would be awesome to have an example to create discord bots using the framework
this would be supported only on websocket mode, since polling would bring 429 error almost immediatly (assuming cap = 60 req/min, which is what most exchanges have as rate limit)
Go Wrapper
https://github.com/jsgoyette/gemini
API Definition
https://docs.gemini.com/rest-api/
Hi,
I'm trying to up and run this bot in simulation mode, But I don't know what to enter as strategy_name
.
Is there any default strategy? or I should implement one for my own?
thanks
Hi,
I would like to know if there Watch5Sec strategy should work for default? I had been trying to configure it in my config for testing and it is not working, the bot says the strategy does not exist. Do I need to add my own in the code?
thanks in advance
Implementation of the Bittrex API V2.0
in exchanges/bitfinex.go change this
// now let's create the cache
for price, amount := range orderbookMap {
if amount < 0 {
orderbook.Asks = insertSort(orderbook.Asks, environment.Order{
Value: decimal.NewFromFloat(price),
Quantity: decimal.NewFromFloat(amount),
}, false)
} else if amount > 0 {
orderbook.Bids = insertSort(orderbook.Bids, environment.Order{
Value: decimal.NewFromFloat(price),
Quantity: decimal.NewFromFloat(-amount),
}, true)
}
}
to this
// now let's create the cache
for price, amount := range orderbookMap {
if amount < 0 {
orderbook.Asks = insertSort(orderbook.Asks, environment.Order{
Value: decimal.NewFromFloat(price),
Quantity: decimal.NewFromFloat(-amount),
}, false)
} else if amount > 0 {
orderbook.Bids = insertSort(orderbook.Bids, environment.Order{
Value: decimal.NewFromFloat(price),
Quantity: decimal.NewFromFloat(amount),
}, true)
}
}
one of the project dependency
github.com/thebotguys/signalr
cant be find
Kucoin merged with #66 miss websocket support, add it
The example in Readme.me
file does not work.
package main
import bot "github.com/saniales/golang-crypto-trading-bot/cmd"
func main() {
bot.AddCustomStrategy(examples.MyStrategy)
bot.Execute()
}
AddCustomStrategy
function is undefined.
./main.go:6:6: undefined: bot.AddCustomStrategy
Hello,
I am using the .bot_config.yaml.example for my configuration. I have renamed the -strategy
field in this yaml to Watch5Sec
and I am receiving the error:
Cannot add tactic: Strategy Watch5Sec does not exist
Do I need to do anything in the main.go file of my project in order for this Strategy to be seen?
Where exactly do I need to handle the update function? Do you simply do it in binance.go for example in subscribeMarketSummaryFeed?
actually it is fixed to 1 hour, there should be the possibility to add a custom interval of refresh
Someone should update the readme with the table of supported exchanges
can be something like this
Exchange | REST | Websockets |
---|---|---|
Binance | Yes | Yes (public) |
... | ... | ... |
thebotguys/signalr Repository not found.
command line:
go get -u github.com/saniales/golang-crypto-trading-bot
# cd .; git clone -- https://github.com/thebotguys/signalr C:\projects\src\github.com\thebotguys\signalr
Cloning into 'C:\projects\src\github.com\thebotguys\signalr'...
remote: Repository not found.
fatal: repository 'https://github.com/thebotguys/signalr/' not found
package github.com/thebotguys/signalr: exit status 128
Hello @saniales , I've accidentally found this repo and seems you've already implemented several exchanges' connectivity that the other projects don't have.
As a golang developer, I would like to invite you to help with another crypto trading bot also written in golang:
https://github.com/c9s/bbgo
Also any pr been accepted will get project tokens in polygon chain (not much at this moment, also the pool in dex is still small).
Best regards,
[REMOVED]
Hello!
I can't compile app.
golang/src/github.com/saniales/golang-crypto-trading-bot/exchanges/binance.go:191:35: wrapper.api.NewBookTickerService undefined (type *binance.Client has no field or method NewBookTickerService)
golang/src/github.com/saniales/golang-crypto-trading-bot/exchanges/binance.go:209:37: wrapper.api.NewPriceChangeStatsService undefined (type *binance.Client has no field or method NewPriceChangeStatsService)
Can you fix it?
We should support market orders when possible
e.g. Bittrex does not support market orders, nor does binance
Currently the following exchanges support market orders
will there be Bithumb support in near future?
Reference GO SDK :
https://github.com/bitfinexcom/bitfinex-api-go
func (wrapper BittrexWrapper) FeedConnect(markets []*environment.Market) error {
return ErrWebsocketNotSupported
wrapper.websocketOn = true
...
}
the function returns immediately, so the rest of the code will never be executed.
func (wrapper BittrexWrapper) subscribeMarketSummaryFeed(market *environment.Market) {
...
panic("Not implemented")
go func(market *environment.Market, results <-chan api.ExchangeState) {
...
}(market, results)
}
The go routine will never be executed due panic call before.
the bot should be able to cancel orders
This wrapper fails on markets which are not in the format XXXYYY
As far as I know, there are no specific strategies in that 'example' folder, but I can still use one of them such as 'Watch5Sec'
How does it work?
This mode allows to calculate profits assuming trades are always made without investing
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.