sqa 0.0.31 → 0.0.32

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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/CLAUDE.md +21 -0
  4. data/README.md +56 -32
  5. data/docs/api/dataframe.md +0 -1
  6. data/docs/assets/images/sqa.jpg +0 -0
  7. data/docs/concepts/index.md +2 -10
  8. data/docs/data_frame.md +0 -1
  9. data/docs/getting-started/index.md +0 -16
  10. data/docs/getting-started/installation.md +2 -2
  11. data/docs/getting-started/quick-start.md +4 -4
  12. data/docs/index.md +0 -2
  13. data/docs/strategies/bollinger-bands.md +1 -1
  14. data/docs/strategies/rsi.md +1 -1
  15. data/examples/sinatra_app/Gemfile +20 -0
  16. data/examples/sinatra_app/Gemfile.lock +268 -0
  17. data/examples/sinatra_app/QUICKSTART.md +13 -3
  18. data/examples/sinatra_app/README.md +12 -2
  19. data/examples/sinatra_app/RUNNING_WITHOUT_TALIB.md +90 -0
  20. data/examples/sinatra_app/TROUBLESHOOTING.md +95 -0
  21. data/examples/sinatra_app/app.rb +85 -25
  22. data/examples/sinatra_app/public/css/style.css +101 -37
  23. data/examples/sinatra_app/public/debug_macd.html +82 -0
  24. data/examples/sinatra_app/start.sh +53 -0
  25. data/examples/sinatra_app/views/dashboard.erb +558 -146
  26. data/examples/sinatra_app/views/layout.erb +2 -2
  27. data/lib/sqa/data_frame/alpha_vantage.rb +13 -3
  28. data/lib/sqa/data_frame.rb +21 -15
  29. data/lib/sqa/indicator.rb +17 -4
  30. data/lib/sqa/stock.rb +73 -11
  31. data/lib/sqa/ticker.rb +9 -2
  32. data/lib/sqa/version.rb +1 -1
  33. data/lib/sqa.rb +12 -4
  34. data/mkdocs.yml +4 -40
  35. metadata +7 -21
  36. data/docs/alpha_vantage_technical_indicators.md +0 -62
  37. data/docs/average_true_range.md +0 -9
  38. data/docs/bollinger_bands.md +0 -15
  39. data/docs/candlestick_pattern_recognizer.md +0 -4
  40. data/docs/donchian_channel.md +0 -5
  41. data/docs/double_top_bottom_pattern.md +0 -3
  42. data/docs/exponential_moving_average.md +0 -19
  43. data/docs/fibonacci_retracement.md +0 -30
  44. data/docs/head_and_shoulders_pattern.md +0 -3
  45. data/docs/market_profile.md +0 -4
  46. data/docs/momentum.md +0 -19
  47. data/docs/moving_average_convergence_divergence.md +0 -23
  48. data/docs/peaks_and_valleys.md +0 -11
  49. data/docs/relative_strength_index.md +0 -6
  50. data/docs/simple_moving_average.md +0 -8
  51. data/docs/stochastic_oscillator.md +0 -4
  52. data/docs/ta_lib.md +0 -160
  53. data/docs/true_range.md +0 -12
  54. data/docs/true_strength_index.md +0 -46
  55. data/docs/weighted_moving_average.md +0 -48
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d6d22476a47a9bfc41607bfaf78edd211f3e8be7badaef817512b3b9c04cb04
4
- data.tar.gz: 97ae20203d7bca4bef0bb619e1ae4550071e6072ebe8d357ec99a5957df874a4
3
+ metadata.gz: 9ce65f3dece761390257e68d4b3ddaf878e27e0b932b6b4dbd2dfecac2244c5f
4
+ data.tar.gz: 4dc160dda96a433049aeb06898a8a3cbfe1ecec439e1a9942d8272593658be14
5
5
  SHA512:
