{"id":24171350,"url":"https://github.com/micahparks/go-chaikin","last_synced_at":"2025-09-20T17:31:31.100Z","repository":{"id":57636438,"uuid":"427987212","full_name":"MicahParks/go-chaikin","owner":"MicahParks","description":"The Chaikin Oscillator technical analysis algorithm implemented in Golang. ","archived":false,"fork":false,"pushed_at":"2025-01-02T14:49:21.000Z","size":18,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-02T15:34:18.469Z","etag":null,"topics":["chaikin","chaikin-algorithm","go","golang","technical-analysis"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MicahParks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-14T16:56:30.000Z","updated_at":"2025-01-02T14:49:25.000Z","dependencies_parsed_at":"2024-06-20T07:00:12.862Z","dependency_job_id":"8c18d699-145f-4f43-ad35-5ec0a09fbcdd","html_url":"https://github.com/MicahParks/go-chaikin","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicahParks%2Fgo-chaikin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicahParks%2Fgo-chaikin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicahParks%2Fgo-chaikin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicahParks%2Fgo-chaikin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MicahParks","download_url":"https://codeload.github.com/MicahParks/go-chaikin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233678687,"owners_count":18712981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chaikin","chaikin-algorithm","go","golang","technical-analysis"],"created_at":"2025-01-13T00:37:20.731Z","updated_at":"2025-09-20T17:31:25.839Z","avatar_url":"https://github.com/MicahParks.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/MicahParks/go-chaikin.svg)](https://pkg.go.dev/github.com/MicahParks/go-chaikin) [![Go Report Card](https://goreportcard.com/badge/github.com/MicahParks/go-chaikin)](https://goreportcard.com/report/github.com/MicahParks/go-chaikin)\n# go-chaikin\nThe Chaikin Oscillator technical analysis algorithm implemented in Golang.\n\n```go\nimport \"github.com/MicahParks/go-chaikin\"\n```\n\n# Usage\nFor full examples, please see the `examples` directory.\n\n## Step 1\nGather the initial input. This is 10 periods of inputs for the Accumulation Distribution Line. It is the minimum number\nof periods required to produce one result for the Chaikin Oscillator. The value, `10` is stored in `chaikin.LongEMA`\nconstant.\n\nThe input must be put into an array, not a slice. Make sure to fill all 10 indices of the array.\n```go\ninitial := [chaikin.LongEMA]ad.Input{}\nfor i := 0; i \u003c chaikin.LongEMA; i++ {\n\tinitial[i] = ad.Input{\n\t\tClose:  closePrices[i],\n\t\tLow:    low[i],\n\t\tHigh:   high[i],\n\t\tVolume: volume[i],\n\t}\n}\n```\n\n## Step 2\nCreate the Chaikin Oscillator data structure from the initial input array. This will also produce the first Chaikin\nOscillator point as well as its corresponding Accumulation Distribution Line point.\n```go\ncha, firstResult, adLine := chaikin.New(initial)\n```\n\n## Step 3\nUse the subsequent periods to calculate the next points for the Chaikin Oscillator and Accumulation Distribution Line.\n```go\nresult, adLine = cha.Calculate(ad.Input{\n\tClose:  closePrices[i],\n\tLow:    low[i],\n\tHigh:   high[i],\n\tVolume: volume[i],\n})\n```\n\n# Somewhat complete example (without data)\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/MicahParks/go-ad\"\n\n\t\"github.com/MicahParks/go-chaikin\"\n)\n\nfunc main() {\n\t// Create a logger.\n\tlogger := log.New(os.Stdout, \"\", 0)\n\n\t// Create the initial input.\n\tinitial := [chaikin.LongEMA]ad.Input{}\n\tfor i := 0; i \u003c chaikin.LongEMA; i++ {\n\t\tinitial[i] = ad.Input{\n\t\t\tClose:  closePrices[i],\n\t\t\tLow:    low[i],\n\t\t\tHigh:   high[i],\n\t\t\tVolume: volume[i],\n\t\t}\n\t}\n\n\t// Create the Chaikin Oscillator data structure as well as its first data point and the corresponding Accumulation\n\t// Distribution Line point.\n\tcha, result, adLine := chaikin.New(initial)\n\tlogger.Printf(\"%.4f, %.4f\", adLine, result)\n\n\t// Use every subsequent period's data to calculate the next points on the Chaikin Oscillator and Accumulation\n\t// Distribution Line.\n\tfor i := range open[chaikin.LongEMA:] {\n\t\ti += chaikin.LongEMA\n\n\t\tresult, adLine = cha.Calculate(ad.Input{\n\t\t\tClose:  closePrices[i],\n\t\t\tLow:    low[i],\n\t\t\tHigh:   high[i],\n\t\t\tVolume: volume[i],\n\t\t})\n\t\tlogger.Printf(\"%.4f, %.4f\", adLine, result)\n\t}\n}\n```\n\n# Testing\nThere is 100% test coverage and benchmarks for this project. Here is an example benchmark result:\n```\n$ go test -bench .\ngoos: linux\ngoarch: amd64\npkg: github.com/MicahParks/go-chaikin\ncpu: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz\nBenchmarkChaikin_Calculate-6            1000000000               0.0000017 ns/op\nBenchmarkBigChaikin_Calculate-6         1000000000               0.0000891 ns/op\nPASS\nok      github.com/MicahParks/go-chaikin        0.004s\n```\n\n# Other Technical Algorithms\nLooking for some other technical analysis algorithms? Here are some other ones I've implemented:\n* Accumulation/Distribution (A/D): [go-ad](https://github.com/MicahParks/go-ad)\n* Chaikin: [go-chaikin](https://github.com/MicahParks/go-chaikin)\n* Moving Average Convergence Divergence (MACD), Exponential Moving Average (EMA), Simple Moving Average (SMA):\n  [go-ma](https://github.com/MicahParks/go-ma)\n* Relative Strength Index (RSI): [go-rsi](https://github.com/MicahParks/go-rsi)\n\n# Resources\nI built and tested this package using these resources:\n* [Investopedia](https://www.investopedia.com/terms/c/chaikinoscillator.asp)\n* [Invest Excel](https://investexcel.net/chaikin-oscillator-spreadsheet-vba/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicahparks%2Fgo-chaikin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicahparks%2Fgo-chaikin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicahparks%2Fgo-chaikin/lists"}