From 93cfb1efeed39cebe96b25c1c49651897702d607 Mon Sep 17 00:00:00 2001 From: Evgeny Samsonov Date: Tue, 16 Aug 2022 13:14:56 +0300 Subject: [PATCH] Improve readme --- README.md | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 8901c3c..0dcd678 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/evsamsonov/trading-timeseries)](https://goreportcard.com/report/github.com/evsamsonov/trading-timeseries) [![codecov](https://codecov.io/gh/evsamsonov/trading-timeseries/branch/master/graph/badge.svg?token=6HV8Z6ZAE0)](https://codecov.io/gh/evsamsonov/trading-timeseries) -Timeseries provides structure for series of trading candles. +Timeseries provides structures for trading candles series and tick series. ## Installation @@ -14,40 +14,5 @@ $ go get github.com/evsamsonov/trading-timeseries ``` ## Usage +[See documentation and examples](https://pkg.go.dev/github.com/evsamsonov/trading-timeseries) - -```go -dataset := []struct { - Time time.Time - High float64 - Low float64 - Open float64 - Close float64 - Volume int64 -}{ - {Time: time.Unix(1, 0), High: 1, Low: 2, Open: 3, Close: 4, Volume: 5}, - {Time: time.Unix(2, 0), High: 6, Low: 7, Open: 8, Close: 9, Volume: 10}, -} - -series := timeseries.New() -for _, item := range dataset { - candle := timeseries.NewCandle(item.Time) - candle.Open = item.Open - candle.Close = item.Close - candle.High = item.High - candle.Low = item.Low - candle.Volume = item.Volume - - err := series.AddCandle(candle) - if err != nil { - log.Printf("Failed to add candle: %v\n", err) - } -} - -fmt.Println(series.Candle(0)) // &{1970-01-01 03:00:01 +0300 MSK 1 2 3 4 5} -fmt.Println(series.LastCandle()) // &{1970-01-01 03:00:02 +0300 MSK 6 7 8 9 10} -fmt.Println(series.Length()) // 2 -``` - -TODO -tickseries