Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

Commit

Permalink
new version 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
miaolz123 committed Dec 13, 2016
1 parent 4cf5002 commit 8a5d9c2
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ _testmain.go
*.prof

# Personal
*.zip
*.tar.gz
.vscode
custom.ini
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: go
go:
- 1.6
- tip
- tip

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN gpg \
--keyserver hkp://ha.pool.sks-keyservers.net \
--recv-keys 05CE15085FC09D18E99EFB22684A14CF2582E0C5

ENV STOCKDB_VERSION 0.1.1
ENV STOCKDB_VERSION 0.1.2
ENV INFLUXDB_VERSION 1.1.1
RUN wget -q https://dl.influxdata.com/influxdb/releases/influxdb_${INFLUXDB_VERSION}_amd64.deb.asc && \
wget -q https://dl.influxdata.com/influxdb/releases/influxdb_${INFLUXDB_VERSION}_amd64.deb && \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## StockDB

[![GitHub tag](https://img.shields.io/github/tag/miaolz123/stockdb.svg)](https://github.com/miaolz123/stockdb/releases)
[![GitHub release](https://img.shields.io/github/release/miaolz123/stockdb.svg)](https://github.com/miaolz123/stockdb/releases)
[![Travis](https://img.shields.io/travis/miaolz123/stockdb.svg)](https://travis-ci.org/miaolz123/stockdb)
[![Go Report Card](https://goreportcard.com/badge/github.com/miaolz123/stockdb)](https://goreportcard.com/report/github.com/miaolz123/stockdb)
[![Github All Releases](https://img.shields.io/github/downloads/miaolz123/stockdb/total.svg)](https://github.com/miaolz123/stockdb/releases)
Expand Down
5 changes: 4 additions & 1 deletion influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func (driver *influxdb) getDepthQuery(opt stockdb.Option) (q client.Query) {
if opt.BeginTime <= 0 || opt.BeginTime > ranges[1] {
opt.BeginTime = ranges[1]
}
raw := fmt.Sprintf(`SELECT price, amount FROM "symbol_%v" WHERE time >= %vs AND
raw := fmt.Sprintf(`SELECT price, amount, type FROM "symbol_%v" WHERE time >= %vs AND
time <= %vs LIMIT 300`, opt.Symbol, opt.BeginTime, opt.BeginTime+opt.Period)
q = client.NewQuery(raw, "market_"+opt.Market, "s")
return q
Expand All @@ -423,6 +423,9 @@ func (driver *influxdb) result2depth(result client.Result, opt stockdb.Option) (
volume float64
}{}
for i := range serie.Values {
if _type := fmt.Sprint(serie.Values[i][2]); _type == "high" || _type == "low" {
continue
}
price := conver.Float64Must(serie.Values[i][1])
if d.open == 0.0 {
d.open = price
Expand Down
2 changes: 1 addition & 1 deletion init.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

const (
version = "0.1.1"
version = "0.1.2"
minPeriod int64 = 3
)

Expand Down
17 changes: 17 additions & 0 deletions stockdb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Golang client library for StockDB

# Example

[example](https://github.com/miaolz123/stockdb/tree/master/example/golang)

# Instllation

```shell
$ go get github.com/miaolz123/stockdb/stockdb
```

# Reference

[Official Repos](https://github.com/miaolz123/stockdb)

[Document](http://docs.stockdb.org/)

0 comments on commit 8a5d9c2

Please sign in to comment.