6
- metadata.gz: 3a51b38307d0c14f750dab7916a505dfd59e793a0d3bd1e1f19c45e5daab39d7e4b0913ace7661bfdb056017f9e5ac43164ea194c4f06d5dbb1423d3cdad6649
7
- data.tar.gz: cc4985173611bc3131cb017beb0e3812a3df593799ef1423b741aa7c9113f4ef308df1bba6f808990731bb9d101502dd641a44582dea7a1460d3d65a03bd152b
6
+ metadata.gz: 3194aaf4f55f8b2e388af48012ad71b5e282e4a69505f59dae78b29d30d2cb38c74ea06a25eff4b0323644a5b05581562b1c846c80ae0f7a39b2bc2210a58e1b
7
+ data.tar.gz: 5f5c72d9cbb21e508d85318a2d4173a6ea0e77cbe10f866131a90004b7fe8cb7278422f033038477dcd215cc46fd2738a841d3217b61da6e7ac8f05c18b149dc
data/CHANGELOG.md CHANGED
@@ -1,6 +1,19 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.0.32] 2025-11-12
4
+ ### Added
5
+ - **CSV Updates**: Conditional CSV updates based on timestamp
6
+ - Only updates CSV files when new data is available
7
+ - Improves performance by avoiding unnecessary writes
8
+
9
+ ### Changed
10
+ - **DataFrame**: Removed debug_me calls from SQA::DataFrame
11
+ - Cleaned up debugging code for production use
12
+
3
13
  ### Fixed
14
+ - **CSV Data Quality**: Multiple improvements to CSV data handling
15
+ - Change CSV sort order to ascending (oldest-first) for TA-Lib compatibility
16
+ - Prevent duplicate timestamps in CSV data files
4
17
  - **DataFrame::Data**: Added missing `SQA::DataFrame::Data` class for stock metadata storage
5
18
  - Stores ticker, name, exchange, source, indicators, and overview data
6
19
  - Supports both hash initialization (JSON) and keyword arguments
data/CLAUDE.md CHANGED
@@ -212,6 +212,27 @@ sqa-console # Launch IRB with SQA library loaded
212
212
  - 150+ indicators available: SMA, EMA, RSI, MACD, Bollinger Bands, ADX, ATR, etc.
213
213
  - See: https://github.com/MadBomber/sqa-tai
214
214
 
215
+ ### Data Ordering (CRITICAL)
216
+ **TA-Lib Requirement**: Arrays MUST be in **OLDEST-FIRST** (ascending chronological) order
217
+ - Index [0] = oldest data point
218
+ - Index [last] = newest/most recent data point
219
+ - This applies to ALL TA-Lib indicators
220
+
221
+ **SQA Implementation**:
222
+ - ✅ CSV files stored in **ASCENDING order** (oldest-first) for TA-Lib compatibility
223
+ - ✅ DataFrames maintain ascending order after updates
224
+ - ✅ `.to_a` extracts arrays ready for TA-Lib (no reversal needed)
225
+ - ✅ `concat_and_deduplicate!` sorts ascending by default
226
+ - ⚠️ Alpha Vantage API returns data newest-first, but SQA automatically sorts to ascending
227
+
228
+ **Example**:
229
+ ```ruby
230
+ prices = stock.df["adj_close_price"].to_a
231
+ # => [100.0, 101.5, 103.2, ...] (oldest to newest - ready for TA-Lib)
232
+
233
+ rsi = SQAI.rsi(prices, period: 14) # Correct order, no reversal needed
234
+ ```
235
+
215
236
  ### Testing Approach
216
237
  - Minitest framework in `/test/` directory
217
238
  - SimpleCov for coverage reporting
data/README.md CHANGED
@@ -1,10 +1,53 @@
1
- # SQA - Simple Qualitative Analysis
1
+ <div align="center">
2
+ <h1>SQA - Simple Qualitative Analysis</h1>
3
+
4
+ <p>A Ruby library for technical analysis of stock market data, trading strategies, and portfolio optimization.<br/>
5
+ Core library of the <a href="https://github.com/MadBomber/sqa">SQA</a> (Simple Qualitative Analysis) ecosystem.</p>
6
+ </div>
7
+
8
+ <table>
9
+ <tr>
10
+ <td width="30%" valign="middle" align="center">
11
+ <img src="docs/assets/images/sqa.jpg" alt="Ruby Turns Information into Knowledge" width="80%">
12
+ <br/>
13
+ <a href="https://www.youtube.com/watch?v=VqomZQMZQCQ">
14
+ <img src="https://img.shields.io/badge/Badge-We%20don't%20need%20no%20stinkin'%20badges!-red" alt="Badges?">
15
+ </a>
16
+ </td>
17
+ <td width="70%" valign="top">
18
+
19
+ **⚠️ WARNING:** This is a learning tool, not production software. DO NOT use this library when real money is at stake. The BUY/SELL signals it generates should not be taken seriously. If you lose your shirt playing in the stock market, don't come crying to me. Playing in the market is like playing in the street - you're going to get run over.
2
20
 
