pineforge-codegen 1.0.0rc1__tar.gz → 1.1.0__tar.gz
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.
- pineforge_codegen-1.1.0/CHANGELOG.md +642 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/CONTRIBUTING.md +10 -8
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/PKG-INFO +124 -70
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/README.md +123 -69
- pineforge_codegen-1.1.0/VERSION +1 -0
- pineforge_codegen-1.1.0/docs/PUBLIC_CONTRACT.md +221 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/docs/pine-cap-activation.md +5 -5
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/__init__.py +24 -9
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/analyzer/base.py +190 -1
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/analyzer/call_handlers.py +2 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/analyzer/contracts.py +6 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/analyzer/types.py +16 -5
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/ast_nodes.py +7 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/base.py +136 -14
- pineforge_codegen-1.1.0/pineforge_codegen/codegen/checked_settings.py +272 -0
- pineforge_codegen-1.1.0/pineforge_codegen/codegen/collection_history.py +200 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/emit_top.py +76 -14
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/helpers.py +12 -2
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/host_members.py +8 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/input.py +36 -3
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/security.py +56 -1
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/ta.py +65 -1
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/types.py +136 -8
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/visit_call.py +92 -3
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/visit_expr.py +202 -3
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/visit_stmt.py +19 -4
- pineforge_codegen-1.1.0/pineforge_codegen/collection_history.py +1595 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/external_requests.py +3 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/parser.py +19 -4
- pineforge_codegen-1.1.0/pineforge_codegen/request_discovery.py +506 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/support_checker.py +37 -0
- pineforge_codegen-1.0.0rc1/CHANGELOG.md +0 -245
- pineforge_codegen-1.0.0rc1/VERSION +0 -1
- pineforge_codegen-1.0.0rc1/docs/PUBLIC_CONTRACT.md +0 -118
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/.gitignore +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/LEGAL.md +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/LICENSE +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/docs/codegen-coverage-gaps.md +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/analyzer/__init__.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/analyzer/diagnostics.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/analyzer/tables.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/block_locals.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/builtin_keywords.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/__init__.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/constant_fold.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/drawing.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/helpers_syminfo.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/session_market.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/tables.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/codegen/tv_number_format.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/errors.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/finite_ta_length.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/lexer.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/library_inline.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/library_modules.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/library_v5.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/limits.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/method_binding.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/pine_libraries.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/pine_spelling.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/pragmas.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/security_contexts.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/session_reads.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/signatures.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/symbols.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/tokens.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pineforge_codegen/tv_input_choices.py +0 -0
- {pineforge_codegen-1.0.0rc1 → pineforge_codegen-1.1.0}/pyproject.toml +0 -0
|
@@ -0,0 +1,642 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Release notes for `pineforge-codegen`. From 1.0.0 on, versions of codegen and
|
|
4
|
+
[`pineforge-engine`](https://github.com/pineforge-4pass/pineforge-engine) are
|
|
5
|
+
supported as exact pairs; on the 0.x line they are independent. See the
|
|
6
|
+
[pairing rule](README.md#engine-pairing).
|
|
7
|
+
|
|
8
|
+
## Release note policy
|
|
9
|
+
|
|
10
|
+
- Keep a section for each released version, including prereleases. Use the exact
|
|
11
|
+
tag version and release date when published; leave a planned release marked
|
|
12
|
+
**Unreleased** until its tag exists.
|
|
13
|
+
- Summarize changes users can observe: the Python and JSON contract, emitted C++
|
|
14
|
+
and engine requirements, support or warning changes, packaging, and security
|
|
15
|
+
fixes. Link the merged pull requests that supply each change.
|
|
16
|
+
- Call out migration steps and compatibility limits explicitly. A pair change
|
|
17
|
+
requires regenerated C++ and relinked strategy libraries, even when the C
|
|
18
|
+
ABI number is unchanged.
|
|
19
|
+
- Draft from merged changes since the previous release tag, then verify against
|
|
20
|
+
the release commit. A prerelease note describes changes since the preceding
|
|
21
|
+
prerelease or stable tag; the final stable note consolidates the series.
|
|
22
|
+
|
|
23
|
+
## 1.1.0 — 2026-10-04
|
|
24
|
+
|
|
25
|
+
A minor release: generated strategy libraries gain the checked settings
|
|
26
|
+
functions that engine `v1.1.0` adds to the C ABI, and `transpile_full()` lists
|
|
27
|
+
the other symbols' feeds a script requests. It covers the changes merged to
|
|
28
|
+
`main` since 1.0.1:
|
|
29
|
+
[#159](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/159)
|
|
30
|
+
changes the emitted C++,
|
|
31
|
+
[#164](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/164)
|
|
32
|
+
adds request discovery to the Python and JSON results, and
|
|
33
|
+
[#160](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/160) and
|
|
34
|
+
[#162](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/162) the
|
|
35
|
+
documentation. Codegen `1.1.0` supports only engine `v1.1.0`. Engine
|
|
36
|
+
`v1.1.0` declares six functions in `<pineforge/pineforge.h>`
|
|
37
|
+
([pineforge-engine#317](https://github.com/pineforge-4pass/pineforge-engine/pull/317))
|
|
38
|
+
that the C++ of codegen 1.1.0 defines; the pair keeps C ABI version 4 and the
|
|
39
|
+
script ABI epoch `engine_script_run_v19`.
|
|
40
|
+
|
|
41
|
+
### Compatibility and migration
|
|
42
|
+
|
|
43
|
+
- Regenerate C++ with 1.1.0 and relink it against engine `v1.1.0`'s headers
|
|
44
|
+
and `libpineforge.a`. The C++ includes `pineforge/checked_settings.hpp` and
|
|
45
|
+
compiles the checked settings functions only when the engine's headers
|
|
46
|
+
provide that file and define `PF_SETTINGS_API_VERSION` in
|
|
47
|
+
`pineforge/pineforge.h`, as engine `v1.1.0`'s do. Engine `v1.1.0`'s library
|
|
48
|
+
refuses to begin a run of a strategy whose setter failed (see "Exceptions at
|
|
49
|
+
the C ABI"). C++ generated by 1.0.1 has neither the checked functions nor
|
|
50
|
+
the exception handling.
|
|
51
|
+
- Every generated C++ file changes: it gains the settings code and the
|
|
52
|
+
exception handlers described below. Beyond that, the C++ changes only for
|
|
53
|
+
the enum defaults and the renamed names described below: for the engine's
|
|
54
|
+
325 public corpus sources and this repository's 277 gate fixtures, 1.1.0's
|
|
55
|
+
C++ with the settings code removed (`tests/_legacy_cpp.py`) is 1.0.1's C++
|
|
56
|
+
byte for byte, and the 13 fixtures the gate expects to be refused are refused
|
|
57
|
+
with the same message.
|
|
58
|
+
- Request discovery does not change the emitted C++
|
|
59
|
+
([#164](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/164)):
|
|
60
|
+
the engine's 325 public corpus sources and this repository's 540
|
|
61
|
+
test-fixture `.pine` files transpile to the same C++ as before it, byte for
|
|
62
|
+
byte, each in a fresh process, and the 51 refused are refused with the same
|
|
63
|
+
message.
|
|
64
|
+
- The Python and JSON contract is additive: `transpile_full()`'s result and
|
|
65
|
+
`gate/glue.py`'s `transpile_json` success envelope gain the key `requests`,
|
|
66
|
+
and each `input.symbol` entry of the input manifest gains
|
|
67
|
+
`"kind": "symbol"` (see "Request discovery"). No argument, result key or
|
|
68
|
+
envelope is removed or renamed, and `transpile()` and the error envelope are
|
|
69
|
+
unchanged. One value changes: the `default` reported for an `input.enum`
|
|
70
|
+
whose default is a variable (see "Enum input defaults").
|
|
71
|
+
- Report keys: the JSON report of the engine's Docker harness
|
|
72
|
+
(`docker/run_json.py`, which the `pineforge-release` image runs) keeps every
|
|
73
|
+
key it had with 1.0.1, `metrics.equity.sharpe_tv` and `sortino_tv` included,
|
|
74
|
+
and adds `applied_runtime.syminfo`, `{"qty_step": v, "mincontract": v}`,
|
|
75
|
+
present only when the `--syminfo` / `PINEFORGE_SYMINFO` file carries a valid
|
|
76
|
+
`syminfo.mincontract`, which the harness now applies as the lot grid
|
|
77
|
+
([pineforge-engine#322](https://github.com/pineforge-4pass/pineforge-engine/pull/322));
|
|
78
|
+
1.0.1 ignored it. `fingerprint.provenance.runtime` equals
|
|
79
|
+
`applied_runtime`, so a run on such a grid has a different fingerprint; for a
|
|
80
|
+
run without one, #322 changes no byte of the report apart from
|
|
81
|
+
`elapsed_seconds`. A `mincontract` the harness cannot apply is new failure
|
|
82
|
+
output: one stdout line `{"engine":"pineforge","error":...}`, harness exit
|
|
83
|
+
status 1 and image entrypoint exit status 4 (the existing backtest-failure
|
|
84
|
+
status), with `syminfo.mincontract must be a positive finite number, got
|
|
85
|
+
<json>` for an invalid value, or `the strategy library has no
|
|
86
|
+
strategy_set_syminfo_metadata, so syminfo.mincontract cannot be applied` for
|
|
87
|
+
a library without that function.
|
|
88
|
+
- The same harness also installs other symbols' bars for `request.security`
|
|
89
|
+
on another symbol: `--symbol-feeds <index.json>` (the image's
|
|
90
|
+
`PINEFORGE_SYMBOL_FEEDS`), a JSON index keyed by the exact symbol string the
|
|
91
|
+
script passes and by timeframe, each feed an OHLCV CSV, with the symbol's
|
|
92
|
+
catalog `syminfo`
|
|
93
|
+
([pineforge-engine#327](https://github.com/pineforge-4pass/pineforge-engine/pull/327),
|
|
94
|
+
[pineforge-release#23](https://github.com/pineforge-4pass/pineforge-release/pull/23)).
|
|
95
|
+
It needs one feed per requested timeframe: nothing aggregates another
|
|
96
|
+
symbol's bars. It installs them through `strategy_set_symbol_facts` and
|
|
97
|
+
`strategy_set_symbol_feed`, C ABI calls since 1.0.0, so the generated C++
|
|
98
|
+
does not change for it. What it installed is recorded as
|
|
99
|
+
`applied_runtime.symbol_feeds`, `{"canonicalization": ..., "symbols":
|
|
100
|
+
{"<symbol>": {"facts": {...}, "feeds": {"<timeframe>": {"bars": ...,
|
|
101
|
+
"first_ts": ..., "last_ts": ..., "source_values_sha256": ...}}}}}`, present
|
|
102
|
+
only when it installed a symbol, so such a run has its own fingerprint. An
|
|
103
|
+
index or a feed it cannot install fails the run the same way: one stdout
|
|
104
|
+
line `{"engine":"pineforge","error":"--symbol-feeds: ..."}`, harness exit
|
|
105
|
+
status 1, image entrypoint exit status 4.
|
|
106
|
+
- Between 1.0.1 and 1.1.0 a report's fingerprint differs in any case, since it
|
|
107
|
+
records the engine and codegen versions and the generated C++'s hash, and
|
|
108
|
+
the Pine adapter changes in engine `v1.1.0`
|
|
109
|
+
([pineforge-engine#315](https://github.com/pineforge-4pass/pineforge-engine/pull/315),
|
|
110
|
+
[#316](https://github.com/pineforge-4pass/pineforge-engine/pull/316)) can
|
|
111
|
+
change a run's trades.
|
|
112
|
+
|
|
113
|
+
### Checked strategy settings
|
|
114
|
+
|
|
115
|
+
Built against engine `v1.1.0`, a generated strategy library defines
|
|
116
|
+
`strategy_settings_api_version()`, which returns 1, and five checked functions
|
|
117
|
+
([#159](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/159)).
|
|
118
|
+
Each returns a `pf_settings_status_t`, writes its message to an optional
|
|
119
|
+
caller buffer and lets no exception through. The legacy setters still accept
|
|
120
|
+
or ignore what they accepted or ignored, an unknown key included; a value that
|
|
121
|
+
makes one of them throw now fails the strategy (see "Exceptions at the C
|
|
122
|
+
ABI").
|
|
123
|
+
|
|
124
|
+
- `strategy_set_input_checked` takes the key the legacy getters read: the
|
|
125
|
+
input's title, else its variable's name, else the empty key. Before it
|
|
126
|
+
changes anything, it refuses an unknown key, a key two inputs share, an
|
|
127
|
+
invalid boolean, enum member or option, trailing characters (`3x`), a
|
|
128
|
+
fractional or out-of-range int (`5.5`, `2147483648.0`), `NaN` and `Inf`, and
|
|
129
|
+
a value outside the input's `minval` / `maxval`. `step` is not enforced. An
|
|
130
|
+
`input.enum` is supported only when its options are literal members of one
|
|
131
|
+
enum.
|
|
132
|
+
- `strategy_set_override_checked` takes `initial_capital`,
|
|
133
|
+
`commission_value`, `default_qty_value`, `pyramiding`, `slippage`,
|
|
134
|
+
`process_orders_on_close`, `calc_on_order_fills`, `close_entries_rule`,
|
|
135
|
+
`default_qty_type` and `commission_type`, with the aliases the legacy setter
|
|
136
|
+
accepts (such as `strategy.cash`), and refuses an unknown key and an invalid
|
|
137
|
+
enum value, boolean or number.
|
|
138
|
+
- Both setters refuse once a run has processed a bar or a stream has begun.
|
|
139
|
+
- `strategy_create_checked` refuses a nonempty `params_json`, which the legacy
|
|
140
|
+
factory ignores.
|
|
141
|
+
- `strategy_get_effective_settings` writes a JSON receipt of every declared
|
|
142
|
+
input, inline inputs included, in source order, and of the overrides above:
|
|
143
|
+
type, options, default and effective value as canonical strings, and
|
|
144
|
+
`min` / `max` / `step` as numbers or `null`. Called with a NULL buffer and 0,
|
|
145
|
+
it returns `PF_SETTINGS_BUFFER_TOO_SMALL` and the size to allocate.
|
|
146
|
+
- `run_backtest_full_checked` runs the batch `run_backtest_full` runs and
|
|
147
|
+
returns `PF_SETTINGS_RUN_FAILED` for a failure the run reports and
|
|
148
|
+
`PF_SETTINGS_EXCEPTION` for an exception.
|
|
149
|
+
- Script names that the settings code uses (`config_`, `inputs_`,
|
|
150
|
+
`override_`, `last_error`, `last_error_`, `script_bars_processed`,
|
|
151
|
+
`stream_phase_`, `StreamPhase`, `checked_settings` and the `_pf_` helpers)
|
|
152
|
+
are renamed in the C++, so a script cannot shadow that code. Input keys are
|
|
153
|
+
unaffected.
|
|
154
|
+
|
|
155
|
+
The engine's `pineforge/pineforge.h` and `docs/checked-settings.md` give the
|
|
156
|
+
signatures, the statuses and the buffer rules.
|
|
157
|
+
|
|
158
|
+
### Exceptions at the C ABI
|
|
159
|
+
|
|
160
|
+
1.0.1's C++ let an exception thrown in a generated entry point propagate into
|
|
161
|
+
the host, where a C caller cannot catch it. From
|
|
162
|
+
[#159](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/159):
|
|
163
|
+
|
|
164
|
+
- `strategy_create`, `run_backtest`, `run_backtest_full`,
|
|
165
|
+
`strategy_set_input`, `strategy_set_override`,
|
|
166
|
+
`strategy_set_magnifier_volume_weighted`, `strategy_free` and `report_free`
|
|
167
|
+
catch every exception. `strategy_create` then returns NULL; `run_backtest`
|
|
168
|
+
and `run_backtest_full` zero the report and record `run_backtest: <message>`
|
|
169
|
+
(or `run_backtest_full: …`) as the error `strategy_get_last_error` returns.
|
|
170
|
+
- A legacy setter that throws, such as
|
|
171
|
+
`strategy_set_override(s, "pyramiding", "abc")`, fails the strategy for good.
|
|
172
|
+
`strategy_get_last_error` returns `strategy_set_override: <message>`;
|
|
173
|
+
`run_backtest` and `run_backtest_full` return an empty report;
|
|
174
|
+
`run_backtest_full_checked`, the checked setters and
|
|
175
|
+
`strategy_get_effective_settings` return `PF_SETTINGS_RUN_FAILED` with that
|
|
176
|
+
message; `strategy_stream_begin` returns -1 and `strategy_last_run_status`
|
|
177
|
+
1 (not completed). A call that clears the last error, such as feed
|
|
178
|
+
configuration, does not clear the failure: the next run reports it again.
|
|
179
|
+
Free the strategy and create a new one. A stream already running keeps the
|
|
180
|
+
settings it began with. A legacy setter that does not throw behaves as
|
|
181
|
+
before.
|
|
182
|
+
- With engine `v1.1.0`, `strategy_stream_begin` also fails with the message
|
|
183
|
+
and status 1 when preparing the script throws for any other reason; a batch
|
|
184
|
+
run keeps 1.0.1's empty report and completed status for such a failure
|
|
185
|
+
([pineforge-engine#317](https://github.com/pineforge-4pass/pineforge-engine/pull/317)).
|
|
186
|
+
|
|
187
|
+
### Enum input defaults
|
|
188
|
+
|
|
189
|
+
From [#159](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/159):
|
|
190
|
+
|
|
191
|
+
- A value that came out silently wrong: an `input.enum` whose default is a
|
|
192
|
+
variable, as in `defaultSide = Side.long` followed by
|
|
193
|
+
`input.enum(defaultSide, "Side")`, now defaults to that member. 1.0.1's C++
|
|
194
|
+
read the variable before the script assigned it, so unless the host set the
|
|
195
|
+
input, it held the enum's first member for the whole run.
|
|
196
|
+
- `transpile_full()`'s `inputs` and `transpile_json` report that member
|
|
197
|
+
(`"Side.long"`) as the input's `default`, where 1.0.1 reported `null`.
|
|
198
|
+
- This holds for a top-level variable declared once before the input, never
|
|
199
|
+
reassigned, and set to a literal member, directly or through another such
|
|
200
|
+
variable. With any other variable, such as a `var` or one set by an
|
|
201
|
+
expression (`c ? Side.long : Side.short`), the input reads it as 1.0.1's C++
|
|
202
|
+
does; `strategy_set_input_checked` refuses such an input as unsupported, and
|
|
203
|
+
the receipt reports its default as `na`.
|
|
204
|
+
|
|
205
|
+
### Request discovery
|
|
206
|
+
|
|
207
|
+
From [#164](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/164):
|
|
208
|
+
|
|
209
|
+
- `transpile_full()` returns a new key, `requests`: every request site that
|
|
210
|
+
reads another symbol's feed, so a host can fetch the bars a run needs before
|
|
211
|
+
it starts it. Each entry gives the request's `line` and `fn`, its symbol
|
|
212
|
+
(`literal`, `input` with its override key and default, `computed` with its
|
|
213
|
+
value at the inputs' defaults where literals and inputs compute it, or
|
|
214
|
+
`unresolvable`), its timeframe (`literal` in the engine's feed spelling,
|
|
215
|
+
`chart`, `input` or `computed`), `lookahead`, `gaps` and
|
|
216
|
+
`ignore_invalid_symbol`. A request lowered to `na` (its value reaches only
|
|
217
|
+
plots and alerts) is not listed. See the
|
|
218
|
+
[public contract](docs/PUBLIC_CONTRACT.md#request-discovery).
|
|
219
|
+
- `gate/glue.py`'s `transpile_json` success envelope carries the same list
|
|
220
|
+
under `requests`.
|
|
221
|
+
- The input manifest marks each `input.symbol` entry with `"kind": "symbol"`;
|
|
222
|
+
its `title`, `type` and `default` are unchanged.
|
|
223
|
+
|
|
224
|
+
### Documentation
|
|
225
|
+
|
|
226
|
+
- The README's parity scoreboard renders from the public facts tokens of
|
|
227
|
+
[`pineforge-release`](https://github.com/pineforge-4pass/pineforge-release),
|
|
228
|
+
and a release's grades are stated apart from the scoreboard of `main`
|
|
229
|
+
([#160](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/160));
|
|
230
|
+
no fact marker starts a line, so GitHub renders each sentence in its
|
|
231
|
+
paragraph ([#162](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/162)).
|
|
232
|
+
Release 1.1.0 is graded on registry baseline
|
|
233
|
+
`pineforge-parity-baseline-20261004-engine-7b596622`: 7,951 excellent and
|
|
234
|
+
38 strong of 7,989 graded probes, with engine 7b596622, which v1.1.0 equals
|
|
235
|
+
in behaviour: v1.1.0 adds a performance fix that its merge gate shows
|
|
236
|
+
changes no trade or report. This repository was at c5d97ee, whose emitted
|
|
237
|
+
C++ is codegen 1.1.0's.
|
|
238
|
+
- `docs/PUBLIC_CONTRACT.md` describes the checked settings functions and the
|
|
239
|
+
exception handling
|
|
240
|
+
([#159](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/159))
|
|
241
|
+
and request discovery
|
|
242
|
+
([#164](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/164)).
|
|
243
|
+
|
|
244
|
+
## 1.0.1 — 2026-10-02
|
|
245
|
+
|
|
246
|
+
A patch release of translation fixes. It covers the changes merged to `main`
|
|
247
|
+
since 1.0.0:
|
|
248
|
+
[#156](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/156) and
|
|
249
|
+
[#157](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/157)
|
|
250
|
+
change the translation, and
|
|
251
|
+
[#154](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/154) and
|
|
252
|
+
[#155](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/155)
|
|
253
|
+
the documentation. Codegen `1.0.1` supports only engine `v1.0.1`. Engine
|
|
254
|
+
`v1.0.1` changes only documentation since `v1.0.0`, so the pair keeps C ABI
|
|
255
|
+
version 4 and the script ABI epoch `engine_script_run_v19`.
|
|
256
|
+
|
|
257
|
+
### Compatibility and migration
|
|
258
|
+
|
|
259
|
+
- Regenerate C++ with 1.0.1 and relink it against engine `v1.0.1`'s headers
|
|
260
|
+
and `libpineforge.a`. A pair change requires it, even though the C ABI
|
|
261
|
+
number is unchanged.
|
|
262
|
+
- The Python and JSON contract is unchanged: `transpile()`,
|
|
263
|
+
`transpile_full()` and `gate/glue.py`'s `transpile_json` keep their
|
|
264
|
+
arguments, result keys and envelopes. No report key changes: the engine's
|
|
265
|
+
JSON report keeps the keys it had with 1.0.0, `metrics.equity.sharpe_tv`
|
|
266
|
+
and `sortino_tv` included.
|
|
267
|
+
- The engine's 325 public corpus sources and this repository's 277 gate
|
|
268
|
+
fixtures transpile to the same C++ as with 1.0.0, byte for byte (the 13
|
|
269
|
+
fixtures the gate expects to be refused are refused with the same message),
|
|
270
|
+
and so do the 1,384 real-world strategy sources the two pull requests
|
|
271
|
+
measured, transpiled in fresh processes.
|
|
272
|
+
- Some scripts that 1.0.0 transpiled are refused now, each with the code
|
|
273
|
+
TradingView's compiler refuses it with. Among them are an array's history
|
|
274
|
+
used as an operand or as a value (`a[1] + 1`, `c.push(a[1])`: CE10123),
|
|
275
|
+
which 1.0.0 read, with a warning, as an element of the current array, and
|
|
276
|
+
a method straight after a history read (`m[1].get(0, 0)`: CE10011), which
|
|
277
|
+
is written `(m[1]).get(0, 0)`. "Refused at compile time" below lists them
|
|
278
|
+
all.
|
|
279
|
+
|
|
280
|
+
### History of user-defined objects and drawings
|
|
281
|
+
|
|
282
|
+
1.0.0 emitted C++ that did not compile for the history of an object: it
|
|
283
|
+
declared a variable of a user-defined type or a drawing type whose history
|
|
284
|
+
was read `Series<double>`
|
|
285
|
+
([#156](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/156)).
|
|
286
|
+
|
|
287
|
+
- `obj[k]` is the reference the variable held k bars back, `na` before the
|
|
288
|
+
first, and `(obj[k]).field` reads that object as it is now, as on
|
|
289
|
+
TradingView, for boxes, lines and labels too. This holds for globals, `var`
|
|
290
|
+
objects, block and function locals, function parameters and method
|
|
291
|
+
receivers, and a drawing parameter's or receiver's history takes its
|
|
292
|
+
built-in methods (`(this[1]).get_top()`).
|
|
293
|
+
- In a function, a method and an `if` block the history counts the executions
|
|
294
|
+
of the scope. At a call site that skips bars, a function's object
|
|
295
|
+
parameter keeps one slot per chart bar, as TradingView does; a typed
|
|
296
|
+
method's receiver does not yet (see "Not covered" below).
|
|
297
|
+
- A temporary drawing passed to a drawing parameter compiles: a history read,
|
|
298
|
+
a new drawing or chart point, or a call's result.
|
|
299
|
+
- The history of an expression whose value is an object (`o.inner[1]`,
|
|
300
|
+
`f()[1]`, `(c ? a : b)[1]`) is the reference it produced at its previous
|
|
301
|
+
evaluation. Below a lazy edge, such as a `?:` arm, a read that is safe to
|
|
302
|
+
evaluate (a pure or constructor call over pure arguments, a ternary over
|
|
303
|
+
names, a named object's field) is kept on every bar, as TradingView keeps
|
|
304
|
+
it.
|
|
305
|
+
- `==` / `!=` compare two lines or two labels by identity, `na` included.
|
|
306
|
+
|
|
307
|
+
### History of arrays and matrices
|
|
308
|
+
|
|
309
|
+
1.0.0 emitted C++ that did not compile for the history of an array or a
|
|
310
|
+
matrix, such as `(a[1]).size()`, `array.size(a[1])` and `(m[1]).get(0, 0)`
|
|
311
|
+
([#157](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/157)).
|
|
312
|
+
|
|
313
|
+
- `a[k]` of an array or matrix variable, top-level or a block's local, is a
|
|
314
|
+
read-only copy of the collection as the variable left it at the end of its
|
|
315
|
+
scope's execution k executions back: the bar k bars back for a top-level
|
|
316
|
+
variable, the block's previous run for a block's local. A built-in reads
|
|
317
|
+
it, `na()` tests it, a variable or a function argument can hold it, and
|
|
318
|
+
`matrix.copy(m[1])` has the variable's element type. A `for...in` loop over
|
|
319
|
+
`a[1]` iterates the array the variable holds now, as on TradingView.
|
|
320
|
+
- Two sibling blocks that declare the same name keep a history each.
|
|
321
|
+
- A change to the copy, to a slice of it, or through a variable or parameter
|
|
322
|
+
bound to it stops the run with TradingView's runtime error RE10051. A method
|
|
323
|
+
on it before the variable has a history stops the run with RE10052 for an
|
|
324
|
+
array and RE10053 for a matrix.
|
|
325
|
+
|
|
326
|
+
### Int values in float fields
|
|
327
|
+
|
|
328
|
+
From [#157](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/157):
|
|
329
|
+
|
|
330
|
+
- `Cell.new(v = bar_index)`, a non-constant int given to a `float` field of a
|
|
331
|
+
user-defined type, compiles: the int converts to a double and an int `na`
|
|
332
|
+
to `na`. 1.0.0 narrowed it in a braced initializer, which did not compile.
|
|
333
|
+
- A value that came out silently wrong: `c.v := iv`, an int assigned to a
|
|
334
|
+
`float` field, stored an int `na` as -2147483648; it now stores `na`, as
|
|
335
|
+
TradingView does. On the `uassign_float` tape 112 of 336 exits differed
|
|
336
|
+
before.
|
|
337
|
+
- A bool given to a `float` field converts to 1 or 0 and is never `na`.
|
|
338
|
+
TradingView refuses a bool there (CE10123 in a constructor, CE10173 in an
|
|
339
|
+
assignment).
|
|
340
|
+
|
|
341
|
+
### Refused at compile time
|
|
342
|
+
|
|
343
|
+
A located `CompileError` now refuses, with TradingView's error code, what
|
|
344
|
+
TradingView's compiler refuses
|
|
345
|
+
([#156](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/156),
|
|
346
|
+
[#157](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/157)):
|
|
347
|
+
|
|
348
|
+
- a field or method straight after the history operator: `c[1].v` (CE10011),
|
|
349
|
+
`b[1].get_top()` (CE10010), `a[1].size()` (CE10011). The parenthesized
|
|
350
|
+
`(c[1]).v` is the valid spelling;
|
|
351
|
+
- the history of a field: a value field (`c.v[1]`, `(c.v)[1]`) and an
|
|
352
|
+
object's array, matrix or map field (`h.xs[1]`, `(h.xs)[1]`), CE10290;
|
|
353
|
+
- `==` / `!=` of references other than lines and labels (CE10123), and of a
|
|
354
|
+
reference with `na` (CE10187);
|
|
355
|
+
- an array's history where a number, a condition, a string or an element is
|
|
356
|
+
expected: an operator's operand, `nz`, `math.*`, a value slot of an array
|
|
357
|
+
function (`c.push(a[1])`, `array.new<float>(2, a[1])`), `log.*`'s message,
|
|
358
|
+
`label.new`'s text and `str.tostring` of a color array (CE10123); a scalar
|
|
359
|
+
variable or field (CE10173); an `if` or `while` condition (CE10101);
|
|
360
|
+
`array.from`, and `str.format` of a color array (CE10122); a bare statement
|
|
361
|
+
at the top level (CE10009).
|
|
362
|
+
|
|
363
|
+
Refused by name, where TradingView compiles the script; none of these
|
|
364
|
+
compiled under 1.0.0:
|
|
365
|
+
|
|
366
|
+
- the history of an object or a drawing inside a `request.security`
|
|
367
|
+
expression (TradingView reads the requested timeframe's objects, which
|
|
368
|
+
PineForge does not keep), and the history of a `chart.point` variable whose
|
|
369
|
+
fields the script changes (PineForge holds a point as a value)
|
|
370
|
+
([#156](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/156));
|
|
371
|
+
- an array or matrix history read whose earlier lowering did not compile,
|
|
372
|
+
but for the two gaps below
|
|
373
|
+
([#157](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/157)).
|
|
374
|
+
|
|
375
|
+
### Not covered
|
|
376
|
+
|
|
377
|
+
- A typed method's receiver at a call site that skips bars counts calls,
|
|
378
|
+
where TradingView keeps one slot per chart bar: from the third call on,
|
|
379
|
+
`this[2]` reads three bars further back
|
|
380
|
+
([#156](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/156)).
|
|
381
|
+
- The history of a function's array or matrix parameter or local, of a call's
|
|
382
|
+
result and of a selection is not kept (TradingView keeps one per call). Such
|
|
383
|
+
a read keeps 1.0.0's lowering where that compiled, and is refused otherwise
|
|
384
|
+
([#157](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/157)).
|
|
385
|
+
- Two kinds of history read keep the C++ they had, which does not compile: an
|
|
386
|
+
element function's value of a string array's history where the earlier
|
|
387
|
+
lowering is kept (in a function, a method, a loop or a block `var`), such
|
|
388
|
+
as `f() => str.length(array.first(s[1]))`; and the history of a variable or
|
|
389
|
+
a call that the analyzer does not type as an array or a matrix (a method's
|
|
390
|
+
or `matrix.row`'s new array, a selection of arrays, a tuple's element, an
|
|
391
|
+
array of drawings)
|
|
392
|
+
([#157](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/157)).
|
|
393
|
+
- PineForge holds no `na` array: a variable bound to a history before the
|
|
394
|
+
variable has one holds an empty array where TradingView's is `na`, and one
|
|
395
|
+
the script also tests with `na()` is refused
|
|
396
|
+
([#157](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/157)).
|
|
397
|
+
- As in 1.0.0, these do not compile: an int from `matrix.rows()`,
|
|
398
|
+
`columns()`, `elements_count()` or `strategy.wintrades` given to a `float`
|
|
399
|
+
field; `matrix.sum(m1, m2)` and other matrix results used without a
|
|
400
|
+
declared type; a method called on an operator expression
|
|
401
|
+
(`(close * 2).m()`). `str.tostring` of an array is not lowered.
|
|
402
|
+
|
|
403
|
+
### Documentation
|
|
404
|
+
|
|
405
|
+
- The README, the changelog and the docs describe the 1.0.0 release
|
|
406
|
+
([#154](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/154)),
|
|
407
|
+
and the README calls no version the latest
|
|
408
|
+
([#155](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/155)).
|
|
409
|
+
PyPI shows each release's README as its description, so 1.0.1's PyPI page
|
|
410
|
+
shows the README of the `v1.0.1` tag; 1.0.0's keeps the one it was uploaded
|
|
411
|
+
with.
|
|
412
|
+
|
|
413
|
+
## 1.0.0 — 2026-09-30
|
|
414
|
+
|
|
415
|
+
This is the 1.0 release note. It covers the changes merged to `main`
|
|
416
|
+
since 0.10.4 (2026-09-06), through
|
|
417
|
+
[#152](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/152);
|
|
418
|
+
[#153](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/153)
|
|
419
|
+
then updated the documentation. Codegen `1.0.0` supports only engine
|
|
420
|
+
`v1.0.0`; `1.0.0-rc.1` supports only engine `v1.0.0-rc.1`. The notes of
|
|
421
|
+
0.10.4 and earlier releases are on the
|
|
422
|
+
[GitHub releases page](https://github.com/pineforge-4pass/pineforge-codegen-oss/releases).
|
|
423
|
+
|
|
424
|
+
### Compatibility and execution
|
|
425
|
+
|
|
426
|
+
- Generated strategies use the engine's `PineStrategyHost` source layer and
|
|
427
|
+
explicitly attach Pine execution policies and cap compatibility
|
|
428
|
+
([#127](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/127),
|
|
429
|
+
[#128](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/128),
|
|
430
|
+
[#129](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/129)).
|
|
431
|
+
Regenerate C++ and relink libraries for the exact engine pair.
|
|
432
|
+
- Reused strategy handles reset persistent generated state before a new run
|
|
433
|
+
([#126](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/126)).
|
|
434
|
+
Price-less `strategy.exit` follows the bracket-cancel command and the
|
|
435
|
+
first-tick predicate uses its accessor
|
|
436
|
+
([#130](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/130)).
|
|
437
|
+
- A `strategy()` that omits `initial_capital`, `default_qty_type` or
|
|
438
|
+
`default_qty_value` gets TradingView's Pine v6 defaults (100,000,
|
|
439
|
+
`strategy.percent_of_equity`, 100); before, the engine's own defaults
|
|
440
|
+
applied (1,000,000 and 1 contract)
|
|
441
|
+
([#147](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/147)).
|
|
442
|
+
Such a script sizes its orders differently and can book different trades;
|
|
443
|
+
declare the arguments to keep the old sizing.
|
|
444
|
+
- `time()` / `time_close()` with a nonzero `bars_back` or
|
|
445
|
+
`timeframe_bars_back` read another bar's time through the engine host's
|
|
446
|
+
`pine_time_offset`, which the paired engine provides
|
|
447
|
+
([#152](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/152)).
|
|
448
|
+
|
|
449
|
+
### Pine translation and diagnostics
|
|
450
|
+
|
|
451
|
+
- Replace Python expression execution in constant folding with bounded
|
|
452
|
+
evaluation ([#125](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/125)).
|
|
453
|
+
Preserve `na` when double-valued expressions enter integer slots
|
|
454
|
+
([#131](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/131)).
|
|
455
|
+
- Inline `input.*()` TA lengths use the same reset and override path as bound
|
|
456
|
+
inputs ([#133](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/133)).
|
|
457
|
+
`ta.change` receives its lookback in `compute()`, and input titles are
|
|
458
|
+
escaped consistently
|
|
459
|
+
([#134](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/134)).
|
|
460
|
+
- Input overrides reach precalculated TA sites; `ta.valuewhen`, VWAP anchors,
|
|
461
|
+
input keys, and Pine string escapes follow the validated spellings
|
|
462
|
+
([#135](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/135)).
|
|
463
|
+
TA arguments are routed by signature; multiline strings, nested input keys,
|
|
464
|
+
generic `input()` lengths, and formatted `log.*` calls are covered
|
|
465
|
+
([#136](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/136)).
|
|
466
|
+
- Bare `ta.tr`, located parser errors, TradingView numeric text,
|
|
467
|
+
`str.format(formatString=...)`, string-safe trace pragmas, and the native
|
|
468
|
+
floating-point contraction flag are pinned by tests
|
|
469
|
+
([#138](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/138)).
|
|
470
|
+
The paired TA1 engine handles ALMA `floor`, KC `useTrueRange`, explicit
|
|
471
|
+
VWAP anchors, and pivot-level anchors/developing values
|
|
472
|
+
([#139](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/139)).
|
|
473
|
+
- `na` follows Pine's rules wherever the generated C++ converts a value: it
|
|
474
|
+
is false in `if`, `?:`, `and`/`or` and boolean parameters, an integer
|
|
475
|
+
conversion of `na` stays `na`, and stored booleans and dynamic series
|
|
476
|
+
indices keep it. Keltner Channel middle bands are `na` until their length
|
|
477
|
+
is warm, as on TradingView. Standalone `ta.ema` warmup, collection history
|
|
478
|
+
and a nullable `str.repeat` result, which the engine cannot yet represent
|
|
479
|
+
exactly, now warn
|
|
480
|
+
([#140](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/140)).
|
|
481
|
+
- An inverted `array.fill` range leaves the array unchanged and an inverted
|
|
482
|
+
`array.slice` raises TradingView's runtime error, as on TradingView; every
|
|
483
|
+
`array.slice` warns that PineForge copies the slice where TradingView
|
|
484
|
+
aliases it. `request.security` resolves a chart-symbol name by lexical
|
|
485
|
+
scope, so a function-local rebind no longer blocks an unrelated global
|
|
486
|
+
([#140](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/140)).
|
|
487
|
+
A `?:` symbol that can select another symbol warned there; see the next
|
|
488
|
+
section for what it does since #148.
|
|
489
|
+
|
|
490
|
+
### Libraries and requests for outside data
|
|
491
|
+
|
|
492
|
+
- Pine library imports are inlined at transpile time: pass the sources as
|
|
493
|
+
`transpile(..., libraries={"user/name/version": source})`, or let the
|
|
494
|
+
script's own requests manifest pin them (`$PINEFORGE_PINE_LIBRARIES` with
|
|
495
|
+
`$PINEFORGE_REQUESTS_ROOT`). Only what the script reaches is inlined, and a
|
|
496
|
+
v5 library is lowered by v5's rules or refused naming the rule it would
|
|
497
|
+
need ([#148](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/148)).
|
|
498
|
+
An import whose alias is `ta`, `math` or `str` and that names only that
|
|
499
|
+
namespace's built-ins is a no-op
|
|
500
|
+
([#146](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/146)).
|
|
501
|
+
Any other import without a source is still refused.
|
|
502
|
+
- A `request.security` of another symbol whose value can reach a trade reads
|
|
503
|
+
the feed a requests manifest pins for that symbol, and stops the run where
|
|
504
|
+
its value is read when none is installed; it never reads the chart's bars in
|
|
505
|
+
its place. A `?:` symbol that
|
|
506
|
+
can select another symbol and whose value can reach a trade registers the
|
|
507
|
+
symbol the run computes
|
|
508
|
+
([#148](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/148)).
|
|
509
|
+
- `request.financial`, `request.earnings`, `request.dividends` and
|
|
510
|
+
`request.splits` read the per-bar series a requests manifest records, and a
|
|
511
|
+
`request.security` whose expression is `request.footprint(ticks, va)` reads
|
|
512
|
+
the pinned feed's delta column
|
|
513
|
+
([#148](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/148)).
|
|
514
|
+
Without that data, a request whose value reaches only plots, alerts, tables
|
|
515
|
+
or logs lowers to `na` with a warning, and one that can reach a trade stops
|
|
516
|
+
the run where its value is read
|
|
517
|
+
([#146](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/146)).
|
|
518
|
+
- A `request.security` symbol, timeframe or payload parameter that reaches the
|
|
519
|
+
request through helper functions resolves on every call path, one context
|
|
520
|
+
per value
|
|
521
|
+
([#146](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/146),
|
|
522
|
+
[#148](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/148)).
|
|
523
|
+
Payloads accept helpers with mixed tuples, multi-statement bodies and `var`
|
|
524
|
+
state ([#144](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/144)),
|
|
525
|
+
read `input.source` values and `hl2`-family history on the requested bars,
|
|
526
|
+
register a computed lower timeframe with its first-bar value, keep epochs in
|
|
527
|
+
64 bits ([#146](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/146)),
|
|
528
|
+
and run helper `for` / `while` loops and a global's history on the requested
|
|
529
|
+
bars ([#152](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/152)).
|
|
530
|
+
|
|
531
|
+
### Sessions
|
|
532
|
+
|
|
533
|
+
- `session.ismarket`, `session.ispremarket` and `session.ispostmarket` read the
|
|
534
|
+
engine's session calendar and in-session facts, and `session.isfirstbar` /
|
|
535
|
+
`islastbar` and their `_regular` forms read the engine's session-day members
|
|
536
|
+
([#142](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/142),
|
|
537
|
+
[#145](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/145),
|
|
538
|
+
[#150](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/150)).
|
|
539
|
+
Inside a `request.security` payload they keep time-of-day predicates and
|
|
540
|
+
warn. `session.<flag>[k]` reads the flag's history
|
|
541
|
+
([#144](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/144)).
|
|
542
|
+
|
|
543
|
+
### Values that came out silently wrong
|
|
544
|
+
|
|
545
|
+
- Pine's `int` is 64-bit: constant arithmetic such as `400 * 7200000` folds in
|
|
546
|
+
64 bits, and an integer sum or product whose operands' known bounds can
|
|
547
|
+
leave the 32-bit range (`days * 86400000`), or a product that `%` or `/`
|
|
548
|
+
reads, is computed in 64 bits
|
|
549
|
+
([#149](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/149),
|
|
550
|
+
[#151](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/151),
|
|
551
|
+
[#152](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/152)).
|
|
552
|
+
- Inputs are read before `var` initializers
|
|
553
|
+
([#144](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/144)),
|
|
554
|
+
and a `var` read with history initializes at its declaration
|
|
555
|
+
([#149](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/149)).
|
|
556
|
+
- `fixnan` and 17 other built-in argument slots evaluate their argument once, a
|
|
557
|
+
function returns its last statement's value, and a script variable read
|
|
558
|
+
with history inside a function reads that call site's history
|
|
559
|
+
([#146](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/146)).
|
|
560
|
+
An `if` without `else` that runs no arm is `na`
|
|
561
|
+
([#148](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/148)).
|
|
562
|
+
- A deleted or collected drawing reads as `na`, and drawings are collected
|
|
563
|
+
as TradingView collects them
|
|
564
|
+
([#146](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/146)).
|
|
565
|
+
- `color.new` / `color.rgb` bind a keyword transparency like a positional one
|
|
566
|
+
([#151](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/151)),
|
|
567
|
+
and a fractional input or series transparency rounds to the nearest alpha
|
|
568
|
+
byte as TradingView's does, where it was truncated
|
|
569
|
+
([#150](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/150)).
|
|
570
|
+
A fractional constant `color.new` transparency, which TradingView
|
|
571
|
+
truncates, now rounds too: a known divergence (10.5 reads back 11 where
|
|
572
|
+
TradingView reads 10).
|
|
573
|
+
- A function whose untyped parameter receives different types gets one body
|
|
574
|
+
per call site
|
|
575
|
+
([#151](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/151)).
|
|
576
|
+
- A binary operator evaluates its left operand first when the other operand
|
|
577
|
+
can observe its effect
|
|
578
|
+
([#147](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/147)).
|
|
579
|
+
|
|
580
|
+
### Other translation changes
|
|
581
|
+
|
|
582
|
+
- A `ta.*` length fixed for the run builds the constant-length indicator on
|
|
583
|
+
its first execution, and a series length of `ta.highest`, `ta.lowest`,
|
|
584
|
+
`ta.highestbars` or `ta.lowestbars` re-windows every call, and
|
|
585
|
+
`ta.supertrend` takes a series factor or ATR length and reads the values of
|
|
586
|
+
its first execution, as TradingView does; a series length of any other
|
|
587
|
+
`ta.*` stays refused
|
|
588
|
+
([#144](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/144)).
|
|
589
|
+
- A `switch` arm written on its `=>` line may be a comma list of statements,
|
|
590
|
+
library overloads that differ by qualifier bind as TradingView binds them, a
|
|
591
|
+
generic `input()` takes its default's type, and `syminfo.timezone` spells a
|
|
592
|
+
UTC exchange zone `Etc/UTC`
|
|
593
|
+
([#152](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/152)).
|
|
594
|
+
- A script that declares `use_bar_magnifier = true` exports
|
|
595
|
+
`strategy_declares_bar_magnifier()` to the host, and `syminfo.mincontract`
|
|
596
|
+
reads the symbol fact the run declares
|
|
597
|
+
([#146](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/146)).
|
|
598
|
+
|
|
599
|
+
### Limits and generated names
|
|
600
|
+
|
|
601
|
+
- Untrusted source that would crash or hang the transpiler raises a located
|
|
602
|
+
`CompileError`: source over 5 MiB (TradingView's 5MB compilation request),
|
|
603
|
+
nesting over 512 levels, or a transpilation over 120 seconds (TradingView's
|
|
604
|
+
compile limit). There is no statement-count limit. A 500-link `?:` chain, a
|
|
605
|
+
500-branch `else if` ladder and a 2,000-element `array.from` transpile and
|
|
606
|
+
compile; deeply nested calls no longer take exponential time.
|
|
607
|
+
`transpile()` raises Python's recursion limit to 20,480 frames when it is
|
|
608
|
+
lower. Numeric literals outside the C++ range raise a located error
|
|
609
|
+
([#140](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/140)).
|
|
610
|
+
- A Pine name that is a C++17/C++20 keyword, a standard macro or an engine
|
|
611
|
+
name (for example `namespace`, `NULL` or `Box`) compiles: the generated C++
|
|
612
|
+
spells it `pf_safe_<name>`, for variables, parameters, types, fields and
|
|
613
|
+
tuple or loop bindings alike
|
|
614
|
+
([#140](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/140)).
|
|
615
|
+
A script name that equals a host member the generated class reads is
|
|
616
|
+
escaped too
|
|
617
|
+
([#144](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/144)).
|
|
618
|
+
|
|
619
|
+
### Packaging and documentation
|
|
620
|
+
|
|
621
|
+
- Update the direct build-tool `tar` dependency past the reported advisories
|
|
622
|
+
and require a high-severity npm audit in release and publish gates
|
|
623
|
+
([#140](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/140)).
|
|
624
|
+
- Limit the Python source archive to package code and release documents so a
|
|
625
|
+
VCS-free RC build cannot include installed Node dependencies or generated
|
|
626
|
+
gate payloads
|
|
627
|
+
([#140](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/140)).
|
|
628
|
+
- One `VERSION` value gives every channel its spelling: a prerelease such as
|
|
629
|
+
`1.0.0-rc.1` ships as PyPI `1.0.0rc1`, on npm dist-tag `next` and as a
|
|
630
|
+
GitHub prerelease, never as `latest`
|
|
631
|
+
([#141](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/141)).
|
|
632
|
+
- Document the supported Python and gate/glue JSON contract, exact engine
|
|
633
|
+
pairing, contribution checks, and release-note policy. Classify the package
|
|
634
|
+
as Production/Stable for the 1.0 release
|
|
635
|
+
([#140](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/140)).
|
|
636
|
+
|
|
637
|
+
## 1.0.0-rc.1 — 2026-09-30
|
|
638
|
+
|
|
639
|
+
The release candidate for 1.0.0. Its changes since 0.10.4 are the ones listed
|
|
640
|
+
under 1.0.0; 1.0.0 changed only the version after it. It shipped as PyPI
|
|
641
|
+
`1.0.0rc1`, on npm dist-tag `next` and as a GitHub prerelease, and supports
|
|
642
|
+
only engine `v1.0.0-rc.1`.
|