{"id":20719192,"url":"https://github.com/tom-weatherhead/minimacd","last_synced_at":"2026-04-15T22:35:32.853Z","repository":{"id":42798732,"uuid":"271932838","full_name":"tom-weatherhead/minimacd","owner":"tom-weatherhead","description":"A versatile, compact (807-byte) implementation of Gerald Appel's MACD (Moving Average Convergence / Divergence) formula.","archived":false,"fork":false,"pushed_at":"2023-01-07T04:45:31.000Z","size":797,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-22T04:47:34.799Z","etag":null,"topics":["finance","fintech","fintech-utility","javascript","macd","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/tom-weatherhead.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}},"created_at":"2020-06-13T03:23:59.000Z","updated_at":"2021-12-02T07:09:31.000Z","dependencies_parsed_at":"2023-02-06T12:15:51.232Z","dependency_job_id":null,"html_url":"https://github.com/tom-weatherhead/minimacd","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/tom-weatherhead/minimacd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-weatherhead%2Fminimacd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-weatherhead%2Fminimacd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-weatherhead%2Fminimacd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-weatherhead%2Fminimacd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tom-weatherhead","download_url":"https://codeload.github.com/tom-weatherhead/minimacd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-weatherhead%2Fminimacd/sbom","scorecard":{"id":891829,"data":{"date":"2025-08-18","repo":{"name":"github.com/tom-weatherhead/minimacd","commit":"eccf9b10422b0e3e9444c385d6daf63b43ee557a"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":1.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/9 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"15 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T12:08:47.262Z","repository_id":42798732,"created_at":"2025-08-24T12:08:47.262Z","updated_at":"2025-08-24T12:08:47.262Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31863495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["finance","fintech","fintech-utility","javascript","macd","typescript"],"created_at":"2024-11-17T03:16:10.762Z","updated_at":"2026-04-15T22:35:32.837Z","avatar_url":"https://github.com/tom-weatherhead.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# minimacd\nA versatile, compact (807 bytes) Javascript implementation of Gerald Appel's MACD (Moving Average Convergence / Divergence) formula.\n\nObligatory BadgeFest:\n\n[![circleci][circleci-badge-image]][circleci-url]\n[![git][git-badge-image]][git-url]\n[![github][github-badge-image]][github-url]\n[![npm][npm-badge-image]][npm-url]\n[![terminal][terminal-badge-image]][terminal-url]\n[![typescript][typescript-badge-image]][typescript-url]\n\n[![build status][build-status-badge-image]][build-status-url]\n[![npm version][npm-version-badge-image]][npm-version-url]\n[![npm total downloads][npm-total-downloads-badge-image]][npm-total-downloads-url]\n[![watchers][watchers-badge-image]][watchers-url]\n[![stars][stars-badge-image]][stars-url]\n[![issues][issues-badge-image]][issues-url]\n[![forks][forks-badge-image]][forks-url]\n[![contributors][contributors-badge-image]][contributors-url]\n[![branches][branches-badge-image]][branches-url]\n[![releases][releases-badge-image]][releases-url]\n[![commits][commits-badge-image]][commits-url]\n[![last commit][last-commit-badge-image]][last-commit-url]\n[![types][types-badge-image]][types-url]\n[![install size][install-size-badge-image]][install-size-url]\n[![known vulnerabilities][known-vulnerabilities-badge-image]][known-vulnerabilities-url]\n[![tested with jest][jest-badge-image]][jest-url]\n[![code style: prettier][prettier-badge-image]][prettier-url]\n[![license][license-badge-image]][license-url]\n\n## Features\n\n- Self-contained: No run-time package dependencies!\n- Compact: Only 807 bytes!\n- Versatile: The Exponential Moving Average can be seeded in two ways\n\n## ema() : Exponential Moving Average\n\n```js\nfunction ema(\n\tarray: number[],\n\tperiod: number,\n\tusePeriodAsSeedLength: boolean\n): number[] { ... }\n```\n\nSee Gerald Appel's book 'Technical Analysis - Power Tools for Active Investors', chapter 6, pp. 134-137\n\n```js\nconst alpha = 2 / (period + 1); // The smoothing constant (Appel p. 134)\n```\n\nmeanValue is the initial value which stabilizes the exponential average.\nIt is the simple average of the first seedLength values in the array,\nafter skipping any initial run of invalid values (e.g. NaN)\nSee the section 'Stabilizing the Exponential Average' (Appel p. 136)\n\nDevelopers' note: Do not try to replace this:\n```js\nresult = alpha * element + (1 - alpha) * result;\n```\n... with either of these:\n```js\nresult += alpha * (element - result);\nresult = alpha * (element - result) + result;\n```\nThey are the same algebraically, but the latter two provide different results than the former due to limited floating-point precision.\n\n## macd() : Moving Average Convergence / Divergence\n\n```js\nfunction macd(\n\tarray: number[],\n\tfastPeriod = 12,\n\tslowPeriod = 26,\n\tsignalPeriod = 9,\n\tusePeriodAsSeedLength = false\n): number[][] { ... }\n```\nThis function returns a two-element tuple consisting of [macdArray, signalArray].\n\n- When usePeriodAsSeedLength is falsy, this algorithm behaves like the npm package [macd](https://github.com/kaelzhang/macd) written by Kael Zhang; i.e. the EMA will be seeded with the first value in the array.\n- When usePeriodAsSeedLength is truthy, this algorithm behaves like indicatorMacd in the npm package [@d3fc/d3fc-technical-indicator](https://github.com/d3fc/d3fc); i.e. the EMA will be seeded with the simple average (the mean) of the first n values in the array, where n is the EMA's period.\n\nIn general terms, macd is defined as this:\n\n```js\nfunction macd(array, fastPeriod, slowPeriod) {\n\treturn ema(array, fastPeriod) - ema(array, slowPeriod);\n}\n```\n\nA signal(n) value is the EMA (with period = n) of consecutive MACD values.\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n\n[circleci-badge-image]: https://badgen.net/badge/icon/circleci?icon=circleci\u0026label\n[circleci-url]: https://circleci.com\n[git-badge-image]: https://badgen.net/badge/icon/git?icon=git\u0026label\n[git-url]: https://git-scm.com\n[github-badge-image]: https://badgen.net/badge/icon/github?icon=github\u0026label\n[github-url]: https://github.com\n[npm-badge-image]: https://badgen.net/badge/icon/npm?icon=npm\u0026label\n[npm-url]: https://npmjs.com\n[terminal-badge-image]: https://badgen.net/badge/icon/terminal?icon=terminal\u0026label\n[terminal-url]: https://en.wikipedia.org/wiki/History_of_Unix\n[typescript-badge-image]: https://badgen.net/badge/icon/typescript?icon=typescript\u0026label\n[typescript-url]: https://www.typescriptlang.org\n\n[build-status-badge-image]: https://circleci.com/gh/tom-weatherhead/minimacd.svg?style=shield\n[build-status-url]: https://circleci.com/gh/tom-weatherhead/minimacd\n[npm-version-badge-image]: https://img.shields.io/npm/v/minimacd.svg\n[npm-version-url]: https://www.npmjs.com/package/minimacd\n[latest-tag-badge-image]: https://badgen.net/github/tag/tom-weatherhead/minimacd\n[latest-tag-url]: https://github.com/tom-weatherhead/minimacd/tags\n[npm-total-downloads-badge-image]: https://img.shields.io/npm/dt/minimacd.svg\n[npm-total-downloads-url]: https://www.npmjs.com/package/minimacd\n[watchers-badge-image]: https://badgen.net/github/watchers/tom-weatherhead/minimacd\n[watchers-url]: https://github.com/tom-weatherhead/minimacd/watchers\n[stars-badge-image]: https://badgen.net/github/stars/tom-weatherhead/minimacd\n[stars-url]: https://github.com/tom-weatherhead/minimacd/stargazers\n[issues-badge-image]: https://badgen.net/github/issues/tom-weatherhead/minimacd\n[issues-url]: https://github.com/tom-weatherhead/minimacd/issues\n[forks-badge-image]: https://badgen.net/github/forks/tom-weatherhead/minimacd\n[forks-url]: https://github.com/tom-weatherhead/minimacd/network/members\n[contributors-badge-image]: https://badgen.net/github/contributors/tom-weatherhead/minimacd\n[contributors-url]: https://github.com/tom-weatherhead/minimacd/graphs/contributors\n[branches-badge-image]: https://badgen.net/github/branches/tom-weatherhead/minimacd\n[branches-url]: https://github.com/tom-weatherhead/minimacd/branches\n[releases-badge-image]: https://badgen.net/github/releases/tom-weatherhead/minimacd\n[releases-url]: https://github.com/tom-weatherhead/minimacd/releases\n[commits-badge-image]: https://badgen.net/github/commits/tom-weatherhead/minimacd\n[commits-url]: https://github.com/tom-weatherhead/minimacd/commits/master\n[last-commit-badge-image]: https://badgen.net/github/last-commit/tom-weatherhead/minimacd\n[last-commit-url]: https://github.com/tom-weatherhead/minimacd\n[types-badge-image]: https://badgen.net/npm/types/minimacd\n[types-url]: https://badgen.net/npm/types/minimacd\n[install-size-badge-image]: https://badgen.net/packagephobia/install/minimacd\n[install-size-url]: https://badgen.net/packagephobia/install/minimacd\n[known-vulnerabilities-badge-image]: https://snyk.io/test/github/tom-weatherhead/minimacd/badge.svg?targetFile=package.json\u0026package-lock.json\n[known-vulnerabilities-url]: https://snyk.io/test/github/tom-weatherhead/minimacd?targetFile=package.json\u0026package-lock.json\n[jest-badge-image]: https://img.shields.io/badge/tested_with-jest-99424f.svg\n[jest-url]: https://github.com/facebook/jest\n[prettier-badge-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square\n[prettier-url]: https://github.com/prettier/prettier\n[license-badge-image]: https://img.shields.io/github/license/mashape/apistatus.svg\n[license-url]: https://github.com/tom-weatherhead/minimacd/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-weatherhead%2Fminimacd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftom-weatherhead%2Fminimacd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-weatherhead%2Fminimacd/lists"}