sqa 0.0.24 → 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 (203) hide show
  1. checksums.yaml +4 -4
  2. data/.goose/memory/development.txt +3 -0
  3. data/.semver +6 -0
  4. data/ARCHITECTURE.md +648 -0
  5. data/CHANGELOG.md +95 -0
  6. data/CLAUDE.md +674 -0
  7. data/COMMITS.md +196 -0
  8. data/DATAFRAME_ARCHITECTURE_REVIEW.md +421 -0
  9. data/NEXT-STEPS.md +154 -0
  10. data/README.md +839 -265
  11. data/TASKS.md +358 -0
  12. data/TEST_RESULTS.md +140 -0
  13. data/TODO.md +42 -0
  14. data/_notes.txt +25 -0
  15. data/bin/sqa-console +11 -0
  16. data/data/talk_talk.json +103284 -0
  17. data/develop_summary.md +313 -0
  18. data/docs/advanced/backtesting.md +206 -0
  19. data/docs/advanced/ensemble.md +68 -0
  20. data/docs/advanced/fpop.md +153 -0
  21. data/docs/advanced/index.md +112 -0
  22. data/docs/advanced/multi-timeframe.md +67 -0
  23. data/docs/advanced/pattern-matcher.md +75 -0
  24. data/docs/advanced/portfolio-optimizer.md +79 -0
  25. data/docs/advanced/portfolio.md +166 -0
  26. data/docs/advanced/risk-management.md +210 -0
  27. data/docs/advanced/strategy-generator.md +158 -0
  28. data/docs/advanced/streaming.md +209 -0
  29. data/docs/ai_and_ml.md +80 -0
  30. data/docs/api/dataframe.md +1114 -0
  31. data/docs/api/index.md +126 -0
  32. data/docs/assets/css/custom.css +88 -0
  33. data/docs/assets/images/sqa.jpg +0 -0
  34. data/docs/assets/js/mathjax.js +18 -0
  35. data/docs/concepts/index.md +60 -0
  36. data/docs/contributing/index.md +60 -0
  37. data/docs/data-sources/index.md +66 -0
  38. data/docs/data_frame.md +316 -97
  39. data/docs/factors_that_impact_price.md +26 -0
  40. data/docs/finviz.md +11 -0
  41. data/docs/fx_pro_bit.md +25 -0
  42. data/docs/genetic_programming.md +104 -0
  43. data/docs/getting-started/index.md +107 -0
  44. data/docs/getting-started/installation.md +229 -0
  45. data/docs/getting-started/quick-start.md +244 -0
  46. data/docs/i_gotta_an_idea.md +22 -0
  47. data/docs/index.md +161 -0
  48. data/docs/indicators/index.md +97 -0
  49. data/docs/indicators.md +110 -24
  50. data/docs/options.md +8 -0
  51. data/docs/strategies/bollinger-bands.md +146 -0
  52. data/docs/strategies/consensus.md +64 -0
  53. data/docs/strategies/custom.md +310 -0
  54. data/docs/strategies/ema.md +53 -0
  55. data/docs/strategies/index.md +92 -0
  56. data/docs/strategies/kbs.md +164 -0
  57. data/docs/strategies/macd.md +96 -0
  58. data/docs/strategies/market-profile.md +54 -0
  59. data/docs/strategies/mean-reversion.md +58 -0
  60. data/docs/strategies/rsi.md +95 -0
  61. data/docs/strategies/sma.md +55 -0
  62. data/docs/strategies/stochastic.md +63 -0
  63. data/docs/strategies/volume-breakout.md +54 -0
  64. data/docs/tags.md +7 -0
  65. data/examples/README.md +354 -0
  66. data/examples/advanced_features_example.rb +350 -0
  67. data/examples/fpop_analysis_example.rb +191 -0
  68. data/examples/genetic_programming_example.rb +148 -0
  69. data/examples/kbs_strategy_example.rb +208 -0
  70. data/examples/pattern_context_example.rb +300 -0
  71. data/examples/rails_app/Gemfile +34 -0
  72. data/examples/rails_app/README.md +416 -0
  73. data/examples/rails_app/app/assets/javascripts/application.js +107 -0
  74. data/examples/rails_app/app/assets/stylesheets/application.css +659 -0
  75. data/examples/rails_app/app/controllers/analysis_controller.rb +11 -0
  76. data/examples/rails_app/app/controllers/api/v1/stocks_controller.rb +227 -0
  77. data/examples/rails_app/app/controllers/application_controller.rb +22 -0
  78. data/examples/rails_app/app/controllers/backtest_controller.rb +11 -0
  79. data/examples/rails_app/app/controllers/dashboard_controller.rb +21 -0
  80. data/examples/rails_app/app/controllers/portfolio_controller.rb +7 -0
  81. data/examples/rails_app/app/views/analysis/show.html.erb +209 -0
  82. data/examples/rails_app/app/views/backtest/show.html.erb +171 -0
  83. data/examples/rails_app/app/views/dashboard/index.html.erb +118 -0
  84. data/examples/rails_app/app/views/dashboard/show.html.erb +408 -0
  85. data/examples/rails_app/app/views/errors/show.html.erb +17 -0
  86. data/examples/rails_app/app/views/layouts/application.html.erb +60 -0
  87. data/examples/rails_app/app/views/portfolio/index.html.erb +33 -0
  88. data/examples/rails_app/bin/rails +6 -0
  89. data/examples/rails_app/config/application.rb +45 -0
  90. data/examples/rails_app/config/boot.rb +5 -0
  91. data/examples/rails_app/config/database.yml +18 -0
  92. data/examples/rails_app/config/environment.rb +11 -0
  93. data/examples/rails_app/config/routes.rb +26 -0
  94. data/examples/rails_app/config.ru +8 -0
  95. data/examples/realtime_stream_example.rb +274 -0
  96. data/examples/sinatra_app/Gemfile +42 -0
  97. data/examples/sinatra_app/Gemfile.lock +268 -0
  98. data/examples/sinatra_app/QUICKSTART.md +169 -0
  99. data/examples/sinatra_app/README.md +471 -0
  100. data/examples/sinatra_app/RUNNING_WITHOUT_TALIB.md +90 -0
  101. data/examples/sinatra_app/TROUBLESHOOTING.md +95 -0
  102. data/examples/sinatra_app/app.rb +404 -0
  103. data/examples/sinatra_app/config.ru +5 -0
  104. data/examples/sinatra_app/public/css/style.css +723 -0
  105. data/examples/sinatra_app/public/debug_macd.html +82 -0
  106. data/examples/sinatra_app/public/js/app.js +107 -0
  107. data/examples/sinatra_app/start.sh +53 -0
  108. data/examples/sinatra_app/views/analyze.erb +306 -0
  109. data/examples/sinatra_app/views/backtest.erb +325 -0
  110. data/examples/sinatra_app/views/dashboard.erb +831 -0
  111. data/examples/sinatra_app/views/error.erb +58 -0
  112. data/examples/sinatra_app/views/index.erb +118 -0
  113. data/examples/sinatra_app/views/layout.erb +61 -0
  114. data/examples/sinatra_app/views/portfolio.erb +43 -0
  115. data/examples/strategy_generator_example.rb +346 -0
  116. data/hsa_portfolio.csv +11 -0
  117. data/justfile +0 -0
  118. data/lib/api/alpha_vantage_api.rb +462 -0
  119. data/lib/sqa/backtest.rb +329 -0
  120. data/lib/sqa/data_frame/alpha_vantage.rb +51 -63
  121. data/lib/sqa/data_frame/data.rb +92 -0
  122. data/lib/sqa/data_frame/yahoo_finance.rb +35 -43
  123. data/lib/sqa/data_frame.rb +154 -243
  124. data/lib/sqa/ensemble.rb +359 -0
  125. data/lib/sqa/fpop.rb +199 -0
  126. data/lib/sqa/gp.rb +259 -0
  127. data/lib/sqa/indicator.rb +16 -6
  128. data/lib/sqa/init.rb +15 -8
  129. data/lib/sqa/market_regime.rb +240 -0
  130. data/lib/sqa/multi_timeframe.rb +379 -0
  131. data/lib/sqa/pattern_matcher.rb +497 -0
  132. data/lib/sqa/portfolio.rb +260 -6
  133. data/lib/sqa/portfolio_optimizer.rb +377 -0
  134. data/lib/sqa/risk_manager.rb +442 -0
  135. data/lib/sqa/seasonal_analyzer.rb +209 -0
  136. data/lib/sqa/sector_analyzer.rb +300 -0
  137. data/lib/sqa/stock.rb +131 -127
  138. data/lib/sqa/strategy/bollinger_bands.rb +42 -0
  139. data/lib/sqa/strategy/consensus.rb +5 -2
  140. data/lib/sqa/strategy/kbs_strategy.rb +470 -0
  141. data/lib/sqa/strategy/macd.rb +46 -0
  142. data/lib/sqa/strategy/mp.rb +1 -1
  143. data/lib/sqa/strategy/stochastic.rb +60 -0
  144. data/lib/sqa/strategy/volume_breakout.rb +57 -0
  145. data/lib/sqa/strategy.rb +5 -0
  146. data/lib/sqa/strategy_generator.rb +947 -0
  147. data/lib/sqa/stream.rb +361 -0
  148. data/lib/sqa/ticker.rb +9 -2
  149. data/lib/sqa/version.rb +1 -7
  150. data/lib/sqa.rb +35 -20
  151. data/main.just +81 -0
  152. data/mkdocs.yml +252 -0
  153. data/trace.log +0 -0
  154. metadata +265 -69
  155. data/bin/sqa +0 -6
  156. data/docs/alpha_vantage_technical_indicators.md +0 -62
  157. data/docs/average_true_range.md +0 -9
  158. data/docs/bollinger_bands.md +0 -15
  159. data/docs/candlestick_pattern_recognizer.md +0 -4
  160. data/docs/donchian_channel.md +0 -5
  161. data/docs/double_top_bottom_pattern.md +0 -3
  162. data/docs/exponential_moving_average.md +0 -19
  163. data/docs/fibonacci_retracement.md +0 -30
  164. data/docs/head_and_shoulders_pattern.md +0 -3
  165. data/docs/market_profile.md +0 -4
  166. data/docs/momentum.md +0 -19
  167. data/docs/moving_average_convergence_divergence.md +0 -23
  168. data/docs/peaks_and_valleys.md +0 -11
  169. data/docs/relative_strength_index.md +0 -6
  170. data/docs/simple_moving_average.md +0 -8
  171. data/docs/stochastic_oscillator.md +0 -4
  172. data/docs/ta_lib.md +0 -160
  173. data/docs/true_range.md +0 -12
  174. data/lib/patches/dry-cli.rb +0 -228
  175. data/lib/sqa/activity.rb +0 -10
  176. data/lib/sqa/cli.rb +0 -62
  177. data/lib/sqa/commands/analysis.rb +0 -309
  178. data/lib/sqa/commands/base.rb +0 -139
  179. data/lib/sqa/commands/web.rb +0 -199
  180. data/lib/sqa/commands.rb +0 -22
  181. data/lib/sqa/constants.rb +0 -23
  182. data/lib/sqa/indicator/average_true_range.rb +0 -33
  183. data/lib/sqa/indicator/bollinger_bands.rb +0 -28
  184. data/lib/sqa/indicator/candlestick_pattern_recognizer.rb +0 -60
  185. data/lib/sqa/indicator/donchian_channel.rb +0 -29
  186. data/lib/sqa/indicator/double_top_bottom_pattern.rb +0 -34
  187. data/lib/sqa/indicator/elliott_wave_theory.rb +0 -57
  188. data/lib/sqa/indicator/exponential_moving_average.rb +0 -25
  189. data/lib/sqa/indicator/exponential_moving_average_trend.rb +0 -36
  190. data/lib/sqa/indicator/fibonacci_retracement.rb +0 -23
  191. data/lib/sqa/indicator/head_and_shoulders_pattern.rb +0 -26
  192. data/lib/sqa/indicator/market_profile.rb +0 -32
  193. data/lib/sqa/indicator/mean_reversion.rb +0 -37
  194. data/lib/sqa/indicator/momentum.rb +0 -28
  195. data/lib/sqa/indicator/moving_average_convergence_divergence.rb +0 -29
  196. data/lib/sqa/indicator/peaks_and_valleys.rb +0 -29
  197. data/lib/sqa/indicator/predict_next_value.rb +0 -202
  198. data/lib/sqa/indicator/relative_strength_index.rb +0 -47
  199. data/lib/sqa/indicator/simple_moving_average.rb +0 -24
  200. data/lib/sqa/indicator/simple_moving_average_trend.rb +0 -32
  201. data/lib/sqa/indicator/stochastic_oscillator.rb +0 -68
  202. data/lib/sqa/indicator/true_range.rb +0 -39
  203. data/lib/sqa/trade.rb +0 -26
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24
4
+ version: 0.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-11-08 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: alphavantage
@@ -25,7 +24,7 @@ dependencies:
25
24
  - !ruby/object:Gem::Version
