Repository navigation
Commit b17105b
authored
feat: FeedSpec carries vwap_col so a feed can declare a volume-weighted price (#13)
* feat: FeedSpec carries vwap_col so a feed can declare a volume-weighted price
ExecutionPrice.VWAP has existed in ml4t-backtest since the enum was written and
has never had a column to read: there is no vwap_col anywhere in the feed
contract, so the broker resolved it to the close and, under next_bar execution,
to the open. Neither substitution was reported.
vwap_col defaults to None rather than to a guessed column name. Open, high, low,
close and volume all have conventional names worth defaulting to; VWAP does not,
and a consumer asking for it is asking for a price no other column approximates.
The close is not a worse VWAP, it is a different quantity, so a feed that does
not carry one must say so and let the consumer refuse.
Refs ml4t/agent-workspace#1017.
* fix: preserve VWAP columns in market data specs1 parent bb9d7c4 commit b17105b
2 files changed
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
| |||
251 | 257 | | |
252 | 258 | | |
253 | 259 | | |
| 260 | + | |
254 | 261 | | |
255 | 262 | | |
256 | 263 | | |
| |||
288 | 295 | | |
289 | 296 | | |
290 | 297 | | |
| 298 | + | |
291 | 299 | | |
292 | 300 | | |
293 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
0 commit comments