sqa 0.0.31 → 0.0.37
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 +104 -0
- data/CLAUDE.md +21 -0
- data/README.md +60 -32
- data/Rakefile +52 -10
- data/docs/IMPROVEMENT_PLAN.md +531 -0
- data/docs/advanced/index.md +1 -13
- data/docs/api/dataframe.md +0 -1
- data/docs/api/index.md +547 -61
- data/docs/api-reference/alphavantageapi.md +1057 -0
- data/docs/api-reference/apierror.md +31 -0
- data/docs/api-reference/index.md +221 -0
- data/docs/api-reference/notimplemented.md +27 -0
- data/docs/api-reference/sqa.md +267 -0
- data/docs/api-reference/sqa_backtest.md +137 -0
- data/docs/api-reference/sqa_backtest_results.md +530 -0
- data/docs/api-reference/sqa_badparametererror.md +13 -0
- data/docs/api-reference/sqa_config.md +538 -0
- data/docs/api-reference/sqa_configurationerror.md +13 -0
- data/docs/api-reference/sqa_datafetcherror.md +56 -0
- data/docs/api-reference/sqa_dataframe.md +752 -0
- data/docs/api-reference/sqa_dataframe_alphavantage.md +30 -0
- data/docs/api-reference/sqa_dataframe_data.md +325 -0
- data/docs/api-reference/sqa_dataframe_yahoofinance.md +25 -0
- data/docs/api-reference/sqa_ensemble.md +413 -0
- data/docs/api-reference/sqa_fpop.md +211 -0
- data/docs/api-reference/sqa_geneticprogram.md +325 -0
- data/docs/api-reference/sqa_geneticprogram_individual.md +114 -0
- data/docs/api-reference/sqa_marketregime.md +212 -0
- data/docs/api-reference/sqa_multitimeframe.md +227 -0
- data/docs/api-reference/sqa_patternmatcher.md +195 -0
- data/docs/api-reference/sqa_pluginmanager.md +55 -0
- data/docs/api-reference/sqa_portfolio.md +455 -0
- data/docs/api-reference/sqa_portfolio_position.md +220 -0
- data/docs/api-reference/sqa_portfolio_trade.md +332 -0
- data/docs/api-reference/sqa_portfoliooptimizer.md +248 -0
- data/docs/api-reference/sqa_riskmanager.md +388 -0
- data/docs/api-reference/sqa_seasonalanalyzer.md +121 -0
- data/docs/api-reference/sqa_sectoranalyzer.md +163 -0
- data/docs/api-reference/sqa_stock.md +649 -0
- data/docs/api-reference/sqa_strategy.md +178 -0
- data/docs/api-reference/sqa_strategy_bollingerbands.md +26 -0
- data/docs/api-reference/sqa_strategy_common.md +29 -0
- data/docs/api-reference/sqa_strategy_consensus.md +129 -0
- data/docs/api-reference/sqa_strategy_ema.md +41 -0
- data/docs/api-reference/sqa_strategy_kbs.md +154 -0
- data/docs/api-reference/sqa_strategy_macd.md +26 -0
- data/docs/api-reference/sqa_strategy_mp.md +41 -0
- data/docs/api-reference/sqa_strategy_mr.md +41 -0
- data/docs/api-reference/sqa_strategy_random.md +41 -0
- data/docs/api-reference/sqa_strategy_rsi.md +41 -0
- data/docs/api-reference/sqa_strategy_sma.md +41 -0
- data/docs/api-reference/sqa_strategy_stochastic.md +26 -0
- data/docs/api-reference/sqa_strategy_volumebreakout.md +26 -0
- data/docs/api-reference/sqa_strategygenerator.md +298 -0
- data/docs/api-reference/sqa_strategygenerator_pattern.md +264 -0
- data/docs/api-reference/sqa_strategygenerator_patterncontext.md +326 -0
- data/docs/api-reference/sqa_strategygenerator_profitablepoint.md +424 -0
- data/docs/api-reference/sqa_stream.md +256 -0
- data/docs/api-reference/sqa_ticker.md +175 -0
- data/docs/api-reference/string.md +135 -0
- data/docs/assets/images/advanced-workflow.svg +89 -0
- data/docs/assets/images/architecture.svg +107 -0
- data/docs/assets/images/data-flow.svg +138 -0
- data/docs/assets/images/getting-started-workflow.svg +88 -0
- data/docs/assets/images/sqa.jpg +0 -0
- data/docs/assets/images/strategy-flow.svg +78 -0
- data/docs/assets/images/system-architecture.svg +150 -0
- data/docs/concepts/index.md +292 -27
- data/docs/data_frame.md +0 -1
- data/docs/getting-started/index.md +1 -30
- data/docs/getting-started/installation.md +2 -2
- data/docs/getting-started/quick-start.md +4 -4
- data/docs/index.md +26 -25
- data/docs/llms.txt +109 -0
- data/docs/strategies/bollinger-bands.md +1 -1
- data/docs/strategies/kbs.md +15 -14
- data/docs/strategies/rsi.md +1 -1
- data/docs/strategy.md +381 -3
- data/docs/terms_of_use.md +1 -1
- data/examples/README.md +10 -0
- data/lib/api/alpha_vantage_api.rb +3 -7
- data/lib/sqa/config.rb +109 -28
- data/lib/sqa/data_frame/alpha_vantage.rb +13 -3
- data/lib/sqa/data_frame/data.rb +13 -1
- data/lib/sqa/data_frame.rb +189 -41
- data/lib/sqa/errors.rb +79 -17
- data/lib/sqa/indicator.rb +17 -4
- data/lib/sqa/init.rb +70 -15
- data/lib/sqa/pattern_matcher.rb +4 -4
- data/lib/sqa/portfolio.rb +1 -1
- data/lib/sqa/sector_analyzer.rb +3 -11
- data/lib/sqa/stock.rb +236 -20
- data/lib/sqa/strategy.rb +62 -4
- data/lib/sqa/ticker.rb +107 -42
- data/lib/sqa/version.rb +1 -1
- data/lib/sqa.rb +16 -8
- data/mkdocs.yml +68 -117
- metadata +90 -36
- data/docs/README.md +0 -43
- data/docs/alpha_vantage_technical_indicators.md +0 -62
- data/docs/average_true_range.md +0 -9
- data/docs/bollinger_bands.md +0 -15
- data/docs/candlestick_pattern_recognizer.md +0 -4
- data/docs/donchian_channel.md +0 -5
- data/docs/double_top_bottom_pattern.md +0 -3
- data/docs/exponential_moving_average.md +0 -19
- data/docs/fibonacci_retracement.md +0 -30
- data/docs/head_and_shoulders_pattern.md +0 -3
- data/docs/market_profile.md +0 -4
- data/docs/momentum.md +0 -19
- data/docs/moving_average_convergence_divergence.md +0 -23
- data/docs/peaks_and_valleys.md +0 -11
- data/docs/relative_strength_index.md +0 -6
- data/docs/simple_moving_average.md +0 -8
- data/docs/stochastic_oscillator.md +0 -4
- data/docs/ta_lib.md +0 -160
- data/docs/true_range.md +0 -12
- data/docs/true_strength_index.md +0 -46
- data/docs/weighted_moving_average.md +0 -48
- data/examples/sinatra_app/Gemfile +0 -22
- data/examples/sinatra_app/QUICKSTART.md +0 -159
- data/examples/sinatra_app/README.md +0 -461
- data/examples/sinatra_app/app.rb +0 -344
- data/examples/sinatra_app/config.ru +0 -5
- data/examples/sinatra_app/public/css/style.css +0 -659
- data/examples/sinatra_app/public/js/app.js +0 -107
- data/examples/sinatra_app/views/analyze.erb +0 -306
- data/examples/sinatra_app/views/backtest.erb +0 -325
- data/examples/sinatra_app/views/dashboard.erb +0 -419
- data/examples/sinatra_app/views/error.erb +0 -58
- data/examples/sinatra_app/views/index.erb +0 -118
- data/examples/sinatra_app/views/layout.erb +0 -61
- data/examples/sinatra_app/views/portfolio.erb +0 -43
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# 📦 SQA::Ticker
|
|
2
|
+
|
|
3
|
+
!!! note "Description"
|
|
4
|
+
sqa/lib/sqa/ticker.rb
|
|
5
|
+
|
|
6
|
+
Stock ticker symbol validation and lookup using the dumbstockapi.com service.
|
|
7
|
+
Downloads and caches a CSV file containing ticker symbols, company names, and exchanges.
|
|
8
|
+
|
|
9
|
+
!!! abstract "Source Information"
|
|
10
|
+
**Defined in:** `lib/sqa/ticker.rb:15`
|
|
11
|
+
|
|
12
|
+
**Inherits from:** `Object`
|
|
13
|
+
|
|
14
|
+
## 🏭 Class Methods
|
|
15
|
+
|
|
16
|
+
### `.download(country = "US")`
|
|
17
|
+
|
|
18
|
+
Downloads ticker data from dumbstockapi.com and saves to data directory.
|
|
19
|
+
|
|
20
|
+
!!! info "Parameters"
|
|
21
|
+
|
|
22
|
+
| Name | Type | Description |
|
|
23
|
+
|------|------|-------------|
|
|
24
|
+
| `country` | `String` | Country code for ticker list (default: "US") |
|
|
25
|
+
!!! success "Returns"
|
|
26
|
+
|
|
27
|
+
**Type:** `Integer`
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
HTTP status code from the download request
|
|
32
|
+
!!! example "Usage Examples"
|
|
33
|
+
|
|
34
|
+
```ruby
|
|
35
|
+
SQA::Ticker.download("US") # => 200
|
|
36
|
+
```
|
|
37
|
+
??? info "Source Location"
|
|
38
|
+
`lib/sqa/ticker.rb:31`
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### `.load()`
|
|
43
|
+
|
|
44
|
+
Loads ticker data from cached CSV or downloads if not available.
|
|
45
|
+
Retries download up to 3 times if no cached file exists.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
!!! success "Returns"
|
|
49
|
+
|
|
50
|
+
**Type:** `Hash{String => Hash}`
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
Hash mapping ticker symbols to info hashes
|
|
55
|
+
|
|
56
|
+
??? info "Source Location"
|
|
57
|
+
`lib/sqa/ticker.rb:47`
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
### `.load_from_csv(csv_path)`
|
|
62
|
+
|
|
63
|
+
Loads ticker data from a specific CSV file.
|
|
64
|
+
|
|
65
|
+
!!! info "Parameters"
|
|
66
|
+
|
|
67
|
+
| Name | Type | Description |
|
|
68
|
+
|------|------|-------------|
|
|
69
|
+
| `csv_path` | `Pathname, String` | Path to CSV file |
|
|
70
|
+
!!! success "Returns"
|
|
71
|
+
|
|
72
|
+
**Type:** `Hash{String => Hash}`
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
Hash mapping ticker symbols to info hashes
|
|
77
|
+
|
|
78
|
+
??? info "Source Location"
|
|
79
|
+
`lib/sqa/ticker.rb:77`
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### `.data()`
|
|
84
|
+
|
|
85
|
+
Returns the cached ticker data, loading it if necessary.
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
!!! success "Returns"
|
|
89
|
+
|
|
90
|
+
**Type:** `Hash{String => Hash}`
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
Hash mapping ticker symbols to info hashes
|
|
95
|
+
|
|
96
|
+
??? info "Source Location"
|
|
97
|
+
`lib/sqa/ticker.rb:92`
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### `.lookup(ticker)`
|
|
102
|
+
|
|
103
|
+
Looks up information for a specific ticker symbol.
|
|
104
|
+
|
|
105
|
+
!!! info "Parameters"
|
|
106
|
+
|
|
107
|
+
| Name | Type | Description |
|
|
108
|
+
|------|------|-------------|
|
|
109
|
+
| `ticker` | `String, nil` | Ticker symbol to look up |
|
|
110
|
+
!!! success "Returns"
|
|
111
|
+
|
|
112
|
+
**Type:** `Hash, nil`
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
Hash with :name and :exchange keys, or nil if not found
|
|
117
|
+
!!! example "Usage Examples"
|
|
118
|
+
|
|
119
|
+
```ruby
|
|
120
|
+
SQA::Ticker.lookup('AAPL') # => { name: "Apple Inc", exchange: "NASDAQ" }
|
|
121
|
+
SQA::Ticker.lookup('FAKE') # => nil
|
|
122
|
+
```
|
|
123
|
+
??? info "Source Location"
|
|
124
|
+
`lib/sqa/ticker.rb:106`
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### `.valid?(ticker)`
|
|
129
|
+
|
|
130
|
+
Checks if a ticker symbol is valid (exists in the data).
|
|
131
|
+
|
|
132
|
+
!!! info "Parameters"
|
|
133
|
+
|
|
134
|
+
| Name | Type | Description |
|
|
135
|
+
|------|------|-------------|
|
|
136
|
+
| `ticker` | `String, nil` | Ticker symbol to validate |
|
|
137
|
+
!!! success "Returns"
|
|
138
|
+
|
|
139
|
+
**Type:** `Boolean`
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
true if ticker exists, false otherwise
|
|
144
|
+
!!! example "Usage Examples"
|
|
145
|
+
|
|
146
|
+
```ruby
|
|
147
|
+
SQA::Ticker.valid?('AAPL') # => true
|
|
148
|
+
SQA::Ticker.valid?(nil) # => false
|
|
149
|
+
```
|
|
150
|
+
??? info "Source Location"
|
|
151
|
+
`lib/sqa/ticker.rb:120`
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### `.reset!()`
|
|
156
|
+
|
|
157
|
+
Resets the cached ticker data.
|
|
158
|
+
Useful for testing to force a fresh load.
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
!!! success "Returns"
|
|
162
|
+
|
|
163
|
+
**Type:** `Hash`
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
Empty hash
|
|
168
|
+
|
|
169
|
+
??? info "Source Location"
|
|
170
|
+
`lib/sqa/ticker.rb:129`
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 📝 Attributes
|
|
175
|
+
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# 📦 String
|
|
2
|
+
|
|
3
|
+
!!! note "Description"
|
|
4
|
+
File: string.rb
|
|
5
|
+
Desc: Monkey to the String class.
|
|
6
|
+
|
|
7
|
+
!!! abstract "Source Information"
|
|
8
|
+
**Defined in:** `lib/patches/string.rb:10`
|
|
9
|
+
|
|
10
|
+
**Inherits from:** `Object`
|
|
11
|
+
|
|
12
|
+
## 🔨 Instance Methods
|
|
13
|
+
|
|
14
|
+
### `#to_underscore()`
|
|
15
|
+
|
|
16
|
+
Convert CamelCase to camel_case
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
??? info "Source Location"
|
|
22
|
+
`lib/patches/string.rb:14`
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
### `#to_snakecase()`
|
|
27
|
+
|
|
28
|
+
Convert CamelCase to camel_case
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
??? info "Source Location"
|
|
34
|
+
`lib/patches/string.rb:21`
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
### `#snakecase()`
|
|
39
|
+
|
|
40
|
+
Convert CamelCase to camel_case
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
??? info "Source Location"
|
|
46
|
+
`lib/patches/string.rb:22`
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
### `#snake_case()`
|
|
51
|
+
|
|
52
|
+
Convert CamelCase to camel_case
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
??? info "Source Location"
|
|
58
|
+
`lib/patches/string.rb:23`
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
### `#underscore()`
|
|
63
|
+
|
|
64
|
+
Convert CamelCase to camel_case
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
??? info "Source Location"
|
|
70
|
+
`lib/patches/string.rb:24`
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
### `#to_camelcase()`
|
|
75
|
+
|
|
76
|
+
Convert camel_case to CamelCase
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
??? info "Source Location"
|
|
82
|
+
`lib/patches/string.rb:29`
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
### `#camelcase()`
|
|
87
|
+
|
|
88
|
+
Convert camel_case to CamelCase
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
??? info "Source Location"
|
|
94
|
+
`lib/patches/string.rb:34`
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### `#camelize()`
|
|
99
|
+
|
|
100
|
+
Convert camel_case to CamelCase
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
??? info "Source Location"
|
|
106
|
+
`lib/patches/string.rb:35`
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### `#to_constant()`
|
|
111
|
+
|
|
112
|
+
Convert "CamelCase" into CamelCase
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
??? info "Source Location"
|
|
118
|
+
`lib/patches/string.rb:40`
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### `#constantize()`
|
|
123
|
+
|
|
124
|
+
Convert "CamelCase" into CamelCase
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
??? info "Source Location"
|
|
130
|
+
`lib/patches/string.rb:55`
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 📝 Attributes
|
|
135
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 550" width="1400" height="550">
|
|
2
|
+
<defs>
|
|
3
|
+
<style>
|
|
4
|
+
.box { stroke: #ffffff; stroke-width: 3; }
|
|
5
|
+
.text { fill: #ffffff; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 15px; font-weight: 600; text-anchor: middle; }
|
|
6
|
+
.small-text { fill: #ffffff; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 13px; font-weight: 500; text-anchor: middle; }
|
|
7
|
+
.arrow { stroke: #ffffff; stroke-width: 2.5; fill: none; marker-end: url(#arrowhead); }
|
|
8
|
+
.diamond { stroke: #ffffff; stroke-width: 3; }
|
|
9
|
+
.label { fill: #ffffff; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 14px; font-weight: 500; }
|
|
10
|
+
</style>
|
|
11
|
+
<marker id="arrowhead" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto">
|
|
12
|
+
<polygon points="0 0, 10 3, 0 6" fill="#ffffff" />
|
|
13
|
+
</marker>
|
|
14
|
+
</defs>
|
|
15
|
+
|
|
16
|
+
<!-- Historical Data -->
|
|
17
|
+
<rect x="30" y="210" width="160" height="70" rx="8" class="box" fill="#2E86DE"/>
|
|
18
|
+
<text x="110" y="240" class="text">Historical</text>
|
|
19
|
+
<text x="110" y="260" class="text">Data</text>
|
|
20
|
+
|
|
21
|
+
<!-- Strategy Generator -->
|
|
22
|
+
<rect x="230" y="210" width="160" height="70" rx="8" class="box" fill="#10AC84"/>
|
|
23
|
+
<text x="310" y="240" class="text">Strategy</text>
|
|
24
|
+
<text x="310" y="260" class="text">Generator</text>
|
|
25
|
+
|
|
26
|
+
<!-- Discovered Patterns -->
|
|
27
|
+
<rect x="430" y="210" width="160" height="70" rx="8" class="box" fill="#00D2D3"/>
|
|
28
|
+
<text x="510" y="240" class="text">Discovered</text>
|
|
29
|
+
<text x="510" y="260" class="text">Patterns</text>
|
|
30
|
+
|
|
31
|
+
<!-- Generated Strategies -->
|
|
32
|
+
<rect x="630" y="210" width="160" height="70" rx="8" class="box" fill="#EE5A6F"/>
|
|
33
|
+
<text x="710" y="240" class="text">Generated</text>
|
|
34
|
+
<text x="710" y="260" class="text">Strategies</text>
|
|
35
|
+
|
|
36
|
+
<!-- Genetic Programming -->
|
|
37
|
+
<rect x="830" y="210" width="160" height="70" rx="8" class="box" fill="#F368E0"/>
|
|
38
|
+
<text x="910" y="240" class="text">Genetic</text>
|
|
39
|
+
<text x="910" y="260" class="text">Programming</text>
|
|
40
|
+
|
|
41
|
+
<!-- Optimized Parameters -->
|
|
42
|
+
<rect x="1030" y="210" width="160" height="70" rx="8" class="box" fill="#C56CF0"/>
|
|
43
|
+
<text x="1110" y="240" class="text">Optimized</text>
|
|
44
|
+
<text x="1110" y="260" class="text">Parameters</text>
|
|
45
|
+
|
|
46
|
+
<!-- Backtest -->
|
|
47
|
+
<rect x="1230" y="210" width="140" height="70" rx="8" class="box" fill="#FF9F43"/>
|
|
48
|
+
<text x="1300" y="250" class="text">Backtest</text>
|
|
49
|
+
|
|
50
|
+
<!-- Results Good? Diamond -->
|
|
51
|
+
<g transform="translate(1300, 380)">
|
|
52
|
+
<polygon points="0,-50 70,0 0,50 -70,0" class="diamond" fill="#FD79A8"/>
|
|
53
|
+
<text x="0" y="-5" class="small-text">Results</text>
|
|
54
|
+
<text x="0" y="12" class="small-text">Good?</text>
|
|
55
|
+
</g>
|
|
56
|
+
|
|
57
|
+
<!-- Live Stream -->
|
|
58
|
+
<rect x="1230" y="470" width="140" height="60" rx="8" class="box" fill="#FFA502"/>
|
|
59
|
+
<text x="1300" y="505" class="text">Live Stream</text>
|
|
60
|
+
|
|
61
|
+
<!-- Portfolio Management -->
|
|
62
|
+
<rect x="1030" y="470" width="160" height="60" rx="8" class="box" fill="#26DE81"/>
|
|
63
|
+
<text x="1110" y="493" class="text">Portfolio</text>
|
|
64
|
+
<text x="1110" y="513" class="text">Management</text>
|
|
65
|
+
|
|
66
|
+
<!-- Arrows - Main flow -->
|
|
67
|
+
<path d="M 190 245 L 230 245" class="arrow"/>
|
|
68
|
+
<path d="M 390 245 L 430 245" class="arrow"/>
|
|
69
|
+
<path d="M 590 245 L 630 245" class="arrow"/>
|
|
70
|
+
<path d="M 790 245 L 830 245" class="arrow"/>
|
|
71
|
+
<path d="M 990 245 L 1030 245" class="arrow"/>
|
|
72
|
+
<path d="M 1190 245 L 1230 245" class="arrow"/>
|
|
73
|
+
|
|
74
|
+
<!-- Backtest to Diamond -->
|
|
75
|
+
<path d="M 1300 280 L 1300 330" class="arrow"/>
|
|
76
|
+
|
|
77
|
+
<!-- Diamond to Live Stream (Yes path) -->
|
|
78
|
+
<path d="M 1300 430 L 1300 470" class="arrow"/>
|
|
79
|
+
|
|
80
|
+
<!-- Diamond back to Generated Strategies (No path) -->
|
|
81
|
+
<path d="M 1230 380 L 710 380 L 710 280" class="arrow"/>
|
|
82
|
+
|
|
83
|
+
<!-- Live Stream to Portfolio Management -->
|
|
84
|
+
<path d="M 1230 500 L 1190 500" class="arrow"/>
|
|
85
|
+
|
|
86
|
+
<!-- Labels -->
|
|
87
|
+
<text x="1315" y="455" class="label">Yes</text>
|
|
88
|
+
<text x="950" y="365" class="label">No</text>
|
|
89
|
+
</svg>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 650" width="900" height="650">
|
|
2
|
+
<defs>
|
|
3
|
+
<style>
|
|
4
|
+
.box { stroke: #ffffff; stroke-width: 3; }
|
|
5
|
+
.text { fill: #ffffff; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 16px; font-weight: 600; text-anchor: middle; }
|
|
6
|
+
.arrow { stroke: #ffffff; stroke-width: 2.5; fill: none; marker-end: url(#arrowhead); }
|
|
7
|
+
.diamond { stroke: #ffffff; stroke-width: 3; }
|
|
8
|
+
.label { fill: #ffffff; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 14px; font-weight: 500; }
|
|
9
|
+
</style>
|
|
10
|
+
<marker id="arrowhead" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto">
|
|
11
|
+
<polygon points="0 0, 10 3, 0 6" fill="#ffffff" />
|
|
12
|
+
</marker>
|
|
13
|
+
</defs>
|
|
14
|
+
|
|
15
|
+
<!-- Stock Data -->
|
|
16
|
+
<rect x="350" y="20" width="200" height="60" rx="8" class="box" fill="#2E86DE"/>
|
|
17
|
+
<text x="450" y="55" class="text">Stock Data</text>
|
|
18
|
+
|
|
19
|
+
<!-- DataFrame -->
|
|
20
|
+
<rect x="350" y="120" width="200" height="60" rx="8" class="box" fill="#10AC84"/>
|
|
21
|
+
<text x="450" y="155" class="text">SQA::DataFrame</text>
|
|
22
|
+
|
|
23
|
+
<!-- Technical Indicators -->
|
|
24
|
+
<rect x="350" y="220" width="200" height="60" rx="8" class="box" fill="#EE5A6F"/>
|
|
25
|
+
<text x="450" y="255" class="text">Technical Indicators</text>
|
|
26
|
+
|
|
27
|
+
<!-- Trading Strategies -->
|
|
28
|
+
<rect x="350" y="320" width="200" height="60" rx="8" class="box" fill="#F368E0"/>
|
|
29
|
+
<text x="450" y="355" class="text">Trading Strategies</text>
|
|
30
|
+
|
|
31
|
+
<!-- Strategy Type Diamond -->
|
|
32
|
+
<g transform="translate(450, 450)">
|
|
33
|
+
<polygon points="0,-50 80,0 0,50 -80,0" class="diamond" fill="#FD79A8"/>
|
|
34
|
+
<text x="0" y="5" class="text">Strategy Type</text>
|
|
35
|
+
</g>
|
|
36
|
+
|
|
37
|
+
<!-- Simple Strategies -->
|
|
38
|
+
<rect x="50" y="550" width="160" height="60" rx="8" class="box" fill="#54A0FF"/>
|
|
39
|
+
<text x="130" y="585" class="text">SMA/EMA/RSI</text>
|
|
40
|
+
|
|
41
|
+
<!-- Advanced Strategies -->
|
|
42
|
+
<rect x="370" y="550" width="160" height="60" rx="8" class="box" fill="#48DBF"/>
|
|
43
|
+
<text x="450" y="577" class="text">MACD/</text>
|
|
44
|
+
<text x="450" y="597" class="text">Bollinger</text>
|
|
45
|
+
|
|
46
|
+
<!-- Rule-Based -->
|
|
47
|
+
<rect x="690" y="550" width="160" height="60" rx="8" class="box" fill="#5F27CD"/>
|
|
48
|
+
<text x="770" y="585" class="text">KBS Strategy</text>
|
|
49
|
+
|
|
50
|
+
<!-- Portfolio Management -->
|
|
51
|
+
<rect x="350" y="420" width="200" height="60" rx="8" class="box" fill="#FF9F43"/>
|
|
52
|
+
<text x="450" y="447" class="text">Portfolio</text>
|
|
53
|
+
<text x="450" y="467" class="text">Management</text>
|
|
54
|
+
|
|
55
|
+
<!-- Backtesting -->
|
|
56
|
+
<rect x="620" y="420" width="180" height="60" rx="8" class="box" fill="#01A3A4"/>
|
|
57
|
+
<text x="710" y="455" class="text">Backtesting</text>
|
|
58
|
+
|
|
59
|
+
<!-- Performance Metrics -->
|
|
60
|
+
<rect x="620" y="520" width="180" height="60" rx="8" class="box" fill="#00D2D3"/>
|
|
61
|
+
<text x="710" y="547" class="text">Performance</text>
|
|
62
|
+
<text x="710" y="567" class="text">Metrics</text>
|
|
63
|
+
|
|
64
|
+
<!-- Real-Time Data -->
|
|
65
|
+
<rect x="50" y="220" width="180" height="60" rx="8" class="box" fill="#C56CF0"/>
|
|
66
|
+
<text x="140" y="255" class="text">Real-Time Data</text>
|
|
67
|
+
|
|
68
|
+
<!-- Stream -->
|
|
69
|
+
<rect x="50" y="320" width="180" height="60" rx="8" class="box" fill="#FFBE76"/>
|
|
70
|
+
<text x="140" y="355" class="text">SQA::Stream</text>
|
|
71
|
+
|
|
72
|
+
<!-- Pattern Discovery -->
|
|
73
|
+
<rect x="620" y="120" width="200" height="60" rx="8" class="box" fill="#FFA502"/>
|
|
74
|
+
<text x="720" y="147" class="text">Pattern</text>
|
|
75
|
+
<text x="720" y="167" class="text">Discovery</text>
|
|
76
|
+
|
|
77
|
+
<!-- StrategyGenerator -->
|
|
78
|
+
<rect x="620" y="220" width="200" height="60" rx="8" class="box" fill="#FF6348"/>
|
|
79
|
+
<text x="720" y="247" class="text">Strategy</text>
|
|
80
|
+
<text x="720" y="267" class="text">Generator</text>
|
|
81
|
+
|
|
82
|
+
<!-- Generated Strategies -->
|
|
83
|
+
<rect x="620" y="320" width="200" height="60" rx="8" class="box" fill="#FF4757"/>
|
|
84
|
+
<text x="720" y="347" class="text">Generated</text>
|
|
85
|
+
<text x="720" y="367" class="text">Strategies</text>
|
|
86
|
+
|
|
87
|
+
<!-- Arrows -->
|
|
88
|
+
<path d="M 450 80 L 450 120" class="arrow"/>
|
|
89
|
+
<path d="M 450 180 L 450 220" class="arrow"/>
|
|
90
|
+
<path d="M 450 280 L 450 320" class="arrow"/>
|
|
91
|
+
<path d="M 450 380 L 450 400" class="arrow"/>
|
|
92
|
+
<path d="M 370 500 L 210 550" class="arrow"/>
|
|
93
|
+
<path d="M 450 500 L 450 550" class="arrow"/>
|
|
94
|
+
<path d="M 530 500 L 690 550" class="arrow"/>
|
|
95
|
+
<path d="M 550 450 L 620 450" class="arrow"/>
|
|
96
|
+
<path d="M 710 480 L 710 520" class="arrow"/>
|
|
97
|
+
<path d="M 140 280 L 140 320" class="arrow"/>
|
|
98
|
+
<path d="M 230 350 L 350 350" class="arrow"/>
|
|
99
|
+
<path d="M 720 180 L 720 220" class="arrow"/>
|
|
100
|
+
<path d="M 720 280 L 720 320" class="arrow"/>
|
|
101
|
+
<path d="M 720 380 L 585 380 L 585 360" class="arrow"/>
|
|
102
|
+
|
|
103
|
+
<!-- Labels on arrows -->
|
|
104
|
+
<text x="295" y="535" class="label">Simple</text>
|
|
105
|
+
<text x="450" y="535" class="label">Advanced</text>
|
|
106
|
+
<text x="605" y="535" class="label">Rule-Based</text>
|
|
107
|
+
</svg>
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1100 800" width="1100" height="800">
|
|
2
|
+
<defs>
|
|
3
|
+
<style>
|
|
4
|
+
.participant { stroke: #ffffff; stroke-width: 3; }
|
|
5
|
+
.text { fill: #ffffff; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 15px; font-weight: 600; text-anchor: middle; }
|
|
6
|
+
.small-text { fill: #ffffff; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 13px; font-weight: 500; }
|
|
7
|
+
.arrow { stroke: #ffffff; stroke-width: 2.5; marker-end: url(#arrowhead); }
|
|
8
|
+
.return-arrow { stroke: #ffffff; stroke-width: 2; stroke-dasharray: 5,5; marker-end: url(#arrowhead-dashed); }
|
|
9
|
+
.lifeline { stroke: #888888; stroke-width: 1; stroke-dasharray: 5,5; }
|
|
10
|
+
</style>
|
|
11
|
+
<marker id="arrowhead" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto">
|
|
12
|
+
<polygon points="0 0, 10 3, 0 6" fill="#ffffff" />
|
|
13
|
+
</marker>
|
|
14
|
+
<marker id="arrowhead-dashed" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto">
|
|
15
|
+
<polygon points="0 0, 10 3, 0 6" fill="#ffffff" />
|
|
16
|
+
</marker>
|
|
17
|
+
</defs>
|
|
18
|
+
|
|
19
|
+
<!-- Participants -->
|
|
20
|
+
<rect x="30" y="20" width="120" height="60" rx="8" class="participant" fill="#2E86DE"/>
|
|
21
|
+
<text x="90" y="55" class="text">User</text>
|
|
22
|
+
|
|
23
|
+
<rect x="210" y="20" width="120" height="60" rx="8" class="participant" fill="#10AC84"/>
|
|
24
|
+
<text x="270" y="55" class="text">Stock</text>
|
|
25
|
+
|
|
26
|
+
<rect x="390" y="20" width="140" height="60" rx="8" class="participant" fill="#EE5A6F"/>
|
|
27
|
+
<text x="460" y="55" class="text">DataFrame</text>
|
|
28
|
+
|
|
29
|
+
<rect x="590" y="20" width="140" height="60" rx="8" class="participant" fill="#F368E0"/>
|
|
30
|
+
<text x="660" y="55" class="text">Indicators</text>
|
|
31
|
+
|
|
32
|
+
<rect x="790" y="20" width="120" height="60" rx="8" class="participant" fill="#FF9F43"/>
|
|
33
|
+
<text x="850" y="55" class="text">Strategy</text>
|
|
34
|
+
|
|
35
|
+
<rect x="970" y="20" width="120" height="60" rx="8" class="participant" fill="#5F27CD"/>
|
|
36
|
+
<text x="1030" y="55" class="text">Portfolio</text>
|
|
37
|
+
|
|
38
|
+
<!-- Lifelines -->
|
|
39
|
+
<line x1="90" y1="80" x2="90" y2="760" class="lifeline"/>
|
|
40
|
+
<line x1="270" y1="80" x2="270" y2="760" class="lifeline"/>
|
|
41
|
+
<line x1="460" y1="80" x2="460" y2="760" class="lifeline"/>
|
|
42
|
+
<line x1="660" y1="80" x2="660" y2="760" class="lifeline"/>
|
|
43
|
+
<line x1="850" y1="80" x2="850" y2="760" class="lifeline"/>
|
|
44
|
+
<line x1="1030" y1="80" x2="1030" y2="760" class="lifeline"/>
|
|
45
|
+
|
|
46
|
+
<!-- Sequence Messages -->
|
|
47
|
+
|
|
48
|
+
<!-- 1. User -> Stock: new(ticker: 'AAPL') -->
|
|
49
|
+
<line x1="90" y1="120" x2="270" y2="120" class="arrow" fill="none"/>
|
|
50
|
+
<text x="140" y="115" class="small-text">new(ticker: 'AAPL')</text>
|
|
51
|
+
|
|
52
|
+
<!-- 2. Stock -> DataFrame: Load/fetch data -->
|
|
53
|
+
<line x1="270" y1="160" x2="460" y2="160" class="arrow" fill="none"/>
|
|
54
|
+
<text x="330" y="155" class="small-text">Load/fetch data</text>
|
|
55
|
+
|
|
56
|
+
<!-- 3. DataFrame -> Stock: Price/volume data (return) -->
|
|
57
|
+
<line x1="460" y1="200" x2="270" y2="200" class="return-arrow" fill="none"/>
|
|
58
|
+
<text x="330" y="195" class="small-text">Price/volume data</text>
|
|
59
|
+
|
|
60
|
+
<!-- 4. User -> DataFrame: Extract prices array -->
|
|
61
|
+
<line x1="90" y1="260" x2="460" y2="260" class="arrow" fill="none"/>
|
|
62
|
+
<text x="240" y="255" class="small-text">Extract prices array</text>
|
|
63
|
+
|
|
64
|
+
<!-- 5. DataFrame -> User: prices[] (return) -->
|
|
65
|
+
<line x1="460" y1="300" x2="90" y2="300" class="return-arrow" fill="none"/>
|
|
66
|
+
<text x="240" y="295" class="small-text">prices[]</text>
|
|
67
|
+
|
|
68
|
+
<!-- 6. User -> Indicators: Calculate RSI, MACD, etc. -->
|
|
69
|
+
<line x1="90" y1="360" x2="660" y2="360" class="arrow" fill="none"/>
|
|
70
|
+
<text x="330" y="355" class="small-text">Calculate RSI, MACD, etc.</text>
|
|
71
|
+
|
|
72
|
+
<!-- 7. Indicators -> User: indicator values[] (return) -->
|
|
73
|
+
<line x1="660" y1="400" x2="90" y2="400" class="return-arrow" fill="none"/>
|
|
74
|
+
<text x="330" y="395" class="small-text">indicator values[]</text>
|
|
75
|
+
|
|
76
|
+
<!-- 8. User -> Strategy: Create vector, execute -->
|
|
77
|
+
<line x1="90" y1="460" x2="850" y2="460" class="arrow" fill="none"/>
|
|
78
|
+
<text x="430" y="455" class="small-text">Create vector, execute</text>
|
|
79
|
+
|
|
80
|
+
<!-- 9. Strategy -> User: :buy/:sell/:hold (return) -->
|
|
81
|
+
<line x1="850" y1="500" x2="90" y2="500" class="return-arrow" fill="none"/>
|
|
82
|
+
<text x="430" y="495" class="small-text">:buy/:sell/:hold</text>
|
|
83
|
+
|
|
84
|
+
<!-- 10. User -> Portfolio: Execute trade -->
|
|
85
|
+
<line x1="90" y1="560" x2="1030" y2="560" class="arrow" fill="none"/>
|
|
86
|
+
<text x="520" y="555" class="small-text">Execute trade</text>
|
|
87
|
+
|
|
88
|
+
<!-- 11. Portfolio -> User: Updated positions (return) -->
|
|
89
|
+
<line x1="1030" y1="600" x2="90" y2="600" class="return-arrow" fill="none"/>
|
|
90
|
+
<text x="520" y="595" class="small-text">Updated positions</text>
|
|
91
|
+
|
|
92
|
+
<!-- Activation bars -->
|
|
93
|
+
<rect x="85" y="115" width="10" height="15" fill="#2E86DE" opacity="0.7"/>
|
|
94
|
+
<rect x="265" y="155" width="10" height="15" fill="#10AC84" opacity="0.7"/>
|
|
95
|
+
<rect x="455" y="195" width="10" height="15" fill="#EE5A6F" opacity="0.7"/>
|
|
96
|
+
<rect x="85" y="255" width="10" height="55" fill="#2E86DE" opacity="0.7"/>
|
|
97
|
+
<rect x="455" y="255" width="10" height="55" fill="#EE5A6F" opacity="0.7"/>
|
|
98
|
+
<rect x="85" y="355" width="10" height="55" fill="#2E86DE" opacity="0.7"/>
|
|
99
|
+
<rect x="655" y="355" width="10" height="55" fill="#F368E0" opacity="0.7"/>
|
|
100
|
+
<rect x="85" y="455" width="10" height="55" fill="#2E86DE" opacity="0.7"/>
|
|
101
|
+
<rect x="845" y="455" width="10" height="55" fill="#FF9F43" opacity="0.7"/>
|
|
102
|
+
<rect x="85" y="555" width="10" height="55" fill="#2E86DE" opacity="0.7"/>
|
|
103
|
+
<rect x="1025" y="555" width="10" height="55" fill="#5F27CD" opacity="0.7"/>
|
|
104
|
+
|
|
105
|
+
<!-- Step numbers -->
|
|
106
|
+
<circle cx="180" cy="120" r="12" fill="#FFFFFF" opacity="0.3"/>
|
|
107
|
+
<text x="180" y="125" class="small-text" text-anchor="middle">1</text>
|
|
108
|
+
|
|
109
|
+
<circle cx="365" cy="160" r="12" fill="#FFFFFF" opacity="0.3"/>
|
|
110
|
+
<text x="365" y="165" class="small-text" text-anchor="middle">2</text>
|
|
111
|
+
|
|
112
|
+
<circle cx="365" cy="200" r="12" fill="#FFFFFF" opacity="0.3"/>
|
|
113
|
+
<text x="365" y="205" class="small-text" text-anchor="middle">3</text>
|
|
114
|
+
|
|
115
|
+
<circle cx="275" cy="260" r="12" fill="#FFFFFF" opacity="0.3"/>
|
|
116
|
+
<text x="275" y="265" class="small-text" text-anchor="middle">4</text>
|
|
117
|
+
|
|
118
|
+
<circle cx="275" cy="300" r="12" fill="#FFFFFF" opacity="0.3"/>
|
|
119
|
+
<text x="275" y="305" class="small-text" text-anchor="middle">5</text>
|
|
120
|
+
|
|
121
|
+
<circle cx="375" cy="360" r="12" fill="#FFFFFF" opacity="0.3"/>
|
|
122
|
+
<text x="375" y="365" class="small-text" text-anchor="middle">6</text>
|
|
123
|
+
|
|
124
|
+
<circle cx="375" cy="400" r="12" fill="#FFFFFF" opacity="0.3"/>
|
|
125
|
+
<text x="375" y="405" class="small-text" text-anchor="middle">7</text>
|
|
126
|
+
|
|
127
|
+
<circle cx="470" cy="460" r="12" fill="#FFFFFF" opacity="0.3"/>
|
|
128
|
+
<text x="470" y="465" class="small-text" text-anchor="middle">8</text>
|
|
129
|
+
|
|
130
|
+
<circle cx="470" cy="500" r="12" fill="#FFFFFF" opacity="0.3"/>
|
|
131
|
+
<text x="470" y="505" class="small-text" text-anchor="middle">9</text>
|
|
132
|
+
|
|
133
|
+
<circle cx="560" cy="560" r="12" fill="#FFFFFF" opacity="0.3"/>
|
|
134
|
+
<text x="560" y="565" class="small-text" text-anchor="middle">10</text>
|
|
135
|
+
|
|
136
|
+
<circle cx="560" cy="600" r="12" fill="#FFFFFF" opacity="0.3"/>
|
|
137
|
+
<text x="560" y="605" class="small-text" text-anchor="middle">11</text>
|
|
138
|
+
</svg>
|