26
25
  version: '0'
27
26
  - !ruby/object:Gem::Dependency
28
- name: api_key_manager
27
+ name: csv
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ">="
@@ -39,7 +38,7 @@ dependencies:
39
38
  - !ruby/object:Gem::Version
40
39
  version: '0'
41
40
  - !ruby/object:Gem::Dependency
42
- name: dry-cli
41
+ name: faraday
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - ">="
@@ -53,7 +52,7 @@ dependencies:
53
52
  - !ruby/object:Gem::Version
54
53
  version: '0'
55
54
  - !ruby/object:Gem::Dependency
56
- name: faraday
55
+ name: hashie
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - ">="
@@ -67,19 +66,19 @@ dependencies:
67
66
  - !ruby/object:Gem::Version
68
67
  version: '0'
69
68
  - !ruby/object:Gem::Dependency
70
- name: hashie
69
+ name: kbs
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
- - - "~>"
72
+ - - ">="
74
73
  - !ruby/object:Gem::Version
75
- version: 4.1.0
74
+ version: '0'
76
75
  type: :runtime
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
- - - "~>"
79
+ - - ">="
81
80
  - !ruby/object:Gem::Version
82
- version: 4.1.0
81
+ version: '0'
83
82
  - !ruby/object:Gem::Dependency
