pineforge-codegen 1.10.0__tar.gz → 1.11.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.10.0 → pineforge_codegen-1.11.0}/CHANGELOG.md +177 -4
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/CONTRIBUTING.md +3 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/PKG-INFO +13 -3
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/README.md +11 -2
- pineforge_codegen-1.11.0/VERSION +1 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/docs/PUBLIC_CONTRACT.md +242 -36
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/docs/ci.md +87 -22
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/docs/codegen-coverage-gaps.md +48 -41
- pineforge_codegen-1.11.0/docs/engine-main-ci.md +339 -0
- pineforge_codegen-1.11.0/docs/reference/adding-a-pine-function.md +40 -0
- pineforge_codegen-1.11.0/docs/reference/conventions.md +156 -0
- pineforge_codegen-1.11.0/docs/reference/file-map.md +186 -0
- pineforge_codegen-1.11.0/docs/reference/known-codegen-quirks.md +490 -0
- pineforge_codegen-1.11.0/docs/reference/pipeline.md +74 -0
- pineforge_codegen-1.11.0/docs/reference/support-contracts.md +340 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/__init__.py +40 -9
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/analyzer/base.py +649 -117
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/analyzer/call_handlers.py +39 -1
- pineforge_codegen-1.11.0/pineforge_codegen/analyzer/callable_history_names.py +273 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/analyzer/contracts.py +8 -1
- pineforge_codegen-1.11.0/pineforge_codegen/analyzer/qualifiers.py +444 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/analyzer/types.py +79 -6
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/analyzer/value_bindings.py +23 -1
- pineforge_codegen-1.11.0/pineforge_codegen/array_binding.py +49 -0
- pineforge_codegen-1.11.0/pineforge_codegen/builtin_keywords.py +93 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/array_field_width.py +2 -0
- pineforge_codegen-1.11.0/pineforge_codegen/codegen/array_slice.py +444 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/base.py +297 -69
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/capabilities.py +4 -0
- pineforge_codegen-1.11.0/pineforge_codegen/codegen/capacities.py +139 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/checked_settings.py +22 -10
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/closed_trade_fold.py +29 -2
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/collection_history.py +23 -3
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/constant_fold.py +4 -1
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/drawing.py +90 -7
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/emit_top.py +104 -20
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/helpers.py +136 -10
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/host_members.py +5 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/input.py +37 -22
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/order_shapes.py +14 -4
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/run_stops.py +40 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/security.py +1265 -172
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/ta.py +133 -89
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/tables.py +159 -22
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/timeframe_values.py +106 -12
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/types.py +1663 -151
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/visit_call.py +462 -168
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/visit_expr.py +282 -52
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/visit_stmt.py +448 -149
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/diagnostics_catalog.json +25 -3
- pineforge_codegen-1.11.0/pineforge_codegen/drawing_all.py +239 -0
- pineforge_codegen-1.11.0/pineforge_codegen/input_keys.py +88 -0
- pineforge_codegen-1.11.0/pineforge_codegen/intrinsic_binding.py +166 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/loop_types.py +6 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/method_binding.py +15 -2
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/parser.py +12 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/request_discovery.py +7 -1
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/security_contexts.py +256 -37
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/signatures.py +140 -58
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/support_checker.py +229 -43
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pyproject.toml +1 -0
- pineforge_codegen-1.10.0/VERSION +0 -1
- pineforge_codegen-1.10.0/pineforge_codegen/builtin_keywords.py +0 -42
- pineforge_codegen-1.10.0/pineforge_codegen/intrinsic_binding.py +0 -50
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/.gitignore +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/LEGAL.md +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/LICENSE +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/docs/pine-cap-activation.md +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/analyzer/__init__.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/analyzer/diagnostics.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/analyzer/operators.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/analyzer/tables.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/ast_nodes.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/block_locals.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/__init__.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/ascii.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/bool_text.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/color_constants.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/constant_values.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/endless_for.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/for_loops.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/graph_journal.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/helpers_syminfo.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/history_sharing.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/id_sites.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/session_market.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/strategy_declaration.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/codegen/tv_number_format.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/collection_history.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/cpp_allowlist.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/cpp_names.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/diagnostic_codes.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/errors.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/external_requests.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/finite_ta_length.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/function_overloads.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/lexer.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/library_inline.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/library_modules.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/library_v5.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/limits.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/matrix_overloads.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/pine_libraries.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/pine_spelling.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/pragmas.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/request_feed_inventory.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/session_reads.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/symbols.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/timeframe_token_cli.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/tokens.py +0 -0
- {pineforge_codegen-1.10.0 → pineforge_codegen-1.11.0}/pineforge_codegen/tv_input_choices.py +0 -0
|
@@ -22,6 +22,175 @@ supported as exact pairs; on the 0.x line they are independent. See the
|
|
|
22
22
|
|
|
23
23
|
## Unreleased (next release)
|
|
24
24
|
|
|
25
|
+
- `str.format_time` now uses TradingView's documented defaults when arguments
|
|
26
|
+
are omitted: `"yyyy-MM-dd'T'HH:mm:ssZ"` for the format and the exchange time
|
|
27
|
+
zone (`syminfo.timezone`) for the timezone. Pass `"yyyy-MM-dd"` and `"UTC"`
|
|
28
|
+
explicitly to restore the previous output. Regenerate C++ and relink
|
|
29
|
+
affected strategies.
|
|
30
|
+
- A `when` argument on a strategy order call in Pine v6 now reports `PF-E2081`,
|
|
31
|
+
explaining that v6 removed the argument and recommending an `if` statement
|
|
32
|
+
around the call. Other unknown keywords keep `PF-E2027`.
|
|
33
|
+
- Pine identifiers spelled like generated state members or helpers use the C++ name allocator, including history-bearing locals in requested helpers.
|
|
34
|
+
- A local declared in a function or method and spelled like a built-in variable now keeps its own type, history storage and reads. Exceptions: a string local spelled like a price field (`open`, `high`, `low`, `close`, `hl2`, `hlc3`, `hlcc4`, `ohlc4`, `volume`) that is read with history in a function requested through `request.security` is still refused, as before; a string local that is read with history and used in a concatenation still does not compile, for any name; the support check still warns that `bar_index`, `last_bar_index` and `timenow` diverge from TradingView at every read of a local with that name; a script that declares the same built-in name in several callable shapes is accepted where an ordinary name is refused by the shared-Series check; and the confirmed-bar request receipt of a request inside the declaring function names the local by its internal storage spelling.
|
|
35
|
+
- History retention can be selected with keyword-only `history_capacity`
|
|
36
|
+
in `transpile()`, `transpile_full()`, `transpile_with_request_inventory()`
|
|
37
|
+
and `gate/glue.py::transpile_json()`. The JavaScript worker template does
|
|
38
|
+
not pass this option. Without a Pine directive, large constant offsets
|
|
39
|
+
infer sufficient bare history and dynamic offsets select this package's
|
|
40
|
+
5000-slot retention default. Static operator overflow and invalid capacities
|
|
41
|
+
have typed diagnostics. Explicit runtime history bounds
|
|
42
|
+
stop with `pine_runtime_limit` and arguments `limit=max_bars_back`, `max=N`;
|
|
43
|
+
in-capacity warmup reads retain their missing-value behavior. A Pine
|
|
44
|
+
`max_bars_back` larger than `history_capacity` keeps its slots in the
|
|
45
|
+
stores, but the offset checks use `history_capacity` alone. Requested-helper
|
|
46
|
+
history references preserve their C++ members when a helper local or a
|
|
47
|
+
mutable global that the request reads has the same name as one of them.
|
|
48
|
+
Regenerate C++ and relink affected strategies.
|
|
49
|
+
- `drawing_capacity`, accepted by `transpile()`, `transpile_full()`,
|
|
50
|
+
`transpile_with_request_inventory()` and `gate/glue.py::transpile_json()`,
|
|
51
|
+
bounds live lines, boxes and labels independently after
|
|
52
|
+
Pine's existing collection step. Creating or copying beyond the selected
|
|
53
|
+
bound stops with `pine_runtime_limit` and arguments `limit=live_drawings`,
|
|
54
|
+
`max=N`. Pine declaration counts keep their ordinary TradingView collection
|
|
55
|
+
behavior; linefills are outside the bound. Typed stops require the paired
|
|
56
|
+
engine catalog's `live_drawings` value. Omitting the option preserves drawing
|
|
57
|
+
emission and collection. The JavaScript worker template does not pass this
|
|
58
|
+
option. Capacities outside the native int64 domain are refused even for
|
|
59
|
+
scripts without drawings. Regenerate C++ and relink affected strategies.
|
|
60
|
+
- Typed `array.from()` initializers now match their declared element type, including function-local `var` and `varip` arrays of timestamps.
|
|
61
|
+
- Variables initialized from `backadjustment.*`, `settlement_as_close.*` and
|
|
62
|
+
`adjustment.*` constants now use integer storage in emitted C++.
|
|
63
|
+
- `int(x)` of a floating value, and a stored `math.floor(x)`, `math.ceil(x)`
|
|
64
|
+
or `math.round(x)`, is a 64-bit integer whatever its magnitude, as in
|
|
65
|
+
TradingView: `int(1.7e12)`, `int(math.floor(1.7e12))` and
|
|
66
|
+
`v = math.floor(1.7e12)` are all 1700000000000. The generated C++ used to
|
|
67
|
+
read such a value outside the 32-bit range as the integer `na`
|
|
68
|
+
(-2147483648), which then flowed into arithmetic as that number. A value
|
|
69
|
+
that does not fit 64 bits, and a NaN, read `na` on every compiler and
|
|
70
|
+
architecture. A variable, function result, record field or int array that
|
|
71
|
+
holds the result of such an expression is `int64_t`, and a function
|
|
72
|
+
parameter that receives one follows. A 32-bit integer `na` (`int(na)`,
|
|
73
|
+
`bar_index`, a narrow input) that meets one of them in a selection arm, a
|
|
74
|
+
position of a tuple-valued selection, a store or a `request.security`
|
|
75
|
+
payload stays `na` instead of becoming the
|
|
76
|
+
number -2147483648. A history read (`int(x[1])`), a builtin float member
|
|
77
|
+
(`int(strategy.equity)`) and a float field of a record (`int(b.v)`) count as
|
|
78
|
+
floating values too. This changes generated C++ for scripts that use these
|
|
79
|
+
forms: regenerate and relink affected strategies.
|
|
80
|
+
- Repeated explicit input titles now have separate override keys: the first
|
|
81
|
+
keeps the bare title, and later inputs use `<title>#<n>`, starting at 2 and
|
|
82
|
+
skipping authored titles and keys already assigned. The manifest, effective
|
|
83
|
+
settings receipt and input getters use the same keys. The checked input
|
|
84
|
+
setter now accepts the bare title for the first input instead of refusing
|
|
85
|
+
it as ambiguous; the legacy input setter now sets only the first input
|
|
86
|
+
instead of every input with that title. Repeated explicit titles no longer
|
|
87
|
+
trigger the shared-key warning; remaining collisions involving untitled
|
|
88
|
+
fallbacks still warn.
|
|
89
|
+
- A chart TA constructor length that shadows a global input or constant now follows its lexical binding; a series length for `ta.percentile_nearest_rank` now uses the engine's `SeriesPercentileNearestRank` buffer at each call site, including repeated calls from a loop. A call inside a conditional appends only when it runs. `PF-E5092` remains the refusal for a series length of `ta.sma` (#295), and its message names the Pine function (`ta.sma`, not `ta::SMA`) and says that TradingView accepts the call. Every other `ta.*` function keeps `PF-E5009` and its wording, which makes no claim about TradingView: the functions where TradingView refuses a series length too (`ta.rma`, `ta.ema`, `ta.rsi`, `ta.atr`, `ta.dmi`, `ta.macd`, `ta.kc`, `ta.hma`, `ta.tsi`, `ta.rci` and the `atrPeriod` of `ta.supertrend`) and the ones with no recorded result.
|
|
90
|
+
- Constant-expression input defaults can size TA constructors while retaining the input getter in runtime resets (#295).
|
|
91
|
+
- A `request.security` payload may read a global that is an element of a tuple declaration of a pure user function (`[_, g] = pair(x)` with `pair(value) => [value, value + 7.0]`), directly or through a function that reads it: the declaration is evaluated on the requested bar, as in TradingView, and only the element read is lowered. The function must have a one-tuple-literal body over its parameters, the requested bar's fields and literals, and be called positionally with arguments that have no state. A function with a `ta.*` call, `var`, `varip`, a request or a method, a multi-statement body, and the history of an element (`g[1]`) keep their refusals.
|
|
92
|
+
- `line(na)` and `box(na)` emit the same missing handles as typed drawing declarations initialized with `na` (#295).
|
|
93
|
+
- Literal `na` in emitted strategy string parameters uses the empty-string sentinel, including `strategy.exit`'s `from_entry` (#295).
|
|
94
|
+
- Array bindings destructured from a helper's tuple retain their collection type for built-in method calls (#295).
|
|
95
|
+
- `if` and `switch` expressions reassigned to a history-bearing variable update its current Series slot (#295).
|
|
96
|
+
- Pine identifiers `bar` and `HUGE` use the existing C++ name escape without changing authored input titles (#295).
|
|
97
|
+
- Colliding direct scalar history locals in ordinary functions get declaration-owned Series storage and retain separate call-site histories, including computed initializers that read a same-named global and locals of different scalar families (#295).
|
|
98
|
+
- Direct `size`, `first`, `last` and `get` reads of `line.all`, `box.all`, `label.all` and `linefill.all` use live arena order; aliases and mutations raise `PF-E5086`, and `polyline.all` requires engine support (`PF-E5085`) (#295).
|
|
99
|
+
- C++ name escaping covers the macros defined by the audited math, limits, C++ wrapper and paired engine headers, retaining authored input keys (#295).
|
|
100
|
+
- A keyword argument of a built-in call reaches its own parameter. `timeframe.in_seconds(timeframe = ...)` and `timeframe.change(timeframe = ...)` used the chart's timeframe instead of the named one, `strategy.closedtrades.*(trade_num = ...)` and `strategy.opentrades.*(trade_num = ...)` read trade 0 instead of the named trade, `str.format_time(time, timezone = ...)` read the timezone as the format, `timestamp(timezone = ..., year = ..., ...)` dropped the timezone and a skipped `hour` moved `minute` into its slot, `matrix.new<float>(rows = 2, columns = 3)` built a matrix with no rows and no columns, `time("60", timezone = ...)` and `time_close` read the timezone as the session, and `math.random(seed = 3)` read the seed as the minimum; none of them raised a diagnostic. A keyword none of these calls declares is now refused with the unknown-keyword diagnostic, as TradingView refuses it. Regenerate C++ and relink strategies.
|
|
101
|
+
- Strategy order calls report unknown keyword arguments at the keyword
|
|
102
|
+
(#286;
|
|
103
|
+
[#327](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/327)).
|
|
104
|
+
- Strategy orders with omitted `qty` use the default size; integer `switch` and
|
|
105
|
+
`if` results with an explicit `na` arm preserve NaN, and
|
|
106
|
+
`strategy.risk.allow_entry_in` retains input-dependent directions (#292).
|
|
107
|
+
- `strategy.risk.max_drawdown()` and `strategy.risk.max_intraday_loss()` called with `type = strategy.percent_of_equity`, or with `strategy.percent_of_equity` held in a variable, apply the percentage limit as the positional form does. The keyword and variable forms were read as an amount of account currency, so a limit of 10 halted trading early (#325, #326, #327). Regenerate C++ and relink strategies.
|
|
108
|
+
- `max_bars_back(series, DEPTH)` with a `const int` `DEPTH` keeps that many bars of history for the series, as the literal depth does. The named constant was ignored, so history reads beyond the default depth returned `na` (#326, #327). Regenerate C++ and relink strategies.
|
|
109
|
+
- A `var` array with a non-empty initializer declared inside an `if` block is initialized when the declaration is first reached, as in TradingView. The generated code reset it to empty and did not apply the initializer, so `array.size` and element reads differed (#333, #327). Regenerate C++ and relink strategies.
|
|
110
|
+
- Methods whose first parameter is never referenced in their body now report `PF-E5087` at that parameter, with a hint to use it or declare a function instead.
|
|
111
|
+
- Consumed `if`/`switch` selections mixing value and void arms now report located `PF-E5088`; requested void selections keep `PF-E3102`.
|
|
112
|
+
- A `request.security` payload that reads the history of an expression inside
|
|
113
|
+
a loop, or at several reads of one helper parameter, commits one history
|
|
114
|
+
slot per requested bar holding the last evaluation of that bar, as
|
|
115
|
+
TradingView does. Every read of the bar sees the history before this bar.
|
|
116
|
+
Regenerate C++ and relink strategies (#287;
|
|
117
|
+
[#327](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/327)).
|
|
118
|
+
- `request.security` registers input-derived `lookahead` selections using the
|
|
119
|
+
selected input values, including overrides; choices that depend on bar data
|
|
120
|
+
still report `PF-E1085`. A scalar empty timeframe still uses the chart
|
|
121
|
+
timeframe; an `if`/`switch` timeframe arm known to be empty still reports
|
|
122
|
+
`PF-E3105`.
|
|
123
|
+
History reads of requested values now compile inside another request's TA
|
|
124
|
+
expression, including aliases and repeated reads. Uncalled request wrappers
|
|
125
|
+
no longer interfere with compiling unrelated direct requests (#294;
|
|
126
|
+
[#327](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/327)).
|
|
127
|
+
- `input.enum` options named through immutable enum-member declarations now retain their choices and checked-settings support.
|
|
128
|
+
- Array fields in records that stay within one bar preserve omitted and explicit `na` IDs, distinct from empty arrays.
|
|
129
|
+
- Copying a record that stays within one bar shares its array fields while keeping scalar fields independent.
|
|
130
|
+
- A block-local `string` declaration at top level may now shadow a script-level `float` binding with declared or literal types without sharing storage; every other cross-type shadow keeps its existing refusal.
|
|
131
|
+
- A series variable declared or written inside a loop now opens one history
|
|
132
|
+
slot per bar at the first reach and updates it on later iterations, as in
|
|
133
|
+
TradingView. Previously, each iteration opened a separate slot, so `y[i]`
|
|
134
|
+
could read prior iterations instead of prior bars. Expression histories in
|
|
135
|
+
loops also keep one slot per bar, holding its last evaluation. Functions
|
|
136
|
+
read current globals produced by tuple declarations; ordinary `string`
|
|
137
|
+
declarations initialized with `na` reset on each execution; named
|
|
138
|
+
array-constructor arguments bind to `size` and `initial_value`.
|
|
139
|
+
Reassigned ordinary inputs restart from the selected input value at their
|
|
140
|
+
declaration on each bar; `var` and `varip` inputs retain their accumulated
|
|
141
|
+
state. Regenerate C++ and relink strategies
|
|
142
|
+
(#291; [#324](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/324),
|
|
143
|
+
[#327](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/327)).
|
|
144
|
+
- Runtime history offsets below 0 or above 10000 stop at the read with an
|
|
145
|
+
error naming the Pine line and offset, before integer narrowing. Constant
|
|
146
|
+
offsets keep their existing behavior (#311;
|
|
147
|
+
[#327](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/327)).
|
|
148
|
+
- `timestamp("...")` now accepts full English month names, including
|
|
149
|
+
`"01 February 2024 00:00"`. The existing 64-bit timestamp handling through
|
|
150
|
+
`input.time` and function or tuple results is preserved (#293;
|
|
151
|
+
[#327](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/327)).
|
|
152
|
+
- `timestamp("...")` date strings with a `UTC` or `GMT` zone word now give
|
|
153
|
+
TradingView's value for four forms that differed. A negative zone with a
|
|
154
|
+
zero hour keeps its sign (`GMT-00:30`, `UTC-0:30`). Minutes of 60 or more
|
|
155
|
+
are dropped and the hours kept (`UTC+01:60`, `UTC+00:90`). A number without
|
|
156
|
+
a sign after the word is ignored (`UTC30`, `UTC5`). With a numeric offset
|
|
157
|
+
and a word in one string the last one decides (`+0000 UTC+2`,
|
|
158
|
+
`UTC+2 +0000`). `UTC5` and `UTC+2 +0000` are no longer refused.
|
|
159
|
+
- `timestamp("...")` with a UTC or GMT zone word of 24 hours or more, for
|
|
160
|
+
example `UTC+24`, `GMT-24` or `UTC+25`, now translates instead of stopping
|
|
161
|
+
with an internal `ValueError`. As in TradingView, the zone word is plain
|
|
162
|
+
arithmetic on the date fields: the value is the fields read as UTC minus the
|
|
163
|
+
signed offset.
|
|
164
|
+
- In `//@version=6` scripts and libraries, type field defaults containing calls
|
|
165
|
+
or user-declared variable references now report `PF-E2087` at the default
|
|
166
|
+
expression's first token. V5 sources keep their earlier handling.
|
|
167
|
+
- `strategy.default_entry_qty(fill_price)` reads the engine host's query of the
|
|
168
|
+
default order size at a price (`default_entry_qty`); it used to lower to an
|
|
169
|
+
undeclared function, so a script that used it did not build. It needs an
|
|
170
|
+
engine whose strategy host provides the query. The calls TradingView refuses
|
|
171
|
+
are refused too, at the offending argument or call, also inside the arm of a
|
|
172
|
+
switch: no price, a second price, a price given both by position and by name,
|
|
173
|
+
an unknown argument name (`PF-E1088`), and a string, bool, color or
|
|
174
|
+
collection price (`PF-E2083` to `PF-E2086`, only for a type the syntax proves).
|
|
175
|
+
- PF-W1505 now explains both EMA seeding modes and names the engine run option
|
|
176
|
+
`series_origin_ms`, passed through the run's `syminfo`. The default first-value
|
|
177
|
+
seed matches TradingView charts with history before the range; when the
|
|
178
|
+
reference starts at the range start, declaring its first bar's open time in
|
|
179
|
+
epoch milliseconds selects `na` for the first `length-1` bars followed by an
|
|
180
|
+
SMA seed. This also applies to `ta.macd` and `ta.tsi`; `ta.kc` and `ta.kcw`
|
|
181
|
+
already start that way in every run, because the generated code applies the
|
|
182
|
+
warm-up to their EMA basis. Declared origins
|
|
183
|
+
start `request.security` at the first whole higher-timeframe bucket at or
|
|
184
|
+
after that time, with plain expressions `na` until its first bar completes.
|
|
185
|
+
In a measured 336-exit reference starting at the range start, 37 exit comments
|
|
186
|
+
differ by default, including 5 finite values where TradingView is `na`; none
|
|
187
|
+
differ with the origin declared. Six corpus cases add, drop or shift 1 to 3
|
|
188
|
+
trades in the first days by default; all six are exact with the declared
|
|
189
|
+
origin. A wrong origin gives wrong values; do not set it for live runs, where
|
|
190
|
+
it has no defined meaning. `ta.rsi`, `ta.rma` and `ta.atr` already use SMA
|
|
191
|
+
seeds. Migration: none; undeclared runs are unchanged. The diagnostic stays
|
|
192
|
+
an unconditional note at each `ta.ema` call; this text change leaves generated
|
|
193
|
+
C++ unchanged.
|
|
25
194
|
- An affine chart loop proved endless is stopped with the loop-time error when
|
|
26
195
|
its result reaches an effect. Omission is limited to an unused loop statement
|
|
27
196
|
with no calls, whose writes have no readers except self-updates, a break
|
|
@@ -30,6 +199,10 @@ supported as exact pairs; on the 0.x line they are independent. See the
|
|
|
30
199
|
may drop them. Endless loops in functions, methods and `request.security`
|
|
31
200
|
still never end here while TradingView stops them; data-dependent endless
|
|
32
201
|
loops still hang.
|
|
202
|
+
- Missing integer values remain `na` in float writes, numeric selections,
|
|
203
|
+
float arguments and arithmetic. Explicit float declarations keep fractional
|
|
204
|
+
values after integer initialization. Regenerate C++ and relink strategies.
|
|
205
|
+
|
|
33
206
|
- Pine v6 calls refuse a positional argument after a named argument with
|
|
34
207
|
`PF-E2074` at that positional expression. The check also covers strategy
|
|
35
208
|
declarations, unused functions and v6 library bodies before lowering.
|
|
@@ -397,8 +570,8 @@ changes the emitted C++ and the other two only the repository's own CI.
|
|
|
397
570
|
contract: the `promote-baseline` workflow refuses untrusted heads and actors
|
|
398
571
|
(SEC846,
|
|
399
572
|
[#242](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/242)),
|
|
400
|
-
and `test.yml` adopts the organization's CI canon
|
|
401
|
-
[#243](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/243)).
|
|
573
|
+
and `test.yml` adopts the organization's CI canon
|
|
574
|
+
([#243](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/243)).
|
|
402
575
|
|
|
403
576
|
## 1.6.3 — 2026-10-23
|
|
404
577
|
|
|
@@ -468,8 +641,8 @@ emitter, a change of the licensor's written entity, and CI changes.
|
|
|
468
641
|
- New command `pf-cpp-allowlist` (`pineforge_codegen.cpp_allowlist:main`,
|
|
469
642
|
installed with the package), a checker for a generated C++ translation unit
|
|
470
643
|
that flags dangerous primitives
|
|
471
|
-
([#210](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/210)
|
|
472
|
-
|
|
644
|
+
([#210](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/210)).
|
|
645
|
+
It is a denylist with known false positives, a mitigation and not
|
|
473
646
|
proof that a unit is safe (the wording of the 1.6.3 security advisory).
|
|
474
647
|
- A script identifier equal to a symbol that the checker refuses when it appears
|
|
475
648
|
bare (`system`, `free`, `socket`, `open` and the rest of the list in
|
|
@@ -7,6 +7,9 @@ line with `git commit -s`. Material contributions also require a Contributor
|
|
|
7
7
|
License Agreement so PINEFORGE LLC can include them in its commercial licenses;
|
|
8
8
|
contact luis@4pass.com.tw before opening a material pull request.
|
|
9
9
|
|
|
10
|
+
Read the [emission invariant](AGENTS.md#emission-invariant) before changing
|
|
11
|
+
the translator: it governs lowerings, refusals and generated-C++ failures.
|
|
12
|
+
|
|
10
13
|
## Local setup
|
|
11
14
|
|
|
12
15
|
Use Python 3.11 or newer, Node 22, a C++17 compiler, CMake, and a matching
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pineforge-codegen
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.11.0
|
|
4
4
|
Summary: PineScript v6 to C++ transpiler that targets the pineforge-engine runtime.
|
|
5
5
|
Project-URL: Homepage, https://github.com/pineforge-4pass/pineforge-codegen-oss
|
|
6
6
|
Project-URL: Issues, https://github.com/pineforge-4pass/pineforge-codegen-oss/issues
|
|
@@ -280,6 +280,7 @@ Classifier: Programming Language :: Python :: 3.14
|
|
|
280
280
|
Classifier: Topic :: Office/Business :: Financial
|
|
281
281
|
Requires-Python: >=3.11
|
|
282
282
|
Provides-Extra: dev
|
|
283
|
+
Requires-Dist: pytest-xdist>=3.5; extra == 'dev'
|
|
283
284
|
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
284
285
|
Description-Content-Type: text/markdown
|
|
285
286
|
|
|
@@ -641,6 +642,10 @@ gives every field.
|
|
|
641
642
|
|
|
642
643
|
### Transpile a file to a `.cpp`
|
|
643
644
|
|
|
645
|
+
Missing integers stay `na` when used as floats, including history reads,
|
|
646
|
+
assignments and float parameters. Regenerate C++ and relink strategy libraries
|
|
647
|
+
to apply corrections to previously generated code.
|
|
648
|
+
|
|
644
649
|
```python
|
|
645
650
|
from pathlib import Path
|
|
646
651
|
from pineforge_codegen import transpile
|
|
@@ -690,8 +695,10 @@ lists what 1.0.0 reads, warns about or refuses for such requests.
|
|
|
690
695
|
### Skip the support checker
|
|
691
696
|
|
|
692
697
|
`check_support=False` on either Python function is **experimental**. It
|
|
693
|
-
bypasses the gate
|
|
694
|
-
faithfully
|
|
698
|
+
bypasses the support gate. Existing paths can produce C++ the engine will
|
|
699
|
+
not accept or execute faithfully; those are defects under the
|
|
700
|
+
[emission invariant](AGENTS.md#emission-invariant), which applies even when
|
|
701
|
+
the gate is bypassed. See the [open defects](docs/codegen-coverage-gaps.md).
|
|
695
702
|
|
|
696
703
|
```python
|
|
697
704
|
from pathlib import Path
|
|
@@ -730,6 +737,9 @@ fields, such as `// @pf-trace gap=close - e` or
|
|
|
730
737
|
pragma itself is not computed: `// @pf-trace rsi=ta.rsi(close, 14)` records
|
|
731
738
|
`na` on every bar, and its C++ carries an `/* unsupported: ta.rsi */` marker.
|
|
732
739
|
0.10.4, 1.0.0, 1.0.1, 1.1.0, 1.2.0 and 1.3.0 all behave this way.
|
|
740
|
+
This placeholder is an implementation gap under the
|
|
741
|
+
[emission invariant](AGENTS.md#emission-invariant); see the
|
|
742
|
+
[open defects](docs/codegen-coverage-gaps.md).
|
|
733
743
|
|
|
734
744
|
### Advanced: run the pipeline stages directly
|
|
735
745
|
|
|
@@ -356,6 +356,10 @@ gives every field.
|
|
|
356
356
|
|
|
357
357
|
### Transpile a file to a `.cpp`
|
|
358
358
|
|
|
359
|
+
Missing integers stay `na` when used as floats, including history reads,
|
|
360
|
+
assignments and float parameters. Regenerate C++ and relink strategy libraries
|
|
361
|
+
to apply corrections to previously generated code.
|
|
362
|
+
|
|
359
363
|
```python
|
|
360
364
|
from pathlib import Path
|
|
361
365
|
from pineforge_codegen import transpile
|
|
@@ -405,8 +409,10 @@ lists what 1.0.0 reads, warns about or refuses for such requests.
|
|
|
405
409
|
### Skip the support checker
|
|
406
410
|
|
|
407
411
|
`check_support=False` on either Python function is **experimental**. It
|
|
408
|
-
bypasses the gate
|
|
409
|
-
faithfully
|
|
412
|
+
bypasses the support gate. Existing paths can produce C++ the engine will
|
|
413
|
+
not accept or execute faithfully; those are defects under the
|
|
414
|
+
[emission invariant](AGENTS.md#emission-invariant), which applies even when
|
|
415
|
+
the gate is bypassed. See the [open defects](docs/codegen-coverage-gaps.md).
|
|
410
416
|
|
|
411
417
|
```python
|
|
412
418
|
from pathlib import Path
|
|
@@ -445,6 +451,9 @@ fields, such as `// @pf-trace gap=close - e` or
|
|
|
445
451
|
pragma itself is not computed: `// @pf-trace rsi=ta.rsi(close, 14)` records
|
|
446
452
|
`na` on every bar, and its C++ carries an `/* unsupported: ta.rsi */` marker.
|
|
447
453
|
0.10.4, 1.0.0, 1.0.1, 1.1.0, 1.2.0 and 1.3.0 all behave this way.
|
|
454
|
+
This placeholder is an implementation gap under the
|
|
455
|
+
[emission invariant](AGENTS.md#emission-invariant); see the
|
|
456
|
+
[open defects](docs/codegen-coverage-gaps.md).
|
|
448
457
|
|
|
449
458
|
### Advanced: run the pipeline stages directly
|
|
450
459
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.11.0
|