sqa 0.0.32 → 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 +92 -1
- data/README.md +4 -0
- data/Rakefile +52 -10
- data/docs/IMPROVEMENT_PLAN.md +531 -0
- data/docs/advanced/index.md +1 -13
- 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/strategy-flow.svg +78 -0
- data/docs/assets/images/system-architecture.svg +150 -0
- data/docs/concepts/index.md +292 -19
- data/docs/getting-started/index.md +1 -14
- data/docs/index.md +26 -23
- data/docs/llms.txt +109 -0
- data/docs/strategies/kbs.md +15 -14
- 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/data.rb +13 -1
- data/lib/sqa/data_frame.rb +168 -26
- data/lib/sqa/errors.rb +79 -17
- 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 +169 -15
- data/lib/sqa/strategy.rb +62 -4
- data/lib/sqa/ticker.rb +106 -48
- data/lib/sqa/version.rb +1 -1
- data/lib/sqa.rb +4 -4
- data/mkdocs.yml +68 -81
- metadata +89 -21
- data/docs/README.md +0 -43
- data/examples/sinatra_app/Gemfile +0 -42
- data/examples/sinatra_app/Gemfile.lock +0 -268
- data/examples/sinatra_app/QUICKSTART.md +0 -169
- data/examples/sinatra_app/README.md +0 -471
- data/examples/sinatra_app/RUNNING_WITHOUT_TALIB.md +0 -90
- data/examples/sinatra_app/TROUBLESHOOTING.md +0 -95
- data/examples/sinatra_app/app.rb +0 -404
- data/examples/sinatra_app/config.ru +0 -5
- data/examples/sinatra_app/public/css/style.css +0 -723
- data/examples/sinatra_app/public/debug_macd.html +0 -82
- data/examples/sinatra_app/public/js/app.js +0 -107
- data/examples/sinatra_app/start.sh +0 -53
- 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 -831
- 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,530 @@
|
|
|
1
|
+
# 📦 SQA::Backtest::Results
|
|
2
|
+
|
|
3
|
+
!!! note "Description"
|
|
4
|
+
Represents the results of a backtest
|
|
5
|
+
|
|
6
|
+
!!! abstract "Source Information"
|
|
7
|
+
**Defined in:** `lib/sqa/backtest.rb:11`
|
|
8
|
+
|
|
9
|
+
**Inherits from:** `Object`
|
|
10
|
+
|
|
11
|
+
## 🔨 Instance Methods
|
|
12
|
+
|
|
13
|
+
### `#total_return()`
|
|
14
|
+
|
|
15
|
+
Returns the value of attribute total_return.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
??? info "Source Location"
|
|
21
|
+
`lib/sqa/backtest.rb:12`
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
### `#total_return=(value)`
|
|
26
|
+
|
|
27
|
+
Sets the attribute total_return
|
|
28
|
+
|
|
29
|
+
!!! info "Parameters"
|
|
30
|
+
|
|
31
|
+
| Name | Type | Description |
|
|
32
|
+
|------|------|-------------|
|
|
33
|
+
| `value` | `Any` | the value to set the attribute total_return to. |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
??? info "Source Location"
|
|
37
|
+
`lib/sqa/backtest.rb:12`
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### `#annualized_return()`
|
|
42
|
+
|
|
43
|
+
Returns the value of attribute annualized_return.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
??? info "Source Location"
|
|
49
|
+
`lib/sqa/backtest.rb:12`
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### `#annualized_return=(value)`
|
|
54
|
+
|
|
55
|
+
Sets the attribute annualized_return
|
|
56
|
+
|
|
57
|
+
!!! info "Parameters"
|
|
58
|
+
|
|
59
|
+
| Name | Type | Description |
|
|
60
|
+
|------|------|-------------|
|
|
61
|
+
| `value` | `Any` | the value to set the attribute annualized_return to. |
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
??? info "Source Location"
|
|
65
|
+
`lib/sqa/backtest.rb:12`
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### `#sharpe_ratio()`
|
|
70
|
+
|
|
71
|
+
Returns the value of attribute sharpe_ratio.
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
??? info "Source Location"
|
|
77
|
+
`lib/sqa/backtest.rb:12`
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
### `#sharpe_ratio=(value)`
|
|
82
|
+
|
|
83
|
+
Sets the attribute sharpe_ratio
|
|
84
|
+
|
|
85
|
+
!!! info "Parameters"
|
|
86
|
+
|
|
87
|
+
| Name | Type | Description |
|
|
88
|
+
|------|------|-------------|
|
|
89
|
+
| `value` | `Any` | the value to set the attribute sharpe_ratio to. |
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
??? info "Source Location"
|
|
93
|
+
`lib/sqa/backtest.rb:12`
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### `#max_drawdown()`
|
|
98
|
+
|
|
99
|
+
Returns the value of attribute max_drawdown.
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
??? info "Source Location"
|
|
105
|
+
`lib/sqa/backtest.rb:12`
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### `#max_drawdown=(value)`
|
|
110
|
+
|
|
111
|
+
Sets the attribute max_drawdown
|
|
112
|
+
|
|
113
|
+
!!! info "Parameters"
|
|
114
|
+
|
|
115
|
+
| Name | Type | Description |
|
|
116
|
+
|------|------|-------------|
|
|
117
|
+
| `value` | `Any` | the value to set the attribute max_drawdown to. |
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
??? info "Source Location"
|
|
121
|
+
`lib/sqa/backtest.rb:12`
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### `#total_trades()`
|
|
126
|
+
|
|
127
|
+
Returns the value of attribute total_trades.
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
??? info "Source Location"
|
|
133
|
+
`lib/sqa/backtest.rb:12`
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
### `#total_trades=(value)`
|
|
138
|
+
|
|
139
|
+
Sets the attribute total_trades
|
|
140
|
+
|
|
141
|
+
!!! info "Parameters"
|
|
142
|
+
|
|
143
|
+
| Name | Type | Description |
|
|
144
|
+
|------|------|-------------|
|
|
145
|
+
| `value` | `Any` | the value to set the attribute total_trades to. |
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
??? info "Source Location"
|
|
149
|
+
`lib/sqa/backtest.rb:12`
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
### `#winning_trades()`
|
|
154
|
+
|
|
155
|
+
Returns the value of attribute winning_trades.
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
??? info "Source Location"
|
|
161
|
+
`lib/sqa/backtest.rb:12`
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
### `#winning_trades=(value)`
|
|
166
|
+
|
|
167
|
+
Sets the attribute winning_trades
|
|
168
|
+
|
|
169
|
+
!!! info "Parameters"
|
|
170
|
+
|
|
171
|
+
| Name | Type | Description |
|
|
172
|
+
|------|------|-------------|
|
|
173
|
+
| `value` | `Any` | the value to set the attribute winning_trades to. |
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
??? info "Source Location"
|
|
177
|
+
`lib/sqa/backtest.rb:12`
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
### `#losing_trades()`
|
|
182
|
+
|
|
183
|
+
Returns the value of attribute losing_trades.
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
??? info "Source Location"
|
|
189
|
+
`lib/sqa/backtest.rb:12`
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
### `#losing_trades=(value)`
|
|
194
|
+
|
|
195
|
+
Sets the attribute losing_trades
|
|
196
|
+
|
|
197
|
+
!!! info "Parameters"
|
|
198
|
+
|
|
199
|
+
| Name | Type | Description |
|
|
200
|
+
|------|------|-------------|
|
|
201
|
+
| `value` | `Any` | the value to set the attribute losing_trades to. |
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
??? info "Source Location"
|
|
205
|
+
`lib/sqa/backtest.rb:12`
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
### `#win_rate()`
|
|
210
|
+
|
|
211
|
+
Returns the value of attribute win_rate.
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
??? info "Source Location"
|
|
217
|
+
`lib/sqa/backtest.rb:12`
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
### `#win_rate=(value)`
|
|
222
|
+
|
|
223
|
+
Sets the attribute win_rate
|
|
224
|
+
|
|
225
|
+
!!! info "Parameters"
|
|
226
|
+
|
|
227
|
+
| Name | Type | Description |
|
|
228
|
+
|------|------|-------------|
|
|
229
|
+
| `value` | `Any` | the value to set the attribute win_rate to. |
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
??? info "Source Location"
|
|
233
|
+
`lib/sqa/backtest.rb:12`
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
### `#average_win()`
|
|
238
|
+
|
|
239
|
+
Returns the value of attribute average_win.
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
??? info "Source Location"
|
|
245
|
+
`lib/sqa/backtest.rb:12`
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
### `#average_win=(value)`
|
|
250
|
+
|
|
251
|
+
Sets the attribute average_win
|
|
252
|
+
|
|
253
|
+
!!! info "Parameters"
|
|
254
|
+
|
|
255
|
+
| Name | Type | Description |
|
|
256
|
+
|------|------|-------------|
|
|
257
|
+
| `value` | `Any` | the value to set the attribute average_win to. |
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
??? info "Source Location"
|
|
261
|
+
`lib/sqa/backtest.rb:12`
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### `#average_loss()`
|
|
266
|
+
|
|
267
|
+
Returns the value of attribute average_loss.
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
??? info "Source Location"
|
|
273
|
+
`lib/sqa/backtest.rb:12`
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
### `#average_loss=(value)`
|
|
278
|
+
|
|
279
|
+
Sets the attribute average_loss
|
|
280
|
+
|
|
281
|
+
!!! info "Parameters"
|
|
282
|
+
|
|
283
|
+
| Name | Type | Description |
|
|
284
|
+
|------|------|-------------|
|
|
285
|
+
| `value` | `Any` | the value to set the attribute average_loss to. |
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
??? info "Source Location"
|
|
289
|
+
`lib/sqa/backtest.rb:12`
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
### `#profit_factor()`
|
|
294
|
+
|
|
295
|
+
Returns the value of attribute profit_factor.
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
??? info "Source Location"
|
|
301
|
+
`lib/sqa/backtest.rb:12`
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
### `#profit_factor=(value)`
|
|
306
|
+
|
|
307
|
+
Sets the attribute profit_factor
|
|
308
|
+
|
|
309
|
+
!!! info "Parameters"
|
|
310
|
+
|
|
311
|
+
| Name | Type | Description |
|
|
312
|
+
|------|------|-------------|
|
|
313
|
+
| `value` | `Any` | the value to set the attribute profit_factor to. |
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
??? info "Source Location"
|
|
317
|
+
`lib/sqa/backtest.rb:12`
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
### `#start_date()`
|
|
322
|
+
|
|
323
|
+
Returns the value of attribute start_date.
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
??? info "Source Location"
|
|
329
|
+
`lib/sqa/backtest.rb:12`
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
### `#start_date=(value)`
|
|
334
|
+
|
|
335
|
+
Sets the attribute start_date
|
|
336
|
+
|
|
337
|
+
!!! info "Parameters"
|
|
338
|
+
|
|
339
|
+
| Name | Type | Description |
|
|
340
|
+
|------|------|-------------|
|
|
341
|
+
| `value` | `Any` | the value to set the attribute start_date to. |
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
??? info "Source Location"
|
|
345
|
+
`lib/sqa/backtest.rb:12`
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
### `#end_date()`
|
|
350
|
+
|
|
351
|
+
Returns the value of attribute end_date.
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
??? info "Source Location"
|
|
357
|
+
`lib/sqa/backtest.rb:12`
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
### `#end_date=(value)`
|
|
362
|
+
|
|
363
|
+
Sets the attribute end_date
|
|
364
|
+
|
|
365
|
+
!!! info "Parameters"
|
|
366
|
+
|
|
367
|
+
| Name | Type | Description |
|
|
368
|
+
|------|------|-------------|
|
|
369
|
+
| `value` | `Any` | the value to set the attribute end_date to. |
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
??? info "Source Location"
|
|
373
|
+
`lib/sqa/backtest.rb:12`
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
### `#initial_capital()`
|
|
378
|
+
|
|
379
|
+
Returns the value of attribute initial_capital.
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
??? info "Source Location"
|
|
385
|
+
`lib/sqa/backtest.rb:12`
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
### `#initial_capital=(value)`
|
|
390
|
+
|
|
391
|
+
Sets the attribute initial_capital
|
|
392
|
+
|
|
393
|
+
!!! info "Parameters"
|
|
394
|
+
|
|
395
|
+
| Name | Type | Description |
|
|
396
|
+
|------|------|-------------|
|
|
397
|
+
| `value` | `Any` | the value to set the attribute initial_capital to. |
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
??? info "Source Location"
|
|
401
|
+
`lib/sqa/backtest.rb:12`
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
### `#final_value()`
|
|
406
|
+
|
|
407
|
+
Returns the value of attribute final_value.
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
??? info "Source Location"
|
|
413
|
+
`lib/sqa/backtest.rb:12`
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
### `#final_value=(value)`
|
|
418
|
+
|
|
419
|
+
Sets the attribute final_value
|
|
420
|
+
|
|
421
|
+
!!! info "Parameters"
|
|
422
|
+
|
|
423
|
+
| Name | Type | Description |
|
|
424
|
+
|------|------|-------------|
|
|
425
|
+
| `value` | `Any` | the value to set the attribute final_value to. |
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
??? info "Source Location"
|
|
429
|
+
`lib/sqa/backtest.rb:12`
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
### `#initialize()`
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
!!! success "Returns"
|
|
437
|
+
|
|
438
|
+
**Type:** `Results`
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
a new instance of Results
|
|
443
|
+
|
|
444
|
+
??? info "Source Location"
|
|
445
|
+
`lib/sqa/backtest.rb:17`
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
### `#to_h()`
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
??? info "Source Location"
|
|
455
|
+
`lib/sqa/backtest.rb:31`
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
|
|
459
|
+
### `#summary()`
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
??? info "Source Location"
|
|
465
|
+
`lib/sqa/backtest.rb:51`
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
## 📝 Attributes
|
|
470
|
+
|
|
471
|
+
### 🔄 `total_return` <small>read/write</small>
|
|
472
|
+
|
|
473
|
+
Returns the value of attribute total_return.
|
|
474
|
+
|
|
475
|
+
### 🔄 `annualized_return` <small>read/write</small>
|
|
476
|
+
|
|
477
|
+
Returns the value of attribute annualized_return.
|
|
478
|
+
|
|
479
|
+
### 🔄 `sharpe_ratio` <small>read/write</small>
|
|
480
|
+
|
|
481
|
+
Returns the value of attribute sharpe_ratio.
|
|
482
|
+
|
|
483
|
+
### 🔄 `max_drawdown` <small>read/write</small>
|
|
484
|
+
|
|
485
|
+
Returns the value of attribute max_drawdown.
|
|
486
|
+
|
|
487
|
+
### 🔄 `total_trades` <small>read/write</small>
|
|
488
|
+
|
|
489
|
+
Returns the value of attribute total_trades.
|
|
490
|
+
|
|
491
|
+
### 🔄 `winning_trades` <small>read/write</small>
|
|
492
|
+
|
|
493
|
+
Returns the value of attribute winning_trades.
|
|
494
|
+
|
|
495
|
+
### 🔄 `losing_trades` <small>read/write</small>
|
|
496
|
+
|
|
497
|
+
Returns the value of attribute losing_trades.
|
|
498
|
+
|
|
499
|
+
### 🔄 `win_rate` <small>read/write</small>
|
|
500
|
+
|
|
501
|
+
Returns the value of attribute win_rate.
|
|
502
|
+
|
|
503
|
+
### 🔄 `average_win` <small>read/write</small>
|
|
504
|
+
|
|
505
|
+
Returns the value of attribute average_win.
|
|
506
|
+
|
|
507
|
+
### 🔄 `average_loss` <small>read/write</small>
|
|
508
|
+
|
|
509
|
+
Returns the value of attribute average_loss.
|
|
510
|
+
|
|
511
|
+
### 🔄 `profit_factor` <small>read/write</small>
|
|
512
|
+
|
|
513
|
+
Returns the value of attribute profit_factor.
|
|
514
|
+
|
|
515
|
+
### 🔄 `start_date` <small>read/write</small>
|
|
516
|
+
|
|
517
|
+
Returns the value of attribute start_date.
|
|
518
|
+
|
|
519
|
+
### 🔄 `end_date` <small>read/write</small>
|
|
520
|
+
|
|
521
|
+
Returns the value of attribute end_date.
|
|
522
|
+
|
|
523
|
+
### 🔄 `initial_capital` <small>read/write</small>
|
|
524
|
+
|
|
525
|
+
Returns the value of attribute initial_capital.
|
|
526
|
+
|
|
527
|
+
### 🔄 `final_value` <small>read/write</small>
|
|
528
|
+
|
|
529
|
+
Returns the value of attribute final_value.
|
|
530
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# 📦 SQA::BadParameterError
|
|
2
|
+
|
|
3
|
+
!!! note "Description"
|
|
4
|
+
Raised when a method parameter is invalid.
|
|
5
|
+
Inherits from ArgumentError for semantic clarity.
|
|
6
|
+
|
|
7
|
+
!!! abstract "Source Information"
|
|
8
|
+
**Defined in:** `lib/sqa/errors.rb:54`
|
|
9
|
+
|
|
10
|
+
**Inherits from:** `ArgumentError`
|
|
11
|
+
|
|
12
|
+
## 📝 Attributes
|
|
13
|
+
|