84
83
  name: lite-statistics
85
84
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +108,63 @@ dependencies:
109
108
  - !ruby/object:Gem::Version
110
109
  version: '0'
111
110
  - !ruby/object:Gem::Dependency
112
- name: sem_version
111
+ name: redis
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ type: :runtime
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ - !ruby/object:Gem::Dependency
125
+ name: ruby_llm
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ type: :runtime
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ - !ruby/object:Gem::Dependency
139
+ name: ruby_llm-mcp
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ type: :runtime
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ - !ruby/object:Gem::Dependency
153
+ name: shared_tools
154
+ requirement: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ type: :runtime
160
+ prerelease: false
161
+ version_requirements: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ - !ruby/object:Gem::Dependency
167
+ name: sqa-tai
113
168
  requirement: !ruby/object:Gem::Requirement
114
169
  requirements:
115
170
  - - ">="
@@ -136,6 +191,62 @@ dependencies:
136
191
  - - ">="
137
192
  - !ruby/object:Gem::Version
138
193
  version: '0'
194
+ - !ruby/object:Gem::Dependency
195
+ name: eps
196
+ requirement: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: '0'
201
+ type: :runtime
202
+ prerelease: false
203
+ version_requirements: !ruby/object:Gem::Requirement
204
+ requirements:
205
+ - - ">="
206
+ - !ruby/object:Gem::Version
207
+ version: '0'
208
+ - !ruby/object:Gem::Dependency
209
+ name: polars-df
210
+ requirement: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ version: '0'
215
+ type: :runtime
216
+ prerelease: false
217
+ version_requirements: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - ">="
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
222
+ - !ruby/object:Gem::Dependency
223
+ name: toml-rb
224
+ requirement: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - ">="
227
+ - !ruby/object:Gem::Version
228
+ version: '0'
229
+ type: :runtime
230
+ prerelease: false
231
+ version_requirements: !ruby/object:Gem::Requirement
232
+ requirements:
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ version: '0'
236
+ - !ruby/object:Gem::Dependency
237
+ name: regent
238
+ requirement: !ruby/object:Gem::Requirement
239
+ requirements:
240
+ - - ">="
241
+ - !ruby/object:Gem::Version
242
+ version: '0'
243
+ type: :runtime
244
+ prerelease: false
245
+ version_requirements: !ruby/object:Gem::Requirement
246
+ requirements:
247
+ - - ">="
248
+ - !ruby/object:Gem::Version
249
+ version: '0'
139
250
  - !ruby/object:Gem::Dependency
