mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
* codebase: Remove web frontend and related services * refactor: Update StartPPROF to accept context and adjust related tests * refactor: Simplify SetIfZero functions and update related tests * config: Clarify DowngradeConfig method documentation regarding permanent removal of deprecated fields * refactor: Rename setIfZeroAndWarn to setDefaultIfZeroWarn for clarity and update related calls * refactor: Update error handling in DataHistoryManager and remove redundant error variable
92 lines
3.5 KiB
Markdown
92 lines
3.5 KiB
Markdown
# GoCryptoTrader OHLCV support
|
|
|
|
<img src="/docs/assets/page-logo.png" width="350px" height="350px" hspace="70">
|
|
|
|
[](https://github.com/thrasher-corp/gocryptotrader/actions/workflows/tests.yml)
|
|
[](https://github.com/thrasher-corp/gocryptotrader/blob/master/LICENSE)
|
|
[](https://godoc.org/github.com/thrasher-corp/gocryptotrader/exchanges)
|
|
[](https://codecov.io/gh/thrasher-corp/gocryptotrader)
|
|
[](https://goreportcard.com/report/github.com/thrasher-corp/gocryptotrader)
|
|
|
|
This exchanges package is part of the GoCryptoTrader codebase.
|
|
|
|
## This is still in active development
|
|
|
|
You can track ideas, planned features and what's in progress on our [GoCryptoTrader Kanban board](https://github.com/orgs/thrasher-corp/projects/3).
|
|
|
|
Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader Slack](https://join.slack.com/t/gocryptotrader/shared_invite/zt-38z8abs3l-gH8AAOk8XND6DP5NfCiG_g)
|
|
|
|
## Wrapper Methods
|
|
|
|
Candle retrieval is handled by two methods
|
|
|
|
|
|
GetHistoricCandles which makes a single request to the exchange and follows all exchange limitations
|
|
```go
|
|
func (b *base) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error) {
|
|
return nil, common.ErrFunctionNotSupported
|
|
}
|
|
```
|
|
|
|
GetHistoricCandlesExtended that will make multiple requests to an exchange if the requested periods are outside exchange limits
|
|
```go
|
|
func (b *base) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error) {
|
|
return nil, common.ErrFunctionNotSupported
|
|
}
|
|
```
|
|
|
|
both methods return kline.Item{}
|
|
|
|
```go
|
|
// Item holds all the relevant information for internal kline elements
|
|
type Item struct {
|
|
Exchange string
|
|
Pair currency.Pair
|
|
Asset asset.Item
|
|
Interval Interval
|
|
Candles []Candle
|
|
}
|
|
|
|
// Candle holds historic rate information.
|
|
type Candle struct {
|
|
Time time.Time
|
|
Open float64
|
|
High float64
|
|
Low float64
|
|
Close float64
|
|
Volume float64
|
|
}
|
|
```
|
|
|
|
### DBSeed helper
|
|
|
|
A helper tool [cmd/dbseed](../cmd/dbseed/README.md) has been created for assisting with candle data migration
|
|
|
|
## Exchange status
|
|
| Exchange | Supported |
|
|
|----------------|-------------|
|
|
| Binance.US | Y |
|
|
| Binance | Y |
|
|
| Bitfinex | Y |
|
|
| Bitflyer | |
|
|
| Bithumb | Y |
|
|
| Bitmex | |
|
|
| Bitstamp | Y |
|
|
| BTC Markets | Y |
|
|
| BTSE | Y |
|
|
| Bybit | Y |
|
|
| Coinbase Pro | Y |
|
|
| Coinut | |
|
|
| Deribit | Y |
|
|
| Exmo | |
|
|
| GateIO | Y |
|
|
| Gemini | |
|
|
| HitBTC | Y |
|
|
| Huobi | Y |
|
|
| Kraken | Y |
|
|
| Kucoin | Y |
|
|
| lBank | Y |
|
|
| Okx | Y |
|
|
| Poloniex | Y |
|
|
| Yobit | |
|