@hoox-sh/pynets 0.9.0 → 0.10.0
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.
- package/CHANGELOG.md +15 -0
- package/README.md +9 -1
- package/dist/browser.js +63 -63
- package/dist/index.js +382 -37
- package/package.json +1 -1
- package/src/cli/rich.ts +1 -1
- package/src/index.ts +1 -1
- package/src/runtime/array.ts +19 -0
- package/src/runtime/clone.ts +26 -0
- package/src/runtime/compile/collections.ts +13 -0
- package/src/runtime/compile/emit.ts +19 -1
- package/src/runtime/compile/emit_call.ts +15 -0
- package/src/runtime/compile/types.ts +2 -0
- package/src/runtime/interpret.ts +259 -40
- package/src/runtime/map.ts +25 -0
- package/src/runtime/matrix.ts +25 -0
- package/src/runtime/series.ts +6 -0
- package/src/runtime/strategy.ts +32 -0
- package/src/runtime/ta.ts +28 -0
- package/src/runtime/udt.ts +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.10.0] - 2026-11-04
|
|
11
|
+
|
|
12
|
+
Multi-tick realtime windows, reference `varip`, and list subscripts.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- `RuntimeOptions.realtimeTicks` / `realtimeBars` / `realtimeFromBar` — Python `realtime_ticks` / `realtime_bars` / `realtime_from_bar` realtime windows with `_resolve_realtime_first` precedence (`realtimeFromBar` > `realtimeBars` > last-bar flags).
|
|
16
|
+
- Per-tick rollback for intermediate realtime ticks: `var` scope, container contents (array/map/UDT/matrix, in place so aliases keep identity), UDF-site `var` state and series pushes, plot cells, TA windows, and broker state — matching Python `_run_batch`.
|
|
17
|
+
- `barstate.isnew` is `0` after the first realtime tick; `barstate.isconfirmed` is `0` on intermediate ticks; `once` and `alert.freq_once_per_bar_close` commit on confirmed bars only, `alert.freq_all` fires every tick.
|
|
18
|
+
- List subscript `g[0]` on array-valued names (Python `visit_Subscript` newest-first semantics: `value[-(offset + 1)]`, OOB → na), on both interpret and JS compile, for names bound from `ta.gamma_levels`, `array.from`, `array.new*`, `array.copy`, `array.concat`, `array.slice`.
|
|
19
|
+
- `TaEngine.snapshot`/`restore`, `StrategyBook.snapshot`/`restore`, and `snapshotContents`/`restoreContents`/`clone` on `PineArray`/`PineMap`/`UdtInstance`/`PineMatrix`; `PineSeries.truncate`; shared `cloneValue`.
|
|
20
|
+
- Exported `resolveRealtimeWindow`.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- `varip` now initializes once and persists across historical bars (previously re-initialized every bar like a plain assignment), and re-runs its initializer on every realtime tick (reference `varip`) — matching Python `visit_Assign` `ast.VarIp` handling.
|
|
24
|
+
|
|
10
25
|
## [0.9.0] - 2026-11-04
|
|
11
26
|
|
|
12
27
|
Realtime stream session API and forming-bar semantics.
|
package/README.md
CHANGED
|
@@ -187,7 +187,15 @@ stream.close(); // confirm the last bar (realtimeLastBar: false)
|
|
|
187
187
|
```
|
|
188
188
|
|
|
189
189
|
`Runtime.run(src, bars, { realtimeLastBar: true })` exposes the same flag for a
|
|
190
|
-
single call.
|
|
190
|
+
single call. Multi-tick realtime windows work too (Python `realtime_ticks` /
|
|
191
|
+
`realtime_bars` / `realtime_from_bar`):
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
// Visit bars 12.. as realtime, 3 ticks per bar: intermediate ticks roll back
|
|
195
|
+
// var / TA / broker / plot state (varip persists, plots capture the final tick).
|
|
196
|
+
rt.run(src, bars, { realtimeFromBar: 12, realtimeTicks: 3 });
|
|
197
|
+
rt.run(src, bars, { realtimeBars: 5, realtimeTicks: 2 });
|
|
198
|
+
```
|
|
191
199
|
|
|
192
200
|
### Bars you actually have
|
|
193
201
|
|