140
251
  name: amazing_print
141
252
  requirement: !ruby/object:Gem::Requirement
@@ -234,22 +345,34 @@ dependencies:
234
345
  - - ">="
235
346
  - !ruby/object:Gem::Version
236
347
  version: '0'
237
- description: Simplistic playpen (e.g. not for serious use) for doing technical analysis
238
- of stock prices.
348
+ description: |
349
+ Simplistic playpen (e.g. not for serious use) for doing
350
+ technical analysis of stock prices. Under Construction.
239
351
  email:
240
352
  - dvanhoozer@gmail.com
241
353
  executables:
242
- - sqa
354
+ - sqa-console
243
355
  extensions: []
244
356
  extra_rdoc_files: []
245
357
  files:
246
358
  - ".config/tocer/configuration.yml"
247
359
  - ".envrc"
360
+ - ".goose/memory/development.txt"
361
+ - ".semver"
362
+ - ARCHITECTURE.md
248
363
  - CHANGELOG.md
364
+ - CLAUDE.md
365
+ - COMMITS.md
366
+ - DATAFRAME_ARCHITECTURE_REVIEW.md
249
367
  - LICENSE
368
+ - NEXT-STEPS.md
250
369
  - README.md
251
370
  - Rakefile
252
- - bin/sqa
371
+ - TASKS.md
372
+ - TEST_RESULTS.md
373
+ - TODO.md
374
+ - _notes.txt
375
+ - bin/sqa-console
253
376
  - checksums/sqa-0.0.1.gem.sha512
254
377
  - checksums/sqa-0.0.10.gem.sha512
255
378
  - checksums/sqa-0.0.11.gem.sha512
@@ -272,90 +395,165 @@ files:
272
395
  - checksums/sqa-0.0.7.gem.sha512
273
396
  - checksums/sqa-0.0.8.gem.sha512
274
397
  - checksums/sqa-0.0.9.gem.sha512
398
+ - data/talk_talk.json
399
+ - develop_summary.md
275
400
  - docs/.gitignore
276
401
  - docs/README.md
277
- - docs/alpha_vantage_technical_indicators.md
278
- - docs/average_true_range.md
279
- - docs/bollinger_bands.md
280
- - docs/candlestick_pattern_recognizer.md
402
+ - docs/advanced/backtesting.md
403
+ - docs/advanced/ensemble.md
404
+ - docs/advanced/fpop.md
405
+ - docs/advanced/index.md
406
+ - docs/advanced/multi-timeframe.md
407
+ - docs/advanced/pattern-matcher.md
408
+ - docs/advanced/portfolio-optimizer.md
409
+ - docs/advanced/portfolio.md
410
+ - docs/advanced/risk-management.md
411
+ - docs/advanced/strategy-generator.md
412
+ - docs/advanced/streaming.md
413
+ - docs/ai_and_ml.md
414
+ - docs/api/dataframe.md
415
+ - docs/api/index.md
416
+ - docs/assets/css/custom.css
417
+ - docs/assets/images/sqa.jpg
418
+ - docs/assets/js/mathjax.js
419
+ - docs/concepts/index.md
420
+ - docs/contributing/index.md
421
+ - docs/data-sources/index.md
281
422
  - docs/data_frame.md
282
- - docs/donchian_channel.md
283
- - docs/double_top_bottom_pattern.md
284
- - docs/exponential_moving_average.md
285
- - docs/fibonacci_retracement.md
286
- - docs/head_and_shoulders_pattern.md
423
+ - docs/factors_that_impact_price.md
424
+ - docs/finviz.md
425
+ - docs/fx_pro_bit.md
426
+ - docs/genetic_programming.md
427
+ - docs/getting-started/index.md
428
+ - docs/getting-started/installation.md
429
+ - docs/getting-started/quick-start.md
430
+ - docs/i_gotta_an_idea.md
287
431
  - docs/identify_wave_condition.md
432
+ - docs/index.md
288
433
  - docs/indicators.md
434
+ - docs/indicators/index.md
289
435
  - docs/libsvm_file_format.md
290
- - docs/market_profile.md
291
436
  - docs/mean_reversion.md
