sqa-tai 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3df8b9f48bc99341d38af4690c0a82a3a6f648890bfeaf8d45e92aec5d591e25
4
+ data.tar.gz: 60e3356d7f7911700dd05efb166817caf9a42ceb718b261088bc3659cc3e5b87
5
+ SHA512:
6
+ metadata.gz: 13e78aa5c9e871041502c71860f827896de687363a06797fb43d2a9522fb9664e1ecd8efd0fd2aecbedad6c23a58af4f6e648182b7509deea90377ff497b7ace
7
+ data.tar.gz: 4045b21ddbbe25fe6d73aa52c3b9a695ce6f5fcbdc520057aef403f3474091b4f6feb1d200e0bdd510d8cfed6c2aeede44591de5888a8072ce223119dec2f517
data/.envrc ADDED
@@ -0,0 +1 @@
1
+ export RR=`pwd`
data/CHANGELOG.md ADDED
@@ -0,0 +1,34 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2025-11-06
11
+
12
+ ### Added
13
+ - Initial release of sqa-tai
14
+ - Ruby wrapper around ta_lib_ffi
15
+ - 200+ technical analysis indicators from TA-Lib
16
+ - Overlap studies: SMA, EMA, WMA, BBANDS
17
+ - Momentum indicators: RSI, MACD, STOCH, MOM
18
+ - Volatility indicators: ATR, TRANGE
19
+ - Volume indicators: OBV, AD
20
+ - Pattern recognition: Doji, Hammer, Engulfing
21
+ - Clean Ruby API with keyword arguments
22
+ - Comprehensive error handling
23
+ - Parameter validation
24
+ - Full test coverage
25
+ - Complete documentation site
26
+
27
+ ### Notes
28
+ - Extracted from original [sqa](https://github.com/MadBomber/sqa) gem
29
+ - Part of SQA ecosystem refactoring
30
+ - Requires TA-Lib C library >= 0.4.0
31
+ - Requires Ruby >= 3.1.0
32
+
33
+ [Unreleased]: https://github.com/MadBomber/sqa-tai/compare/v0.1.0...HEAD
34
+ [0.1.0]: https://github.com/MadBomber/sqa-tai/releases/tag/v0.1.0
data/COMMITS.md ADDED
@@ -0,0 +1,196 @@
1
+ ---
2
+ url: https://www.conventionalcommits.org/en/v1.0.0/
3
+ title: Conventional Commits
4
+ description: A specification for adding human and machine readable meaning to commit messages
5
+ access_date: 2025-07-31T20:51:29.000Z
6
+ current_date: 2025-07-31T20:51:29.601Z
7
+ ---
8
+
9
+ # Conventional Commits
10
+
11
+ A specification for adding human and machine readable meaning to commit messages
12
+
13
+ Quick Summary Full Specification Contribute
14
+
15
+ # Conventional Commits 1.0.0
16
+
17
+ ## Summary
18
+
19
+ The Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with SemVer, by describing the features, fixes, and breaking changes made in commit messages.
20
+
21
+ The commit message should be structured as follows:
22
+
23
+ ---
24
+
25
+ ```
26
+ <type>[optional scope]: <description>
27
+
28
+ [optional body]
29
+
30
+ [optional footer(s)]
31
+
32
+ ```
33
+
34
+ ---
35
+
36
+ The commit contains the following structural elements, to communicate intent to the consumers of your library:
37
+
38
+ 1. **fix:** a commit of the _type_ `fix` patches a bug in your codebase (this correlates with `PATCH` in Semantic Versioning).
39
+ 2. **feat:** a commit of the _type_ `feat` introduces a new feature to the codebase (this correlates with `MINOR` in Semantic Versioning).
40
+ 3. **BREAKING CHANGE:** a commit that has a footer `BREAKING CHANGE:`, or appends a `!` after the type/scope, introduces a breaking API change (correlating with `MAJOR` in Semantic Versioning). A BREAKING CHANGE can be part of commits of any _type_.
41
+ 4. _types_ other than `fix:` and `feat:` are allowed, for example @commitlint/config-conventional (based on the Angular convention) recommends `build:`, `chore:`,`ci:`, `docs:`, `style:`, `refactor:`, `perf:`, `test:`, and others.
42
+ 5. _footers_ other than `BREAKING CHANGE: <description>` may be provided and follow a convention similar to git trailer format.
43
+
44
+ Additional types are not mandated by the Conventional Commits specification, and have no implicit effect in Semantic Versioning (unless they include a BREAKING CHANGE). A scope may be provided to a commit’s type, to provide additional contextual information and is contained within parenthesis, e.g., `feat(parser): add ability to parse arrays`.
45
+
46
+ ## Examples
47
+
48
+ ### Commit message with description and breaking change footer
49
+
50
+ ```
51
+ feat: allow provided config object to extend other configs
52
+
53
+ BREAKING CHANGE: `extends` key in config file is now used for extending other config files
54
+
55
+ ```
56
+
57
+ ### Commit message with `!` to draw attention to breaking change
58
+
59
+ ```
60
+ feat!: send an email to the customer when a product is shipped
61
+
62
+ ```
63
+
64
+ ### Commit message with scope and `!` to draw attention to breaking change
65
+
66
+ ```
67
+ feat(api)!: send an email to the customer when a product is shipped
68
+
69
+ ```
70
+
71
+ ### Commit message with both `!` and BREAKING CHANGE footer
72
+
73
+ ```
74
+ chore!: drop support for Node 6
75
+
76
+ BREAKING CHANGE: use JavaScript features not available in Node 6.
77
+
78
+ ```
79
+
80
+ ### Commit message with no body
81
+
82
+ ```
83
+ docs: correct spelling of CHANGELOG
84
+
85
+ ```
86
+
87
+ ### Commit message with scope
88
+
89
+ ```
90
+ feat(lang): add Polish language
91
+
92
+ ```
93
+
94
+ ### Commit message with multi-paragraph body and multiple footers
95
+
96
+ ```
97
+ fix: prevent racing of requests
98
+
99
+ Introduce a request id and a reference to latest request. Dismiss
100
+ incoming responses other than from latest request.
101
+
102
+ Remove timeouts which were used to mitigate the racing issue but are
103
+ obsolete now.
104
+
105
+ Reviewed-by: Z
106
+ Refs: #123
107
+
108
+ ```
109
+
110
+ ## Specification
111
+
112
+ The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
113
+
114
+ 1. Commits MUST be prefixed with a type, which consists of a noun, `feat`, `fix`, etc., followed by the OPTIONAL scope, OPTIONAL `!`, and REQUIRED terminal colon and space.
115
+ 2. The type `feat` MUST be used when a commit adds a new feature to your application or library.
116
+ 3. The type `fix` MUST be used when a commit represents a bug fix for your application.
117
+ 4. A scope MAY be provided after a type. A scope MUST consist of a noun describing a section of the codebase surrounded by parenthesis, e.g., `fix(parser):`
118
+ 5. A description MUST immediately follow the colon and space after the type/scope prefix. The description is a short summary of the code changes, e.g., _fix: array parsing issue when multiple spaces were contained in string_.
119
+ 6. A longer commit body MAY be provided after the short description, providing additional contextual information about the code changes. The body MUST begin one blank line after the description.
120
+ 7. A commit body is free-form and MAY consist of any number of newline separated paragraphs.
121
+ 8. One or more footers MAY be provided one blank line after the body. Each footer MUST consist of a word token, followed by either a `:<space>` or `<space>#` separator, followed by a string value (this is inspired by the git trailer convention).
122
+ 9. A footer’s token MUST use `-` in place of whitespace characters, e.g., `Acked-by` (this helps differentiate the footer section from a multi-paragraph body). An exception is made for `BREAKING CHANGE`, which MAY also be used as a token.
123
+ 10. A footer’s value MAY contain spaces and newlines, and parsing MUST terminate when the next valid footer token/separator pair is observed.
124
+ 11. Breaking changes MUST be indicated in the type/scope prefix of a commit, or as an entry in the footer.
125
+ 12. If included as a footer, a breaking change MUST consist of the uppercase text BREAKING CHANGE, followed by a colon, space, and description, e.g.,_BREAKING CHANGE: environment variables now take precedence over config files_.
126
+ 13. If included in the type/scope prefix, breaking changes MUST be indicated by a`!` immediately before the `:`. If `!` is used, `BREAKING CHANGE:` MAY be omitted from the footer section, and the commit description SHALL be used to describe the breaking change.
127
+ 14. Types other than `feat` and `fix` MAY be used in your commit messages, e.g., _docs: update ref docs._
128
+ 15. The units of information that make up Conventional Commits MUST NOT be treated as case sensitive by implementors, with the exception of BREAKING CHANGE which MUST be uppercase.
129
+ 16. BREAKING-CHANGE MUST be synonymous with BREAKING CHANGE, when used as a token in a footer.
130
+
131
+ ## Why Use Conventional Commits
132
+
133
+ * Automatically generating CHANGELOGs.
134
+ * Automatically determining a semantic version bump (based on the types of commits landed).
135
+ * Communicating the nature of changes to teammates, the public, and other stakeholders.
136
+ * Triggering build and publish processes.
137
+ * Making it easier for people to contribute to your projects, by allowing them to explore a more structured commit history.
138
+
139
+ ## FAQ
140
+
141
+ ### How should I deal with commit messages in the initial development phase?
142
+
143
+ We recommend that you proceed as if you’ve already released the product. Typically _somebody_, even if it’s your fellow software developers, is using your software. They’ll want to know what’s fixed, what breaks etc.
144
+
145
+ ### Are the types in the commit title uppercase or lowercase?
146
+
147
+ Any casing may be used, but it’s best to be consistent.
148
+
149
+ ### What do I do if the commit conforms to more than one of the commit types?
150
+
151
+ Go back and make multiple commits whenever possible. Part of the benefit of Conventional Commits is its ability to drive us to make more organized commits and PRs.
152
+
153
+ ### Doesn’t this discourage rapid development and fast iteration?
154
+
155
+ It discourages moving fast in a disorganized way. It helps you be able to move fast long term across multiple projects with varied contributors.
156
+
157
+ ### Might Conventional Commits lead developers to limit the type of commits they make because they’ll be thinking in the types provided?
158
+
159
+ Conventional Commits encourages us to make more of certain types of commits such as fixes. Other than that, the flexibility of Conventional Commits allows your team to come up with their own types and change those types over time.
160
+
161
+ ### How does this relate to SemVer?
162
+
163
+ `fix` type commits should be translated to `PATCH` releases. `feat` type commits should be translated to `MINOR` releases. Commits with `BREAKING CHANGE` in the commits, regardless of type, should be translated to `MAJOR` releases.
164
+
165
+ ### How should I version my extensions to the Conventional Commits Specification, e.g. `@jameswomack/conventional-commit-spec`?
166
+
167
+ We recommend using SemVer to release your own extensions to this specification (and encourage you to make these extensions!)
168
+
169
+ ### What do I do if I accidentally use the wrong commit type?
170
+
171
+ #### When you used a type that’s of the spec but not the correct type, e.g. `fix` instead of `feat`
172
+
173
+ Prior to merging or releasing the mistake, we recommend using `git rebase -i` to edit the commit history. After release, the cleanup will be different according to what tools and processes you use.
174
+
175
+ #### When you used a type _not_ of the spec, e.g. `feet` instead of `feat`
176
+
177
+ In a worst case scenario, it’s not the end of the world if a commit lands that does not meet the Conventional Commits specification. It simply means that commit will be missed by tools that are based on the spec.
178
+
179
+ ### Do all my contributors need to use the Conventional Commits specification?
180
+
181
+ No! If you use a squash based workflow on Git lead maintainers can clean up the commit messages as they’re merged—adding no workload to casual committers. A common workflow for this is to have your git system automatically squash commits from a pull request and present a form for the lead maintainer to enter the proper git commit message for the merge.
182
+
183
+ ### How does Conventional Commits handle revert commits?
184
+
185
+ Reverting code can be complicated: are you reverting multiple commits? if you revert a feature, should the next release instead be a patch?
186
+
187
+ Conventional Commits does not make an explicit effort to define revert behavior. Instead we leave it to tooling authors to use the flexibility of _types_ and _footers_ to develop their logic for handling reverts.
188
+
189
+ One recommendation is to use the `revert` type, and a footer that references the commit SHAs that are being reverted:
190
+
191
+ ```
192
+ revert: let us never again speak of the noodle incident
193
+
194
+ Refs: 676104e, a215868
195
+
196
+ ```
data/Gemfile ADDED
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
6
+
7
+ group :development, :test do
8
+ gem "rake", "~> 13.0"
9
+ gem "minitest", "~> 5.0"
10
+ gem "minitest-reporters"
11
+ gem "simplecov", require: false
12
+ gem "debug"
13
+ end
14
+
15
+ group :documentation do
16
+ # MkDocs is Python-based, managed separately
17
+ # See docs/README.md for setup instructions
18
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,71 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sqa-tai (0.1.0)
5
+ ta_lib_ffi (~> 0.3)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ansi (1.5.0)
11
+ builder (3.3.0)
12
+ date (3.5.0)
13
+ debug (1.11.0)
14
+ irb (~> 1.10)
15
+ reline (>= 0.3.8)
16
+ debug_me (1.1.1)
17
+ docile (1.4.1)
18
+ erb (5.1.3)
19
+ fiddle (1.1.8)
20
+ io-console (0.8.1)
21
+ irb (1.15.3)
22
+ pp (>= 0.6.0)
23
+ rdoc (>= 4.0.0)
24
+ reline (>= 0.4.2)
25
+ minitest (5.26.0)
26
+ minitest-reporters (1.7.1)
27
+ ansi
28
+ builder
29
+ minitest (>= 5.0)
30
+ ruby-progressbar
31
+ pp (0.6.3)
32
+ prettyprint
33
+ prettyprint (0.2.0)
34
+ psych (5.2.6)
35
+ date
36
+ stringio
37
+ rake (13.3.1)
38
+ rdoc (6.15.1)
39
+ erb
40
+ psych (>= 4.0.0)
41
+ tsort
42
+ reline (0.6.2)
43
+ io-console (~> 0.5)
44
+ ruby-progressbar (1.13.0)
45
+ simplecov (0.22.0)
46
+ docile (~> 1.1)
47
+ simplecov-html (~> 0.11)
48
+ simplecov_json_formatter (~> 0.1)
49
+ simplecov-html (0.13.2)
50
+ simplecov_json_formatter (0.1.4)
51
+ stringio (3.1.7)
52
+ ta_lib_ffi (0.3.0)
53
+ fiddle (~> 1.1)
54
+ tsort (0.2.0)
55
+
56
+ PLATFORMS
57
+ arm64-darwin-25
58
+ ruby
59
+
60
+ DEPENDENCIES
61
+ bundler
62
+ debug
63
+ debug_me
64
+ minitest (~> 5.0)
65
+ minitest-reporters
66
+ rake (~> 13.0, >= 0)
67
+ simplecov
68
+ sqa-tai!
69
+
70
+ BUNDLED WITH
71
+ 2.7.2
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Dewayne VanHoozer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,290 @@
1
+ <div align="center">
2
+ <h1>SQA::TAI - Technical Analysis Indicators</h1>
3
+
4
+ <p>Ruby wrapper around [TA-Lib](https://ta-lib.org/) providing **136 technical analysis indicators** for stock market analysis.<br/>
5
+ Part of the [SQA](https://github.com/MadBomber/sqa) (Simple Qualitative Analysis) ecosystem.</p>
6
+ </div>
7
+
8
+ <table>
9
+ <tr>
10
+ <td width="30%" valign="top" align="center">
11
+ <img src="docs/assets/images/sqa-tai.jpg" alt="Ruby Turns Information into Knowledge" width="60%">
12
+ <br/>
13
+ </td>
14
+ <td width="70%" valign="top">
15
+
16
+ ## Features
17
+
18
+ - 🚀 **136 Indicators** - Comprehensive coverage with 94% of trading-relevant TA-Lib indicators
19
+ - ⚡ **Blazing Fast** - C library performance with Ruby convenience
20
+ - 🎯 **Clean API** - Simple, intuitive Ruby interface with keyword arguments
21
+ - 📊 **Comprehensive** - Overlap studies, momentum, volatility, volume, cycles, stats, patterns
22
+ - 🔌 **Easy Integration** - Works seamlessly with existing Ruby trading tools
23
+ - ✅ **Well Tested** - 73 tests, 332 assertions, 100% passing
24
+ - 📚 **Documented** - Full documentation at [madbomber.github.io/sqa-tai](https://madbomber.github.io/sqa-tai)
25
+ - 🔧 **Bug Fixed** - Includes monkey patch for ta_lib_ffi 0.3.0 multi-array parameter bug
26
+
27
+ </td>
28
+ </tr>
29
+ </table>
30
+
31
+ ## Prerequisites
32
+
33
+ **TA-Lib C library must be installed** before using this gem.
34
+
35
+ ### macOS
36
+ ```bash
37
+ brew install ta-lib
38
+ ```
39
+
40
+ ### Ubuntu/Debian
41
+ ```bash
42
+ wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
43
+ tar -xzf ta-lib-0.4.0-src.tar.gz
44
+ cd ta-lib/
45
+ ./configure --prefix=/usr
46
+ make
47
+ sudo make install
48
+ ```
49
+
50
+ ### Windows
51
+ Download and install from [ta-lib.org](https://ta-lib.org/hdr_dw.html)
52
+
53
+ ## Installation
54
+
55
+ Add to your Gemfile:
56
+ ```ruby
57
+ gem 'sqa-tai'
58
+ ```
59
+
60
+ Or install directly:
61
+ ```bash
62
+ gem install sqa-tai
63
+ ```
64
+
65
+ ## Quick Start
66
+
67
+ ```ruby
68
+ require 'sqa/tai'
69
+
70
+ prices = [44.34, 44.09, 44.15, 43.61, 44.33, 44.83, 45.10, 45.42, 45.84, 46.08]
71
+
72
+ # Moving Averages
73
+ sma = SQA::TAI.sma(prices, period: 5)
74
+ ema = SQA::TAI.ema(prices, period: 5)
75
+
76
+ # Momentum Indicators
77
+ rsi = SQA::TAI.rsi(prices, period: 14)
78
+ macd, signal, histogram = SQA::TAI.macd(prices)
79
+
80
+ # Volatility
81
+ upper, middle, lower = SQA::TAI.bbands(prices, period: 20)
82
+
83
+ # Check if TA-Lib is available
84
+ if SQA::TAI.available?
85
+ puts "TA-Lib is ready!"
86
+ end
87
+ ```
88
+
89
+ ## Available Indicators (136 Total)
90
+
91
+ ### Overlap Studies (15)
92
+ - **SMA, EMA, WMA** - Moving Averages
93
+ - **DEMA, TEMA, TRIMA** - Advanced Moving Averages
94
+ - **KAMA, T3, MAMA** - Adaptive Moving Averages
95
+ - **BBANDS** - Bollinger Bands
96
+ - **SAREXT, HT_TRENDLINE** - Trend indicators
97
+ - **MIDPOINT, MIDPRICE, MAVP** - Price calculations
98
+
99
+ ### Momentum Indicators (30)
100
+ - **RSI** - Relative Strength Index
101
+ - **MACD, MACDEXT, MACDFIX** - MACD variants
102
+ - **STOCH, STOCHF, STOCHRSI** - Stochastic variants
103
+ - **MOM** - Momentum
104
+ - **CCI** - Commodity Channel Index
105
+ - **WILLR** - Williams' %R
106
+ - **ROC, ROCP, ROCR, ROCR100** - Rate of Change variants
107
+ - **PPO, APO** - Price Oscillators
108
+ - **ADX, ADXR, DX** - Directional Movement
109
+ - **AROON, AROONOSC** - Aroon indicators
110
+ - **BOP** - Balance of Power
111
+ - **CMO** - Chande Momentum Oscillator
112
+ - **MFI** - Money Flow Index
113
+ - **PLUS_DI, MINUS_DI, PLUS_DM, MINUS_DM** - Directional indicators
114
+ - **TRIX** - Triple Smooth EMA
115
+ - **ULTOSC** - Ultimate Oscillator
116
+
117
+ ### Volatility Indicators (4)
118
+ - **ATR** - Average True Range
119
+ - **NATR** - Normalized Average True Range
120
+ - **TRANGE** - True Range
121
+ - **SAR** - Parabolic SAR
122
+
123
+ ### Volume Indicators (3)
124
+ - **OBV** - On Balance Volume
125
+ - **AD** - Chaikin A/D Line
126
+ - **ADOSC** - Chaikin A/D Oscillator
127
+
128
+ ### Price Transform (4)
129
+ - **AVGPRICE** - Average Price
130
+ - **MEDPRICE** - Median Price
131
+ - **TYPPRICE** - Typical Price
132
+ - **WCLPRICE** - Weighted Close Price
133
+
134
+ ### Cycle Indicators (5)
135
+ - **HT_DCPERIOD** - Hilbert Transform - Dominant Cycle Period
136
+ - **HT_TRENDMODE** - Hilbert Transform - Trend vs Cycle Mode
137
+ - **HT_DCPHASE** - Hilbert Transform - Dominant Cycle Phase
138
+ - **HT_PHASOR** - Hilbert Transform - Phasor Components
139
+ - **HT_SINE** - Hilbert Transform - SineWave
140
+
141
+ ### Statistical Functions (9)
142
+ - **CORREL** - Pearson's Correlation Coefficient
143
+ - **BETA** - Beta Coefficient
144
+ - **VAR** - Variance
145
+ - **STDDEV** - Standard Deviation
146
+ - **LINEARREG** - Linear Regression
147
+ - **LINEARREG_ANGLE, LINEARREG_INTERCEPT, LINEARREG_SLOPE** - Linear Regression components
148
+ - **TSF** - Time Series Forecast
149
+
150
+ ### Pattern Recognition (61)
151
+ - **Basic Patterns**: Doji, Hammer, Engulfing, Hanging Man, Shooting Star
152
+ - **Star Patterns**: Morning Star, Evening Star, Morning Doji Star, Evening Doji Star
153
+ - **Reversal Patterns**: Harami, Piercing, Dark Cloud Cover, Inverted Hammer
154
+ - **Continuation Patterns**: Three White Soldiers, Three Black Crows, Rising/Falling Three Methods
155
+ - **Complex Patterns**: Abandoned Baby, Kicking, Unique 3 River, Tristar
156
+ - And 40+ more candlestick patterns...
157
+
158
+ See [full indicator list](https://madbomber.github.io/sqa-tai/indicators/) in documentation.
159
+
160
+ ## Usage Examples
161
+
162
+ ### Trend Analysis
163
+ ```ruby
164
+ require 'sqa/tai'
165
+
166
+ # Golden Cross detection
167
+ prices = load_stock_prices('AAPL')
168
+ sma_50 = SQA::TAI.sma(prices, period: 50)
169
+ sma_200 = SQA::TAI.sma(prices, period: 200)
170
+
171
+ if sma_50.last > sma_200.last
172
+ puts "Golden Cross - Bullish signal!"
173
+ end
174
+ ```
175
+
176
+ ### Momentum Analysis
177
+ ```ruby
178
+ # RSI Overbought/Oversold
179
+ prices = load_stock_prices('TSLA')
180
+ rsi = SQA::TAI.rsi(prices, period: 14)
181
+
182
+ case rsi.last
183
+ when 0...30
184
+ puts "Oversold - Potential buy"
185
+ when 70..100
186
+ puts "Overbought - Potential sell"
187
+ else
188
+ puts "Neutral"
189
+ end
190
+ ```
191
+
192
+ ### Volatility Analysis
193
+ ```ruby
194
+ # Bollinger Bands
195
+ prices = load_stock_prices('MSFT')
196
+ upper, middle, lower = SQA::TAI.bbands(prices, period: 20, nbdev_up: 2.0, nbdev_down: 2.0)
197
+
198
+ current_price = prices.last
199
+ if current_price > upper.last
200
+ puts "Price above upper band - overbought"
201
+ elsif current_price < lower.last
202
+ puts "Price below lower band - oversold"
203
+ end
204
+ ```
205
+
206
+ ### Pattern Recognition
207
+ ```ruby
208
+ # Candlestick patterns
209
+ open = [100, 102, 101, 99, 98]
210
+ high = [103, 105, 104, 102, 101]
211
+ low = [99, 101, 100, 97, 96]
212
+ close = [102, 103, 100, 98, 99]
213
+
214
+ doji = SQA::TAI.cdl_doji(open, high, low, close)
215
+ hammer = SQA::TAI.cdl_hammer(open, high, low, close)
216
+
217
+ puts "Doji detected!" if doji.last != 0
218
+ puts "Hammer detected!" if hammer.last != 0
219
+ ```
220
+
221
+ ## Error Handling
222
+
223
+ ```ruby
224
+ begin
225
+ result = SQA::TAI.sma(prices, period: 30)
226
+ rescue SQA::TAI::TAINotInstalledError => e
227
+ puts "Please install TA-Lib: #{e.message}"
228
+ rescue SQA::TAI::InvalidParameterError => e
229
+ puts "Invalid parameters: #{e.message}"
230
+ end
231
+ ```
232
+
233
+ ## SQA Ecosystem
234
+
235
+ `sqa-tai` is part of the SQA project:
236
+
237
+ - **[sqa](https://github.com/MadBomber/sqa)** - Trading strategy framework
238
+ - **[sqa-tai](https://github.com/MadBomber/sqa-tai)** - Technical indicators (this gem)
239
+ - **[sqa-cli](https://github.com/MadBomber/sqa-cli)** - Command-line tool with AI integration
240
+
241
+ ## Documentation
242
+
243
+ Full documentation available at:
244
+ - **Online**: [madbomber.github.io/sqa-tai](https://madbomber.github.io/sqa-tai)
245
+ - **API Reference**: Detailed method documentation
246
+ - **Tutorials**: Getting started guides
247
+ - **Examples**: Real-world usage examples
248
+
249
+ ## Development
250
+
251
+ ```bash
252
+ git clone https://github.com/MadBomber/sqa-tai.git
253
+ cd sqa-tai
254
+ bundle install
255
+ bundle exec rake test
256
+ ```
257
+
258
+ ## Testing
259
+
260
+ ```bash
261
+ # Run all tests
262
+ bundle exec rake test
263
+
264
+ # Run specific test
265
+ bundle exec ruby test/sqa/tai_test.rb
266
+ ```
267
+
268
+ ## Contributing
269
+
270
+ Bug reports and pull requests are welcome at https://github.com/MadBomber/sqa-tai.
271
+
272
+ 1. Fork it
273
+ 2. Create your feature branch (`git checkout -b feature/my-feature`)
274
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
275
+ 4. Push to the branch (`git push origin feature/my-feature`)
276
+ 5. Create new Pull Request
277
+
278
+ ## License
279
+
280
+ The gem is available as open source under the terms of the [MIT License](LICENSE).
281
+
282
+ ## Acknowledgments
283
+
284
+ - [TA-Lib](https://ta-lib.org/) - The underlying C library
285
+ - [ta_lib_ffi](https://github.com/TA-Lib/ta-lib-ruby) - Ruby FFI wrapper
286
+
287
+ ## Support
288
+
289
+ - 🐛 Issues: [GitHub Issues](https://github.com/MadBomber/sqa-tai/issues)
290
+ - 📚 Docs: [Documentation Site](https://madbomber.github.io/sqa-tai)
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/*_test.rb"]
10
+ t.warning = false
11
+ end
12
+
13
+ task default: :test