3
- [![Badges?](https://img.shields.io/badge/Badge-We%20don't%20need%20no%20stinkin'%20badges!-red)](https://www.youtube.com/watch?v=VqomZQMZQCQ)
21
+ ## Features
4
22
 
5
- A Ruby library for technical analysis of stock market data. This is a simplistic set of tools for quantitative and qualitative stock analysis designed for **educational purposes only**.
23
+ ### Core Capabilities
24
+ - **High-Performance DataFrames** - Polars-based data structures for time series financial data
25
+ - **150+ Technical Indicators** - Via the separate [`sqa-tai`](https://github.com/MadBomber/sqa-tai) gem (TA-Lib wrapper)
26
+ - **Trading Strategies** - Framework for building and testing trading strategies
27
+ - **Multiple Data Sources** - Alpha Vantage and Yahoo Finance adapters
28
+ - **Stock Management** - Track stocks with historical prices and company metadata
29
+ - **Statistical Analysis** - Comprehensive statistics on price data
30
+ - **Ticker Validation** - Validate stock symbols against market exchanges
31
+ - **Interactive Console** - IRB console for experimentation (`sqa-console`)
32
+ - **CLI Tools** - Command-line interface via the separate [`sqa-cli`](https://github.com/MadBomber/sqa-cli) gem
6
33
 
7
- **⚠️ WARNING:** This is a learning tool, not production software. Do NOT use this library when real money is at stake. The BUY/SELL signals it generates should not be taken seriously. If you lose your shirt playing in the stock market, don't come crying to me. Playing in the market is like playing in the street - you're going to get run over.
34
+ ### Advanced Features
35
+ - **Portfolio Management** - Track positions, trades, P&L with commission support
36
+ - **Backtesting Framework** - Simulate trading strategies with comprehensive performance metrics
37
+ - **Strategy Generator** - Reverse-engineer profitable trades to discover indicator patterns
38
+ - **Genetic Programming** - Evolve optimal strategy parameters through natural selection
39
+ - **Knowledge-Based Strategy (KBS)** - RETE-based forward-chaining inference for complex trading rules
40
+ - **Real-Time Streaming** - Event-driven live price processing with on-the-fly signal generation
41
+ - **FPL Analysis** - Future Period Loss/Profit analysis with risk metrics and directional classification
42
+ - **Market Regime Detection** - Identify bull/bear/sideways markets with volatility and strength metrics
43
+ - **Seasonal Analysis** - Discover calendar-dependent patterns (monthly/quarterly performance)
44
+ - **Sector Analysis** - Multi-stock pattern discovery with KBS blackboards per sector
45
+ - **Walk-Forward Validation** - Time-series cross-validation to prevent pattern overfitting
46
+ - **Pattern Context System** - Context-aware patterns that know when/where they're valid
47
+
48
+ </td>
49
+ </tr>
50
+ </table>
8
51
 
9
52
  <!-- Tocer[start]: Auto-generated, don't remove. -->
10
53
 
@@ -30,33 +73,6 @@ A Ruby library for technical analysis of stock market data. This is a simplistic
30
73
  - [License](#license)
31
74
 
32
75
  <!-- Tocer[finish]: Auto-generated, don't remove. -->
33
-
34
- ## Features
35
-
36
- ### Core Capabilities
37
- - **High-Performance DataFrames** - Polars-based data structures for time series financial data
38
- - **150+ Technical Indicators** - Via the `sqa-tai` gem (TA-Lib wrapper)
39
- - **Trading Strategies** - Framework for building and testing trading strategies
40
- - **Multiple Data Sources** - Alpha Vantage and Yahoo Finance adapters
41
- - **Stock Management** - Track stocks with historical prices and company metadata
42
- - **Statistical Analysis** - Comprehensive statistics on price data
43
- - **Ticker Validation** - Validate stock symbols against market exchanges
44
- - **Interactive Console** - IRB console for experimentation (`sqa-console`)
45
-
46
- ### Advanced Features
47
- - **Portfolio Management** - Track positions, trades, P&L with commission support
48
- - **Backtesting Framework** - Simulate trading strategies with comprehensive performance metrics
49
- - **Strategy Generator** - Reverse-engineer profitable trades to discover indicator patterns
50
- - **Genetic Programming** - Evolve optimal strategy parameters through natural selection
51
- - **Knowledge-Based Strategy (KBS)** - RETE-based forward-chaining inference for complex trading rules
52
- - **Real-Time Streaming** - Event-driven live price processing with on-the-fly signal generation
53
- - **FPL Analysis** - Future Period Loss/Profit analysis with risk metrics and directional classification
54
- - **Market Regime Detection** - Identify bull/bear/sideways markets with volatility and strength metrics
55
- - **Seasonal Analysis** - Discover calendar-dependent patterns (monthly/quarterly performance)
56
- - **Sector Analysis** - Multi-stock pattern discovery with KBS blackboards per sector
57
- - **Walk-Forward Validation** - Time-series cross-validation to prevent pattern overfitting
58
- - **Pattern Context System** - Context-aware patterns that know when/where they're valid
59
-
60
76
  ## Installation
61
77
 
62
78
  Install the gem:
@@ -65,6 +81,8 @@ Install the gem:
65
81
  gem install sqa
66
82
  ```
67
83
 
84
+ This will automatically install the `sqa-tai` gem (technical indicators) as a dependency.
85
+
68
86
  Or add to your `Gemfile`:
69
87
 
70
88
  ```ruby
@@ -77,6 +95,12 @@ Then run:
77
95
  bundle install
78
96
  ```
79
97
 
98
+ For command-line tools, install the separate CLI gem:
99
+
100
+ ```bash
101
+ gem install sqa-cli
102
+ ```
103
+
80
104
  ## Configuration
81
105
 
82
106
  ### Data Directory
@@ -186,7 +210,7 @@ df.data # Polars::DataFrame
186
210
 
187
211
  ### Technical Indicators
188
212
 
189
- All technical indicators are provided by the [`sqa-tai`](https://github.com/MadBomber/sqa-tai) gem, which wraps the industry-standard TA-Lib library:
213
+ All technical indicators are provided by the separate [`sqa-tai`](https://github.com/MadBomber/sqa-tai) gem, which wraps the industry-standard TA-Lib library. The `sqa-tai` gem must be installed separately but is automatically included as a dependency of `sqa`.
190
214
 
191
215
  ```ruby
192
216
  require 'sqa'
@@ -1047,7 +1047,6 @@ See `DATAFRAME_ARCHITECTURE_REVIEW.md` for detailed analysis.
1047
1047
 
1048
1048
  ## Related Documentation
1049
1049
 
1050
- - [Stock Class](stock.md) - Using DataFrames with Stock objects
1051
1050
  - [FPL Analysis](../advanced/fpop.md) - Future Period Loss/Profit utilities
1052
1051
  - [Technical Indicators](../indicators/index.md) - SQAI/TAI integration
1053
1052
  - [Polars Documentation](https://pola-rs.github.io/polars-book/) - Underlying library
Binary file
@@ -33,14 +33,6 @@ graph TB
33
33
 
34
34
  <div class="grid cards" markdown>
35
35
 
36
- - :material-chart-line:{ .lg .middle } __Stock Objects__
37
-
38
- ---
39
-
40
- Learn about loading and managing stock data
41
-
42
- [:octicons-arrow-right-24: Stock Guide](stock.md)
43
-
44
36
  - :material-table:{ .lg .middle } __DataFrames__
45
37
 
46
38
  ---
@@ -53,9 +45,9 @@ graph TB
53
45
 
54
46
  ---
55
47
 
56
- 150+ technical analysis indicators via TA-Lib
48
+ 150+ technical analysis indicators via sqa-tai gem
57
49
 
58
- [:octicons-arrow-right-24: Indicators](indicators.md)
50
+ [:octicons-arrow-right-24: Indicators](../indicators/index.md)
59
51
 
60
52
  - :material-strategy:{ .lg .middle } __Strategies__
61
53
 
data/docs/data_frame.md CHANGED
@@ -341,7 +341,6 @@ end
341
341
  ## Related Documentation
342
342
 
343
343
  - [FPL Analysis](advanced/fpop.md) - Future Period Loss/Profit utilities
344
- - [Stock Class](api/stock.md) - Using DataFrames with Stock objects
345
344
  - [Indicators](indicators/index.md) - Technical indicator integration
346
345
  - [Polars Documentation](https://pola-rs.github.io/polars-book/) - Underlying library
347
346
 
@@ -40,22 +40,6 @@ Before you begin, make sure you have:
40
40
 
41
41
  [:octicons-arrow-right-24: Quick Start Guide](quick-start.md)
42
42
 
43
- - :material-cog:{ .lg .middle } __Configuration__
44
-
45
- ---
46
-
47
- Configure data sources and customize settings
48
-
49
- [:octicons-arrow-right-24: Configuration](configuration.md)
50
-
51
- - :material-console:{ .lg .middle } __Console Usage__
52
-
53
- ---
54
-
55
- Interactive exploration with sqa-console
56
-
57
- [:octicons-arrow-right-24: Console Guide](console-usage.md)
58
-
59
43
  </div>
60
44
 
61
45
  ## Typical Workflow
@@ -192,8 +192,8 @@ bundle install
192
192
  Now that you have SQA installed:
193
193
 
194
194
  1. **[Quick Start Guide](quick-start.md)** - Run your first analysis
195
- 2. **[Configuration](configuration.md)** - Customize your setup
196
- 3. **[Console Usage](console-usage.md)** - Explore interactively
195
+ 2. **[Core Concepts](../concepts/index.md)** - Understand SQA's architecture
196
+ 3. **[Trading Strategies](../strategies/index.md)** - Explore built-in strategies
197
197
 
198
198
  ## Additional Dependencies
199
199
 
@@ -204,10 +204,10 @@ SQA::Strategy.descendants # List all strategy classes
204
204
 
205
205
  Now that you've run your first analyses:
206
206
 
207
- 1. **[Configuration Guide](configuration.md)** - Customize data sources and settings
208
- 2. **[Core Concepts](../concepts/index.md)** - Understand SQA's architecture
209
- 3. **[Trading Strategies](../strategies/index.md)** - Explore built-in strategies
210
- 4. **[Advanced Features](../advanced/index.md)** - Portfolio management, streaming, etc.
207
+ 1. **[Core Concepts](../concepts/index.md)** - Understand SQA's architecture
208
+ 2. **[Trading Strategies](../strategies/index.md)** - Explore built-in strategies
209
+ 3. **[Advanced Features](../advanced/index.md)** - Portfolio management, streaming, etc.
210
+ 4. **[API Reference](../api/index.md)** - Complete API documentation
211
211
 
212
212
  ## Common Patterns
213
213
 
data/docs/index.md CHANGED
@@ -124,8 +124,6 @@ Ready to dive in? Check out our guides:
124
124
 
125
125
  - **[Installation Guide](getting-started/installation.md)** - Get SQA up and running
126
126
  - **[Quick Start](getting-started/quick-start.md)** - Your first analysis in minutes
127
- - **[Configuration](getting-started/configuration.md)** - Customize SQA for your needs
128
- - **[Console Usage](getting-started/console-usage.md)** - Interactive exploration with `sqa-console`
129
127
 
130
128
  ## Key Resources
131
129
 
@@ -143,4 +143,4 @@ end
143
143
 
144
144
  - [Bollinger Bands on Wikipedia](https://en.wikipedia.org/wiki/Bollinger_Bands)
145
145
  - [John Bollinger's Official Site](https://www.bollingerbands.com/)
146
- - [Understanding Volatility with Bollinger Bands](../concepts/volatility.md)
146
+ - [Technical Indicators](../indicators/index.md)
@@ -92,4 +92,4 @@ signal = SQA::Strategy::RSI.trade(vector)
92
92
  ## Further Reading
93
93
 
94
94
  - [RSI on Investopedia](https://www.investopedia.com/terms/r/rsi.asp)
95
- - [Trading with RSI](../concepts/momentum.md)
95
+ - [Technical Indicators](../indicators/index.md)
@@ -5,6 +5,7 @@ source 'https://rubygems.org'
5
5
  ruby '>= 3.2.0'
6
6
 
7
7
  # Web framework
8
+ gem 'rackup'
8
9
  gem 'sinatra', '~> 4.0'
9
10
  gem 'sinatra-contrib', '~> 4.0'
10
11
  gem 'puma', '~> 6.0'
@@ -12,6 +13,25 @@ gem 'puma', '~> 6.0'
12
13
  # JSON handling
13
14
  gem 'json', '~> 2.7'
14
15
 
16
+ # SQA library dependencies (required when loading SQA from local path)
17
+ gem 'alphavantage'
18
+ gem 'csv'
19
+ gem 'faraday'
20
+ gem 'hashie'
21
+ gem 'kbs'
22
+ gem 'lite-statistics'
23
+ gem 'nenv'
24
+ gem 'redis'
25
+ gem 'ruby_llm'
26
+ gem 'ruby_llm-mcp'
27
+ gem 'shared_tools'
28
+ gem 'sqa-tai'
29
+ gem 'tty-table'
30
+ gem 'eps'
31
+ gem 'polars-df'
32
+ gem 'toml-rb'
33
+ gem 'regent'
34
+
15
35
  # SQA library (assumes it's in parent directory)
16
36
  # In production, this would be:
17
37
  # gem 'sqa'
@@ -0,0 +1,268 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ addressable (2.8.7)
5
+ public_suffix (>= 2.0.2, < 7.0)
6
+ alphavantage (1.2.0)
7
+ faraday (~> 1.4)
8
+ hashie (~> 4.1)
9
+ base64 (0.3.0)
10
+ bigdecimal (3.3.1)
11
+ citrus (3.0.2)
12
+ concurrent-ruby (1.3.5)
13
+ connection_pool (2.5.4)
14
+ csv (3.3.5)
15
+ dentaku (3.5.6)
16
+ bigdecimal
17
+ concurrent-ruby
18
+ eps (0.6.0)
19
+ lightgbm (>= 0.1.7)
20
+ matrix
21
+ nokogiri
22
+ event_stream_parser (1.0.0)
23
+ faraday (1.10.4)
24
+ faraday-em_http (~> 1.0)
25
+ faraday-em_synchrony (~> 1.0)
26
+ faraday-excon (~> 1.1)
27
+ faraday-httpclient (~> 1.0)
28
+ faraday-multipart (~> 1.0)
29
+ faraday-net_http (~> 1.0)
30
+ faraday-net_http_persistent (~> 1.0)
31
+ faraday-patron (~> 1.0)
32
+ faraday-rack (~> 1.0)
33
+ faraday-retry (~> 1.0)
34
+ ruby2_keywords (>= 0.0.4)
35
+ faraday-em_http (1.0.0)
36
+ faraday-em_synchrony (1.0.1)
37
+ faraday-excon (1.1.0)
38
+ faraday-httpclient (1.0.1)
39
+ faraday-multipart (1.1.1)
40
+ multipart-post (~> 2.0)
41
+ faraday-net_http (1.0.2)
42
+ faraday-net_http_persistent (1.2.0)
43
+ faraday-patron (1.0.0)
44
+ faraday-rack (1.0.0)
45
+ faraday-retry (1.0.3)
46
+ ffi (1.17.2)
47
+ ffi (1.17.2-aarch64-linux-gnu)
48
+ ffi (1.17.2-aarch64-linux-musl)
49
+ ffi (1.17.2-arm-linux-gnu)
50
+ ffi (1.17.2-arm-linux-musl)
51
+ ffi (1.17.2-arm64-darwin)
52
+ ffi (1.17.2-x86-linux-gnu)
53
+ ffi (1.17.2-x86-linux-musl)
54
+ ffi (1.17.2-x86_64-darwin)
55
+ ffi (1.17.2-x86_64-linux-gnu)
56
+ ffi (1.17.2-x86_64-linux-musl)
57
+ fiddle (1.1.8)
58
+ hashie (4.1.0)
59
+ http-2 (1.1.1)
60
+ httpx (1.6.3)
61
+ http-2 (>= 1.0.0)
62
+ json (2.16.0)
63
+ json-schema (5.2.2)
64
+ addressable (~> 2.8)
65
+ bigdecimal (~> 3.1)
66
+ kbs (0.1.0)
67
+ sqlite3 (~> 1.6)
68
+ lightgbm (0.4.3)
69
+ ffi
70
+ listen (3.9.0)
71
+ rb-fsevent (~> 0.10, >= 0.10.3)
72
+ rb-inotify (~> 0.9, >= 0.9.10)
73
+ lite-memoize (1.1.1)
74
+ lite-statistics (2.0.0)
75
+ lite-memoize
76
+ logger (1.7.0)
77
+ marcel (1.1.0)
78
+ matrix (0.4.3)
79
+ mini_portile2 (2.8.9)
80
+ multi_json (1.17.0)
81
+ multipart-post (2.4.1)
82
+ mustermann (3.0.4)
83
+ ruby2_keywords (~> 0.0.1)
84
+ nenv (0.3.0)
85
+ nio4r (2.7.5)
86
+ nokogiri (1.18.10)
87
+ mini_portile2 (~> 2.8.2)
88
+ racc (~> 1.4)
89
+ nokogiri (1.18.10-aarch64-linux-gnu)
90
+ racc (~> 1.4)
91
+ nokogiri (1.18.10-aarch64-linux-musl)
92
+ racc (~> 1.4)
93
+ nokogiri (1.18.10-arm-linux-gnu)
94
+ racc (~> 1.4)
95
+ nokogiri (1.18.10-arm-linux-musl)
96
+ racc (~> 1.4)
97
+ nokogiri (1.18.10-arm64-darwin)
98
+ racc (~> 1.4)
99
+ nokogiri (1.18.10-x86_64-darwin)
100
+ racc (~> 1.4)
101
+ nokogiri (1.18.10-x86_64-linux-gnu)
102
+ racc (~> 1.4)
103
+ nokogiri (1.18.10-x86_64-linux-musl)
104
+ racc (~> 1.4)
105
+ openweathermap (0.2.3)
106
+ pastel (0.8.0)
107
+ tty-color (~> 0.5)
108
+ polars-df (0.23.0)
109
+ bigdecimal
110
+ rb_sys
111
+ polars-df (0.23.0-aarch64-linux)
112
+ bigdecimal
113
+ polars-df (0.23.0-aarch64-linux-musl)
114
+ bigdecimal
115
+ polars-df (0.23.0-arm64-darwin)
116
+ bigdecimal
117
+ polars-df (0.23.0-x86_64-darwin)
118
+ bigdecimal
119
+ polars-df (0.23.0-x86_64-linux)
120
+ bigdecimal
121
+ polars-df (0.23.0-x86_64-linux-musl)
122
+ bigdecimal
123
+ public_suffix (6.0.2)
124
+ puma (6.6.1)
125
+ nio4r (~> 2.0)
126
+ racc (1.8.1)
127
+ rack (3.2.4)
128
+ rack-protection (4.2.1)
129
+ base64 (>= 0.1.0)
130
+ logger (>= 1.6.0)
131
+ rack (>= 3.0.0, < 4)
132
+ rack-session (2.1.1)
133
+ base64 (>= 0.1.0)
134
+ rack (>= 3.0.0)
135
+ rackup (2.2.1)
136
+ rack (>= 3)
137
+ rake-compiler-dock (1.9.1)
138
+ rb-fsevent (0.11.2)
139
+ rb-inotify (0.11.1)
140
+ ffi (~> 1.0)
141
+ rb_sys (0.9.117)
142
+ rake-compiler-dock (= 1.9.1)
143
+ redis (5.4.1)
144
+ redis-client (>= 0.22.0)
145
+ redis-client (0.26.1)
146
+ connection_pool
147
+ regent (0.3.3)
148
+ pastel (~> 0.8.0)
149
+ tty-spinner (~> 0.9.3)
150
+ zeitwerk (~> 2.7)
151
+ rerun (0.14.0)
152
+ listen (~> 3.0)
153
+ ruby2_keywords (0.0.5)
154
+ ruby_llm (1.9.1)
155
+ base64
156
+ event_stream_parser (~> 1)
157
+ faraday (>= 1.10.0)
158
+ faraday-multipart (>= 1)
159
+ faraday-net_http (>= 1)
160
+ faraday-retry (>= 1)
161
+ marcel (~> 1.0)
162
+ ruby_llm-schema (~> 0.2.1)
163
+ zeitwerk (~> 2)
164
+ ruby_llm-mcp (0.8.0)
165
+ httpx (~> 1.4)
166
+ json-schema (~> 5.0)
167
+ ruby_llm (~> 1.9)
168
+ zeitwerk (~> 2)
169
+ ruby_llm-schema (0.2.4)
170
+ sequel (5.98.0)
171
+ bigdecimal
172
+ shared_tools (0.3.0)
173
+ dentaku
174
+ nokogiri
175
+ openweathermap
176
+ ruby_llm
177
+ ruby_llm-mcp
178
+ sequel
179
+ zeitwerk
180
+ sinatra (4.2.1)
181
+ logger (>= 1.6.0)
182
+ mustermann (~> 3.0)
183
+ rack (>= 3.0.0, < 4)
184
+ rack-protection (= 4.2.1)
185
+ rack-session (>= 2.0.0, < 3)
186
+ tilt (~> 2.0)
187
+ sinatra-contrib (4.2.1)
188
+ multi_json (>= 0.0.2)
189
+ mustermann (~> 3.0)
190
+ rack-protection (= 4.2.1)
191
+ sinatra (= 4.2.1)
192
+ tilt (~> 2.0)
193
+ sqa-tai (0.1.0)
194
+ ta_lib_ffi (~> 0.3)
195
+ sqlite3 (1.7.3)
196
+ mini_portile2 (~> 2.8.0)
197
+ sqlite3 (1.7.3-aarch64-linux)
198
+ sqlite3 (1.7.3-arm-linux)
199
+ sqlite3 (1.7.3-arm64-darwin)
200
+ sqlite3 (1.7.3-x86-linux)
201
+ sqlite3 (1.7.3-x86_64-darwin)
202
+ sqlite3 (1.7.3-x86_64-linux)
203
+ strings (0.2.1)
204
+ strings-ansi (~> 0.2)
205
+ unicode-display_width (>= 1.5, < 3.0)
206
+ unicode_utils (~> 1.4)
207
+ strings-ansi (0.2.0)
208
+ ta_lib_ffi (0.3.0)
209
+ fiddle (~> 1.1)
210
+ tilt (2.6.1)
211
+ toml-rb (4.1.0)
212
+ citrus (~> 3.0, > 3.0)
213
+ racc (~> 1.7)
214
+ tty-color (0.6.0)
215
+ tty-cursor (0.7.1)
216
+ tty-screen (0.8.2)
217
+ tty-spinner (0.9.3)
218
+ tty-cursor (~> 0.7)
219
+ tty-table (0.12.0)
220
+ pastel (~> 0.8)
221
+ strings (~> 0.2.0)
222
+ tty-screen (~> 0.8)
223
+ unicode-display_width (2.6.0)
224
+ unicode_utils (1.4.0)
225
+ zeitwerk (2.7.3)
226
+
227
+ PLATFORMS
228
+ aarch64-linux-gnu
229
+ aarch64-linux-musl
230
+ arm-linux-gnu
231
+ arm-linux-musl
232
+ arm64-darwin
233
+ x86-linux-gnu
234
+ x86-linux-musl
235
+ x86_64-darwin
236
+ x86_64-linux-gnu
237
+ x86_64-linux-musl
238
+
239
+ DEPENDENCIES
240
+ alphavantage
241
+ csv
242
+ eps
243
+ faraday
244
+ hashie
245
+ json (~> 2.7)
246
+ kbs
247
+ lite-statistics
248
+ nenv
249
+ polars-df
250
+ puma (~> 6.0)
251
+ rackup
252
+ redis
253
+ regent
254
+ rerun
255
+ ruby_llm
256
+ ruby_llm-mcp
257
+ shared_tools
258
+ sinatra (~> 4.0)
259
+ sinatra-contrib (~> 4.0)
260
+ sqa-tai
261
+ toml-rb
262
+ tty-table
263
+
264
+ RUBY VERSION
265
+ ruby 3.3.6p108
266
+
267
+ BUNDLED WITH
268
+ 2.7.2
@@ -24,12 +24,22 @@ bundle install
24
24
 
25
25
  ## 3. Start the Application
26
26
 
27
+ **IMPORTANT:** Always use `bundle exec` to ensure all gems are loaded correctly:
28
+
29
+ ```bash
30
+ bundle exec ruby app.rb
31
+ ```
32
+
33
+ Or use the provided startup script:
34
+
27
35
  ```bash
28
- ruby app.rb
36
+ ./start.sh
29
37
  ```
30
38
 
31
39
  The app will start on http://localhost:4567
32
40
 
41
+ **Common mistake:** Running `ruby app.rb` without `bundle exec` will cause the app to fail or behave incorrectly.
42
+
33
43
  ## 4. Quick Tour
34
44
 
35
45
  ### Home Page
@@ -92,8 +102,8 @@ curl -X POST http://localhost:4567/api/compare/AAPL
92
102
  Auto-reload on file changes:
93
103
 
94
104
  ```bash
95
- gem install rerun
96
- rerun 'ruby app.rb'
105
+ bundle install # rerun is in the development group
106
+ bundle exec rerun 'ruby app.rb'
97
107
  ```
98
108
 
99
109
  ## 8. Troubleshooting
@@ -84,13 +84,23 @@ redis-server
84
84
 
85
85
  ### Start the Application
86
86
 
87
+ **⚠️ IMPORTANT:** Always use `bundle exec` to run the app:
88
+
89
+ ```bash
90
+ bundle exec ruby app.rb
91
+ ```
92
+
93
+ **Or use the startup script:**
94
+
87
95
  ```bash
88
- ruby app.rb
96
+ ./start.sh
89
97
  ```
90
98
 
99
+ **Why `bundle exec`?** Running `ruby app.rb` without `bundle exec` may fail to load required gems, causing the dashboard to not work properly (buttons won't respond, charts won't load, API calls will fail).
100
+
91
101
  Or using Rack:
92
102
  ```bash
93
- rackup
103
+ bundle exec rackup
94
104
  ```
95
105
 
96
106
  The application will start on `http://localhost:4567`