292
- - docs/momentum.md
293
- - docs/moving_average_convergence_divergence.md
294
- - docs/peaks_and_valleys.md
437
+ - docs/options.md
295
438
  - docs/predict_next_value.md
296
- - docs/relative_strength_index.md
297
439
  - docs/requirements.md
298
- - docs/simple_moving_average.md
299
- - docs/stochastic_oscillator.md
440
+ - docs/strategies/bollinger-bands.md
441
+ - docs/strategies/consensus.md
442
+ - docs/strategies/custom.md
443
+ - docs/strategies/ema.md
444
+ - docs/strategies/index.md
445
+ - docs/strategies/kbs.md
446
+ - docs/strategies/macd.md
447
+ - docs/strategies/market-profile.md
448
+ - docs/strategies/mean-reversion.md
449
+ - docs/strategies/rsi.md
450
+ - docs/strategies/sma.md
451
+ - docs/strategies/stochastic.md
452
+ - docs/strategies/volume-breakout.md
300
453
  - docs/strategy.md
301
- - docs/ta_lib.md
454
+ - docs/tags.md
302
455
  - docs/terms_of_use.md
303
- - docs/true_range.md
304
- - lib/patches/dry-cli.rb
456
+ - examples/README.md
457
+ - examples/advanced_features_example.rb
458
+ - examples/fpop_analysis_example.rb
459
+ - examples/genetic_programming_example.rb
460
+ - examples/kbs_strategy_example.rb
461
+ - examples/pattern_context_example.rb
462
+ - examples/rails_app/Gemfile
463
+ - examples/rails_app/README.md
464
+ - examples/rails_app/app/assets/javascripts/application.js
465
+ - examples/rails_app/app/assets/stylesheets/application.css
466
+ - examples/rails_app/app/controllers/analysis_controller.rb
467
+ - examples/rails_app/app/controllers/api/v1/stocks_controller.rb
468
+ - examples/rails_app/app/controllers/application_controller.rb
469
+ - examples/rails_app/app/controllers/backtest_controller.rb
470
+ - examples/rails_app/app/controllers/dashboard_controller.rb
471
+ - examples/rails_app/app/controllers/portfolio_controller.rb
472
+ - examples/rails_app/app/views/analysis/show.html.erb
473
+ - examples/rails_app/app/views/backtest/show.html.erb
474
+ - examples/rails_app/app/views/dashboard/index.html.erb
475
+ - examples/rails_app/app/views/dashboard/show.html.erb
476
+ - examples/rails_app/app/views/errors/show.html.erb
477
+ - examples/rails_app/app/views/layouts/application.html.erb
478
+ - examples/rails_app/app/views/portfolio/index.html.erb
479
+ - examples/rails_app/bin/rails
480
+ - examples/rails_app/config.ru
481
+ - examples/rails_app/config/application.rb
482
+ - examples/rails_app/config/boot.rb
483
+ - examples/rails_app/config/database.yml
484
+ - examples/rails_app/config/environment.rb
485
+ - examples/rails_app/config/routes.rb
486
+ - examples/realtime_stream_example.rb
487
+ - examples/sinatra_app/Gemfile
488
+ - examples/sinatra_app/Gemfile.lock
489
+ - examples/sinatra_app/QUICKSTART.md
490
+ - examples/sinatra_app/README.md
491
+ - examples/sinatra_app/RUNNING_WITHOUT_TALIB.md
492
+ - examples/sinatra_app/TROUBLESHOOTING.md
493
+ - examples/sinatra_app/app.rb
494
+ - examples/sinatra_app/config.ru
495
+ - examples/sinatra_app/public/css/style.css
496
+ - examples/sinatra_app/public/debug_macd.html
497
+ - examples/sinatra_app/public/js/app.js
498
+ - examples/sinatra_app/start.sh
499
+ - examples/sinatra_app/views/analyze.erb
500
+ - examples/sinatra_app/views/backtest.erb
501
+ - examples/sinatra_app/views/dashboard.erb
502
+ - examples/sinatra_app/views/error.erb
503
+ - examples/sinatra_app/views/index.erb
504
+ - examples/sinatra_app/views/layout.erb
505
+ - examples/sinatra_app/views/portfolio.erb
506
+ - examples/strategy_generator_example.rb
507
+ - hsa_portfolio.csv
508
+ - justfile
509
+ - lib/api/alpha_vantage_api.rb
305
510
  - lib/patches/string.rb
306
511
  - lib/sqa.rb
307
- - lib/sqa/activity.rb
308
- - lib/sqa/cli.rb
309
- - lib/sqa/commands.rb
310
- - lib/sqa/commands/analysis.rb
311
- - lib/sqa/commands/base.rb
312
- - lib/sqa/commands/web.rb
512
+ - lib/sqa/backtest.rb
313
513
  - lib/sqa/config.rb
314
- - lib/sqa/constants.rb
315
514
  - lib/sqa/data_frame.rb
316
515
  - lib/sqa/data_frame/alpha_vantage.rb
516
+ - lib/sqa/data_frame/data.rb
317
517
  - lib/sqa/data_frame/yahoo_finance.rb
518
+ - lib/sqa/ensemble.rb
318
519
  - lib/sqa/errors.rb
