sqa_demo-sinatra 0.1.0 → 0.2.2
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 +4 -4
- data/CHANGELOG.md +141 -0
- data/README.md +18 -0
- data/lib/sqa_demo/sinatra/app.rb +18 -549
- data/lib/sqa_demo/sinatra/helpers/api_helpers.rb +221 -0
- data/lib/sqa_demo/sinatra/helpers/filters.rb +50 -0
- data/lib/sqa_demo/sinatra/helpers/formatting.rb +63 -0
- data/lib/sqa_demo/sinatra/helpers/stock_loader.rb +215 -0
- data/lib/sqa_demo/sinatra/public/css/style.css +290 -13
- data/lib/sqa_demo/sinatra/public/js/app.js +55 -8
- data/lib/sqa_demo/sinatra/routes/api.rb +235 -0
- data/lib/sqa_demo/sinatra/routes/pages.rb +137 -0
- data/lib/sqa_demo/sinatra/version.rb +1 -1
- data/lib/sqa_demo/sinatra/views/analyze.erb +83 -8
- data/lib/sqa_demo/sinatra/views/company.erb +682 -0
- data/lib/sqa_demo/sinatra/views/compare.erb +500 -0
- data/lib/sqa_demo/sinatra/views/dashboard.erb +11 -1
- data/lib/sqa_demo/sinatra/views/index.erb +2 -1
- data/lib/sqa_demo/sinatra/views/layout.erb +106 -14
- metadata +10 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 102bbc58a4c76deabffe491e999e97f55267d36e34f7d895d5c548cf9726dff7
|
|
4
|
+
data.tar.gz: d83faf8a27e8b507f689249e79a7b2b13165b9f58acde0607bec461f8fde3384
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4710702d574c4de28d3dac12ecb6d107402d5a5c9bdda43c60d047c67f9f9bd07f361be94aef7f802bc4521287b0bc118c82dabd82b2a088e41e322afeb3585d
|
|
7
|
+
data.tar.gz: eeae37e4bb277d4093341404397b7887896f383ddc1aba774c89b5b0650c1eacfc64f0e90fd3ab87ba8bbfee1bec7e55dac0e5397eb1bfaf39ba552326b211b3
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
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.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.2.2] - 2025-11-22
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **To Do section** in README.md with prioritized roadmap items
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Documentation updates and cleanup
|
|
17
|
+
|
|
18
|
+
## [0.2.1] - 2025-11-22
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- **Major refactoring** of `app.rb` from 902 lines to 50 lines for improved maintainability
|
|
22
|
+
- Extracted helpers into separate modules under `helpers/` directory:
|
|
23
|
+
- `formatting.rb` - Value formatting helpers (currency, percent, numbers)
|
|
24
|
+
- `filters.rb` - Time period filtering for data arrays
|
|
25
|
+
- `stock_loader.rb` - Centralized stock data loading and calculations
|
|
26
|
+
- `api_helpers.rb` - API-specific helpers (indicators, patterns, FPOP analysis)
|
|
27
|
+
- Extracted routes into separate modules under `routes/` directory:
|
|
28
|
+
- `pages.rb` - Page routes (/, /dashboard, /analyze, /backtest, /company, /compare)
|
|
29
|
+
- `api.rb` - API routes (/api/stock, /api/indicators, /api/backtest, /api/analyze, /api/compare)
|
|
30
|
+
- Centralized stock data fetching to eliminate code duplication across routes
|
|
31
|
+
- Added reusable helper methods for common calculations:
|
|
32
|
+
- `load_stock` and `load_stock_with_overview` for stock loading
|
|
33
|
+
- `extract_ohlcv` for OHLCV data extraction
|
|
34
|
+
- `calculate_price_metrics`, `calculate_indicators`, `calculate_risk_metrics`
|
|
35
|
+
- `fetch_comparison_data` for parallel comparison fetching
|
|
36
|
+
|
|
37
|
+
## [0.2.0] - 2025-11-22
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
- **Multi-stock comparison page** (`/compare`) for side-by-side analysis of up to 5 stocks
|
|
41
|
+
- Enter multiple tickers separated by spaces in search input
|
|
42
|
+
- Automatic routing to comparison page when multiple tickers entered
|
|
43
|
+
- Compare dropdown menu in navigation with popular comparison presets
|
|
44
|
+
- **Comprehensive comparison table** with 7 metric sections:
|
|
45
|
+
- Price & Performance (current price, daily change, YTD return, 52-week high/low, volume)
|
|
46
|
+
- Momentum Indicators (RSI, MACD, Stochastic, Momentum, ROC, CCI, Williams %R)
|
|
47
|
+
- Trend Indicators (ADX, SMA 50/200, EMA 20)
|
|
48
|
+
- Volatility (ATR, Bollinger Bands, Beta)
|
|
49
|
+
- Valuation (P/E, Forward P/E, PEG, Price/Book, Market Cap)
|
|
50
|
+
- Profitability (EPS, Profit Margin, Operating Margin, ROE, ROA, Dividend Yield)
|
|
51
|
+
- Risk Metrics (Sharpe Ratio, Max Drawdown, Analyst Target)
|
|
52
|
+
- **Best Count summary row** at top of comparison table showing total "best" results per stock
|
|
53
|
+
- **Smart column ordering** - stocks sorted by best count (highest to lowest), alphabetically for ties
|
|
54
|
+
- **Best value highlighting** - green highlight for best performer in each metric row
|
|
55
|
+
- **Parallel data fetching** using threads for faster multi-stock loading
|
|
56
|
+
- **Partial failure handling** - shows warning for failed tickers while displaying available data
|
|
57
|
+
- Individual analysis links for each compared stock (Dashboard, Analysis, Company)
|
|
58
|
+
|
|
59
|
+
### Changed
|
|
60
|
+
- Search input placeholder updated to indicate multi-ticker support
|
|
61
|
+
- Added hint text explaining comparison feature (up to 5 tickers)
|
|
62
|
+
- Missing data now displays as "-" instead of "N/A" for cleaner presentation
|
|
63
|
+
|
|
64
|
+
## [0.1.2] - 2025-11-22
|
|
65
|
+
|
|
66
|
+
### Added
|
|
67
|
+
- **Sticky two-tier navigation header** that remains fixed at top while scrolling
|
|
68
|
+
- Primary navbar with dropdown menus for Dashboard, Analysis, and Backtest
|
|
69
|
+
- Quick access to popular stocks (AAPL, MSFT, GOOGL, TSLA) in dropdowns
|
|
70
|
+
- Global search button for ticker lookup
|
|
71
|
+
- **Context bar** on stock-specific pages showing:
|
|
72
|
+
- Current ticker symbol and company name
|
|
73
|
+
- Sub-navigation pills (Dashboard, Analysis, Backtest, Company)
|
|
74
|
+
- Period selector dropdown (on Dashboard)
|
|
75
|
+
- **Enhanced FPOP (Future Period Analysis) table**:
|
|
76
|
+
- Date column showing prediction target dates
|
|
77
|
+
- Historical predictions with actual price change verification
|
|
78
|
+
- Green checkmark for correct predictions (within 1% of actual)
|
|
79
|
+
- Red X for incorrect predictions
|
|
80
|
+
- Future predictions marked as "Pending" with cyan highlight
|
|
81
|
+
- Accuracy summary showing historical prediction success rate
|
|
82
|
+
- Weekend-aware future date generation (skips Sat/Sun)
|
|
83
|
+
|
|
84
|
+
### Changed
|
|
85
|
+
- Navigation now uses consistent menubar across all pages
|
|
86
|
+
- FPOP predictions now show both historical (verifiable) and future dates
|
|
87
|
+
- Prediction accuracy based on magnitude difference (<=1% = correct)
|
|
88
|
+
|
|
89
|
+
## [0.1.1] - 2025-11-22
|
|
90
|
+
|
|
91
|
+
### Added
|
|
92
|
+
- Company details page (`/company/:ticker`) with comprehensive stock overview
|
|
93
|
+
- Company name display on dashboard header with link to details page
|
|
94
|
+
- Full company profile including description, sector, industry, financials
|
|
95
|
+
- Analyst ratings display (Strong Buy/Buy/Hold/Sell/Strong Sell)
|
|
96
|
+
- Dividend information section
|
|
97
|
+
- Share information (outstanding, float, insider/institutional ownership)
|
|
98
|
+
|
|
99
|
+
### Fixed
|
|
100
|
+
- Market regime API now returns numeric `strength_score` and `trend_score` values
|
|
101
|
+
- Analysis page now displays regime data correctly
|
|
102
|
+
|
|
103
|
+
## [0.1.0] - 2025-11-22
|
|
104
|
+
|
|
105
|
+
### Added
|
|
106
|
+
- Initial release of SQA Demo Sinatra application
|
|
107
|
+
- Interactive stock dashboard with candlestick charts
|
|
108
|
+
- Technical indicators support:
|
|
109
|
+
- SMA (Simple Moving Average) with multiple periods
|
|
110
|
+
- EMA (Exponential Moving Average)
|
|
111
|
+
- Bollinger Bands
|
|
112
|
+
- RSI (Relative Strength Index)
|
|
113
|
+
- MACD (Moving Average Convergence Divergence)
|
|
114
|
+
- Stochastic Oscillator
|
|
115
|
+
- CCI (Commodity Channel Index)
|
|
116
|
+
- ADX (Average Directional Index)
|
|
117
|
+
- Volume indicators (OBV, Volume SMA)
|
|
118
|
+
- Candlestick pattern recognition:
|
|
119
|
+
- Doji patterns
|
|
120
|
+
- Hammer and Hanging Man
|
|
121
|
+
- Engulfing patterns (Bullish/Bearish)
|
|
122
|
+
- Morning Star and Evening Star
|
|
123
|
+
- Three White Soldiers and Three Black Crows
|
|
124
|
+
- Market analysis features:
|
|
125
|
+
- Market regime detection (Bull/Bear/Sideways)
|
|
126
|
+
- Seasonal pattern analysis
|
|
127
|
+
- FPOP (Future Period of Probability) analysis
|
|
128
|
+
- Risk metrics (VaR, Sharpe Ratio, Max Drawdown)
|
|
129
|
+
- Backtest functionality for trading strategies
|
|
130
|
+
- Portfolio optimizer page
|
|
131
|
+
- Responsive dark-themed UI with ApexCharts
|
|
132
|
+
- RESTful API endpoints for stock data and analysis
|
|
133
|
+
- Development hot-reloader support
|
|
134
|
+
- Startup script for easy deployment
|
|
135
|
+
|
|
136
|
+
[Unreleased]: https://github.com/madbomber/sqa_demo-sinatra/compare/v0.2.2...HEAD
|
|
137
|
+
[0.2.2]: https://github.com/madbomber/sqa_demo-sinatra/compare/v0.2.1...v0.2.2
|
|
138
|
+
[0.2.1]: https://github.com/madbomber/sqa_demo-sinatra/compare/v0.2.0...v0.2.1
|
|
139
|
+
[0.2.0]: https://github.com/madbomber/sqa_demo-sinatra/compare/v0.1.1...v0.2.0
|
|
140
|
+
[0.1.1]: https://github.com/madbomber/sqa_demo-sinatra/compare/v0.1.0...v0.1.1
|
|
141
|
+
[0.1.0]: https://github.com/madbomber/sqa_demo-sinatra/releases/tag/v0.1.0
|
data/README.md
CHANGED
|
@@ -194,6 +194,24 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/madbom
|
|
|
194
194
|
|
|
195
195
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
196
196
|
|
|
197
|
+
## To Do
|
|
198
|
+
|
|
199
|
+
### High Priority
|
|
200
|
+
- [ ] **Portfolio Optimization** - Implement Modern Portfolio Theory (MPT) with efficient frontier visualization
|
|
201
|
+
- [ ] **Expand Test Coverage** - Add unit tests for helper modules and integration tests for API endpoints
|
|
202
|
+
|
|
203
|
+
### Medium Priority
|
|
204
|
+
- [ ] **Watchlists** - User-defined stock watchlists with Redis persistence
|
|
205
|
+
- [ ] **Price Alerts** - Threshold-based alerts for price and technical indicators
|
|
206
|
+
- [ ] **Additional Strategies** - Implement more backtesting strategies from SQA library
|
|
207
|
+
- [ ] **Export Features** - Export charts as PNG/PDF and data as CSV/JSON
|
|
208
|
+
|
|
209
|
+
### Low Priority
|
|
210
|
+
- [ ] **Historical Strategy Comparison** - Compare strategy performance across different time periods
|
|
211
|
+
- [ ] **API Documentation Page** - Interactive API docs within the app
|
|
212
|
+
- [ ] **User Guide/Tutorial** - In-app walkthrough for new users
|
|
213
|
+
- [ ] **Custom Strategy Builder** - UI for creating user-defined strategies
|
|
214
|
+
|
|
197
215
|
## Disclaimer
|
|
198
216
|
|
|
199
217
|
This software is for educational and research purposes only. Do not use for actual trading without proper due diligence. The authors are not responsible for financial losses.
|