MIT License

项目介绍

iamjinlei/go-tart 是一个托管在 GitHub 上的开源项目,主要使用 Go 编写,采用 MIT License 许可证,目前获得 81 个 Star、19 次 Fork。

仓库全名
iamjinlei/go-tart
开源许可证
MIT License
Star 数
81
Fork 数
19

README 摘要

go-tart (go-TA RealTime) Intro go-talib project provides a nice port of the C-implementation TA-Lib. However, its code is very verbose and hard to read due to the straight translation from the "C" code of TA-Lib. More often, streaming incremental updates to indicators is desirable. We don't want to recalculate the full result if the sliding window only moves forward a single value while history values are not…

完整内容见 GitHub 原始 README 或本页 。

常见问题

go-tart 用什么语言开发?

主要使用 Go 编写,采用 MIT License 许可证,目前有 81 个 Star。

go-tart 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 go-tart 的源码?

可以直接克隆仓库:git clone https://github.com/iamjinlei/go-tart.git,默认分支为 master;安装与运行步骤见仓库 README。

go-tart 最近还在维护吗?

仓库最近一次更新为 2021年6月23日,当前没有未关闭的 Issue;Star 数为 81,可作为社区活跃度的参考。

关于

Technical indicators with streaming update support

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
121
价值分
54
活跃状态
活跃

语言占比

Go

Release

贡献者

README

go-tart (go-TA RealTime)

Build Status Go Report Card License: MIT Go Reference

Intro

go-talib project provides a nice port of the C-implementation TA-Lib. However, its code is very verbose and hard to read due to the straight translation from the “C” code of TA-Lib. More often, streaming incremental updates to indicators is desirable. We don’t want to recalculate the full result if the sliding window only moves forward a single value while history values are not changed at all. Recalculation of the history for every new value is expensive. With those in mind, go-tart intends to support streaming updates of new values with a concise implementation. Most of the indicators from go-talib are realized except a few trivial ones and those involves Hilbert Transform. Results are verified using TA-Lib’s output. MACD’s “stability” issue from go-talib is fixed.

Performance

A benchmark is written to compare the performance for the set of indicators from both go-talib and go-talib. This is not a scientific evaluation but gives a sense of how they perform in case of a full recalculation. As shown below, go-tart is about 3X slower in full recalculation, which is due to function call to Update in each iteration. go-talib holds advantage because its code is inlined.

gotest -run ^$ -bench=.
BenchmarkTart-4             2019            496703 ns/op
BenchmarkTalib-4            7944            150311 ns/op

After the initial full calculation, go-tart should perform better as it only needs a single iteration cost to compute a new update.

Install

Install the package with:

go get github.com/iamjinlei/go-tart

Import it with:

import "github.com/iamjinlei/go-tart"

and use tart as the package name

Exmaple

package main

import (
	"fmt"

	"github.com/iamjinlei/go-tart"
)

func main() {
	sma := tart.NewSma(5)
	for i := 0; i < 20; i++ {
		fmt.Printf("sma[%v] = %.4f\n", i, sma.Update(float64(i%7)))
	}
}

评论

暂无评论