520
+ - lib/sqa/fpop.rb
521
+ - lib/sqa/gp.rb
319
522
  - lib/sqa/indicator.rb
320
- - lib/sqa/indicator/average_true_range.rb
321
- - lib/sqa/indicator/bollinger_bands.rb
322
- - lib/sqa/indicator/candlestick_pattern_recognizer.rb
323
- - lib/sqa/indicator/donchian_channel.rb
324
- - lib/sqa/indicator/double_top_bottom_pattern.rb
325
- - lib/sqa/indicator/elliott_wave_theory.rb
326
- - lib/sqa/indicator/exponential_moving_average.rb
327
- - lib/sqa/indicator/exponential_moving_average_trend.rb
328
- - lib/sqa/indicator/fibonacci_retracement.rb
329
- - lib/sqa/indicator/head_and_shoulders_pattern.rb
330
- - lib/sqa/indicator/market_profile.rb
331
- - lib/sqa/indicator/mean_reversion.rb
332
- - lib/sqa/indicator/momentum.rb
333
- - lib/sqa/indicator/moving_average_convergence_divergence.rb
334
- - lib/sqa/indicator/peaks_and_valleys.rb
335
- - lib/sqa/indicator/predict_next_value.rb
336
- - lib/sqa/indicator/relative_strength_index.rb
337
- - lib/sqa/indicator/simple_moving_average.rb
338
- - lib/sqa/indicator/simple_moving_average_trend.rb
339
- - lib/sqa/indicator/stochastic_oscillator.rb
340
- - lib/sqa/indicator/true_range.rb
341
523
  - lib/sqa/init.rb
524
+ - lib/sqa/market_regime.rb
525
+ - lib/sqa/multi_timeframe.rb
526
+ - lib/sqa/pattern_matcher.rb
342
527
  - lib/sqa/plugin_manager.rb
343
528
  - lib/sqa/portfolio.rb
529
+ - lib/sqa/portfolio_optimizer.rb
530
+ - lib/sqa/risk_manager.rb
531
+ - lib/sqa/seasonal_analyzer.rb
532
+ - lib/sqa/sector_analyzer.rb
344
533
  - lib/sqa/stock.rb
345
534
  - lib/sqa/strategy.rb
346
535
  - lib/sqa/strategy/README.md
536
+ - lib/sqa/strategy/bollinger_bands.rb
347
537
  - lib/sqa/strategy/common.rb
348
538
  - lib/sqa/strategy/consensus.rb
349
539
  - lib/sqa/strategy/ema.rb
540
+ - lib/sqa/strategy/kbs_strategy.rb
541
+ - lib/sqa/strategy/macd.rb
350
542
  - lib/sqa/strategy/mp.rb
351
543
  - lib/sqa/strategy/mr.rb
352
544
  - lib/sqa/strategy/random.md
353
545
  - lib/sqa/strategy/random.rb
354
546
  - lib/sqa/strategy/rsi.rb
355
547
  - lib/sqa/strategy/sma.rb
548
+ - lib/sqa/strategy/stochastic.rb
549
+ - lib/sqa/strategy/volume_breakout.rb
550
+ - lib/sqa/strategy_generator.rb
551
+ - lib/sqa/stream.rb
356
552
  - lib/sqa/ticker.rb
357
- - lib/sqa/trade.rb
358
553
  - lib/sqa/version.rb
554
+ - main.just
555
+ - mkdocs.yml
556
+ - trace.log
359
557
  homepage: https://github.com/MadBomber/sqa
360
558
  licenses:
361
559
  - MIT
@@ -364,7 +562,6 @@ metadata:
364
562
  homepage_uri: https://github.com/MadBomber/sqa
365
563
  source_code_uri: https://github.com/MadBomber/sqa
366
564
  changelog_uri: https://github.com/MadBomber/sqa
367
- post_install_message:
368
565
  rdoc_options: []
369
566
  require_paths:
370
567
  - lib
@@ -372,15 +569,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
372
569
  requirements:
373
570
  - - ">="
374
571
  - !ruby/object:Gem::Version
375
- version: '2.7'
572
+ version: '3.2'
376
573
  required_rubygems_version: !ruby/object:Gem::Requirement
377
574
  requirements:
378
575
  - - ">="
379
576
  - !ruby/object:Gem::Version
380
577
  version: '0'
381
578
  requirements: []
382
- rubygems_version: 3.4.21
383
- signing_key:
579
+ rubygems_version: 3.7.2
384
580
  specification_version: 4
385
- summary: sqa - Stock Qualitative Analysis
581
+ summary: sqa - Simple Qualitative Analysis
386
582
  test_files: []
data/bin/sqa DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'sqa'
4
- require 'sqa/cli'
5
-
6
- SQA.init
@@ -1,62 +0,0 @@
1
- # Alpha Vantage
2
- ## Technical Indicators
3
-
4
- The following technical indicators are available from Alpha Vantage
5
- using a free API key.
6
-
7
- | Acronym | Indicator Description |
8
- |-----------|----------------------------------------------------------|
9
- | AD | Accumulation/Distribution |
10
- | ADOSC | Accumulation/Distribution Oscillator |
11
- | ADX | Average Directional Index |
12
- | ADXR | Average Directional Movement Rating |
13
- | APO | Absolute Price Oscillator |
14
- | AROON | Aroon Indicator |
15
- | AROONOSC | Aroon Oscillator |
16
- | ATR | Average True Range |
17
- | BBANDS | Bollinger Bands |
18
- | BOP | Balance of Power |
19
- | CCI | Commodity Channel Index |
20
- | CMO | Chande Momentum Oscillator |
21
- | DEMA | Double Exponential Moving Average |
22
- | DX | Directional Movement Index |
23
- | EMA | Exponential Moving Average |
24
- | HT_DCPERIOD | Hilbert Transform - Dominant Cycle Period |
25
- | HT_DCPHASE | Hilbert Transform - Dominant Cycle Phase |
26
- | HT_PHASOR | Hilbert Transform - Phasor Components |
27
- | HT_SINE | Hilbert Transform - SineWave |
28
- | HT_TRENDLINE | Hilbert Transform - Instantaneous Trendline |
29
- | HT_TRENDMODE | Hilbert Transform - Trend vs Cycle Mode |
30
- | KAMA | Kaufman Adaptive Moving Average |
31
- | MACD | Moving Average Convergence Divergence |
32
- | MACDEXT | MACD with controllable MA type |
33
- | MAMA | MESA Adaptive Moving Average |
34
- | MFI | Money Flow Index |
35
- | MIDPOINT | MidPoint over period |
36
- | MIDPRICE | Midpoint Price over period |
37
- | MINUS_DI | Minus Directional Indicator |
38
- | MINUS_DM | Minus Directional Movement |
39
- | MOM | Momentum |
40
- | NATR | Normalized Average True Range |
41
- | OBV | On Balance Volume |
42
- | PLUS_DI | Plus Directional Indicator |
43
- | PLUS_DM | Plus Directional Movement |
44
- | PPO | Percentage Price Oscillator |
45
- | ROC | Rate of Change |
46
- | ROCR | Rate of Change Ratio |
47
- | RSI | Relative Strength Index |
48
- | SAR | Parabolic SAR |
49
- | SMA | Simple Moving Average |
50
- | STOCH | Stochastic Oscillator |
51
- | STOCHF | Stochastic Fast |
52
- | STOCHRSI | Stochastic Relative Strength Index |
53
- | T3 | Triple Exponential Moving Average (T3) |
54
- | TEMA | Triple Exponential Moving Average |
55
- | TRANGE | True Range |
56
- | TRIMA | Triangular Moving Average |
57
- | TRIX | 1-day Rate of Change of a Triple Smooth EMA |
58
- | ULTOSC | Ultimate Oscillator |
59
- | VWAP | Volume Weighted Average Price |
60
- | WILLR | Williams' %R |
61
- | WMA | Weighted Moving Average |
62
-
@@ -1,9 +0,0 @@
1
- # Average True Range (ATR)
2
-
3
- See: https://www.fidelity.com/learning-center/trading-investing/technical-analysis/technical-indicator-guide/atr
4
-
5
- The ATR is an indicator that calculates the average of the True Range values over a specified period. It provides a measure of the average volatility of a security over that period.
6
-
7
- The ATR is commonly used to assess the volatility of a security, identify potential trend reversals, and determine appropriate stop-loss levels. Higher ATR values indicate higher volatility, while lower ATR values indicate lower volatility.
8
-
9
- For example, a 14-day ATR would calculate the average of the True Range values over the past 14 trading days. Traders and analysts may use this indicator to set stop-loss levels based on the average volatility of the security.
@@ -1,15 +0,0 @@
1
-
2
-
3
- # Bollinger Bands
4
-
5
- This method takes in an array of historical prices for a stock, a period (the number of days to calculate the moving average and standard deviation over), and the number of standard deviations to use for the upper and lower Bollinger Bands. It uses the `moving_averages` method to calculate the moving average for the given period, and then calculates the standard deviation of the closing prices for each window of the given period. Finally, it calculates the upper and lower Bollinger Bands based on the moving average and standard deviation, and returns an array containing the upper and lower bands.
6
-
7
- The `num_std_dev` parameter in the Bollinger Bands method specifies the number of standard deviations to use for the upper and lower bands. The default value for this parameter can depend on the specific security being analyzed and the time period being used.
8
-
9
- A common default value for `num_std_dev` is 2, which corresponds to the standard deviation of the price data over the given time period. Using a value of 2 for `num_std_dev` will result in the upper and lower bands being placed at a distance of two standard deviations from the moving average.
10
-
11
- However, the optimal value for `num_std_dev` can vary depending on the volatility of the security being analyzed. For highly volatile securities, a larger value for `num_std_dev` may be more appropriate, while for less volatile securities, a smaller value may be more appropriate.
12
-
13
- Ultimately, the best default value for `num_std_dev` will depend on the specific use case and should be chosen based on the characteristics of the security being analyzed and the preferences of the analyst.
14
-
15
- The difference between the upper and lower bands can be an indicator of how volatile the stock is.
@@ -1,4 +0,0 @@
1
- # Candlestick Chart Pattern
2
-
3
- Recognizes common candlestick chart patterns in the given price data.
4
-
@@ -1,5 +0,0 @@
1
- # Donchian Channel
2
-
3
- In the domain of computer programming, a Donchian Channel is a technical analysis indicator used to identify potential breakouts and trend reversals in financial markets. It consists of three lines: the upper channel line, the lower channel line, and the middle line.
4
-
5
- The upper channel line is calculated by finding the highest high over a specified period of time, while the lower channel line is calculated by finding the lowest low over the same period. The middle line is simply the average of the upper and lower channel lines.
@@ -1,3 +0,0 @@
1
- # Double Top Double Bottom Pattern
2
-
3
- Checks if a "double top" or "double bottom" pattern is present in the given price data.
@@ -1,19 +0,0 @@
1
- # Exponential Moving Average (EMA)
2
-
3
- In financial analysis, the Exponential Moving Average (EMA) is a commonly used technical indicator that helps identify trends and smooth out price data. It is a type of moving average that gives more weight to recent prices, making it more responsive to recent price changes compared to other moving averages.
4
-
5
- The EMA is calculated by applying a smoothing factor (often represented as a percentage) to the previous EMA value and adding a weighted average of the current price. The smoothing factor determines the weight given to the most recent price data, with higher values giving more weight to recent prices.
6
-
7
- The EMA is used for various purposes in financial analysis, including:
8
-
9
- 1. Trend Identification: The EMA is often used to identify the direction and strength of a trend. When the current price is above the EMA, it suggests an uptrend, while a price below the EMA suggests a downtrend. Traders and investors may use the EMA crossover (when the price crosses above or below the EMA) as a signal to enter or exit positions.
10
-
11
- 2. Support and Resistance Levels: The EMA can act as dynamic support or resistance levels. In an uptrend, the EMA may provide support, and in a downtrend, it may act as resistance. Traders may use the EMA as a reference point for setting stop-loss orders or profit targets.
12
-
13
- 3. Price Reversals: The EMA can help identify potential price reversals. When the price deviates significantly from the EMA, it may indicate an overbought or oversold condition, suggesting a potential reversal in the near future. Traders may use this information to anticipate price reversals and adjust their trading strategies accordingly.
14
-
15
- 4. Volatility Assessment: The EMA can be used to assess market volatility. When the EMA is relatively flat, it suggests low volatility, while a steeply sloping EMA indicates higher volatility. Traders may adjust their trading strategies based on the level of volatility indicated by the EMA.
16
-
17
- It's important to note that the EMA is just one of many technical indicators used in financial analysis. It is often used in combination with other indicators, such as the Simple Moving Average (SMA), to gain a more comprehensive understanding of market trends and price movements.
18
-
19
- Traders and investors should consider their own trading strategies, risk tolerance, and timeframes when using the EMA or any other technical indicator for financial analysis. It's also recommended to backtest and validate any trading strategies before applying them in real-time trading.
@@ -1,30 +0,0 @@
1
- # Fibonacci Retracement
2
-
3
- Fibonacci retracement is a popular technical analysis tool used to identify potential levels of support and resistance in a financial market. It is based on the theory that markets tend to move in a series of retracements and expansions, which follow a specific mathematical ratio derived from the Fibonacci sequence.
4
-
5
- ### How it's Used
6
-
7
- Traders and analysts use Fibonacci retracement levels to determine potential areas where the price of an asset may reverse or continue its existing trend. The most commonly used Fibonacci retracement levels are 23.6%, 38.2%, 50%, 61.8%, and 78.6%.
8
-
9
- When a market is trending, a trader would plot the Fibonacci retracement levels on the chart to identify potential areas where the price may pull back and find support (in an uptrend) or resistance (in a downtrend).
10
-
11
- If the price retraces to one of these levels and finds support or resistance, it can be seen as an opportunity to enter a trade in the direction of the prevailing trend. Traders often use other technical analysis tools, such as trend lines, moving averages, or candlestick patterns, in combination with Fibonacci retracement to confirm potential trade setups.
12
-
13
- ### How it's Calculated
14
-
15
- The calculation of Fibonacci retracement levels involves using the Fibonacci ratio of 0.236, 0.382, 0.500, 0.618, and 0.786.
16
-
17
- To plot Fibonacci retracement levels, two points on a chart are required: a swing high and a swing low. A swing high is a peak in an uptrend, while a swing low is a trough in a downtrend.
18
-
19
- The retracement levels are calculated by subtracting the percentage ratios (23.6%, 38.2%, etc.) from the difference between the swing high and the swing low. The resulting levels are then plotted on the chart.
20
-
21
- For example, to calculate the 38.2% retracement level, the formula would be:
22
-
23
- ```
24
- Retracement Level = (Swing High - Swing Low) * 0.382 + Swing Low
25
- ```
26
-
27
- Traders commonly use charting software or online tools that automatically calculate and plot Fibonacci retracement levels. This makes it easier for traders to visualize and analyze potential trading opportunities based on these levels.
28
-
29
- Overall, Fibonacci retracement is a valuable technical analysis technique that can assist traders in identifying key support and resistance levels in a trending market. By understanding and correctly utilizing this tool, traders can enhance their decision-making process and potentially improve their trading outcomes.
30
-
@@ -1,3 +0,0 @@
1
- # Head and Shoulders Pattern
2
-
3
- Checks if a "head and shoulders" pattern is present in the given price data.
@@ -1,4 +0,0 @@
1
- # Market Profile Analysis
2
-
3
- Market profile analysis involves studying the distribution of trading volume and price levels over time. It helps identify areas of support and resistance and provides insights into market sentiment.
4
-