You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c33724c
Browse filesBrowse the repository at this point in the historyBrowse files
Merge engine main into the security timeframe warning
Engine main took the 1.12.0 release, a CI change and the close quantity
step fix. This branch still carries the earlier commits of that fix,
while main has it as one squashed commit, so the merge from their common
base reports conflicts in the files both touched. Each is resolved to
main's version plus this branch's own change; apart from the files named
below, the merged tree adds exactly this branch's change to main.
- CHANGELOG.md: main's sentence on an invalid mintick and point value,
followed by this branch's three entries.
- docs/design/native-feature-parity.md, row P8: main's wording, with the
line numbers of the merged sources.
- docker/run_failure_codes_diff.json: regenerated with
scripts/gen_run_failure_catalog_diff.py --write against the 1.12.0
catalog, not merged by hand.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ version number follows semantic versioning over the surfaces the
15
15
- A memory failure during a session-calendar lookup now fails the run with a typed error instead of reading the bar as out of session.
16
16
- A failed `setenv` or a memory failure during a timezone switch now fails the run instead of continuing in the previous zone or in UTC.
17
17
- A timezone database lookup that fails because no file descriptors or memory are available, an input/output error occurs, or the database is missing now fails the run with an engine error instead of reporting an incorrect timezone name.
18
-
- A timezone name written in a script that the engine does not accept now raises `pine_timezone_error` with the function and zone instead of silently reading UTC. This addition to the public failure catalog requires a minor release. The message is TradingView's text with the engine's bar prefix, `Error on bar N: `, or `Error before the first bar: ` when no bar is being executed, and the arguments carry `bar_index`.
18
+
- A timezone name written in a script that the engine's own calendar functions do not accept now raises `pine_timezone_error` with the function and zone instead of silently reading UTC. Code that the transpiler generates for `timestamp()` still reads a zone that the host cannot load as UTC, without an error (with a zone argument, and without one on a symbol whose zone is not UTC); that is fixed in a later release. This addition to the public failure catalog requires a minor release. The message is TradingView's text with the engine's bar prefix, `Error on bar N: `, or `Error before the first bar: ` when no bar is being executed, and the arguments carry `bar_index`.
19
19
- The void C setters for instrument and run settings now record exceptions on
20
20
the handle, including allocation failures and changes refused by the engine.
21
21
`strategy_last_run_status` reads 1; `strategy_get_last_error` and
@@ -29,12 +29,12 @@ version number follows semantic versioning over the surfaces the
29
29
read through `strategy_state_query_status_v1`.
30
30
- Non-positive or NaN `mintick` or `pointvalue` values in `--syminfo`, and
31
31
`path_order` modes outside 0, 1 and 2, now produce typed refusals instead of
32
-
being ignored or reset to AUTO. Invalid point values use the existing symbol
33
-
metadata error.
32
+
being ignored or reset to AUTO. An invalid `mintick` is refused as `symbol_feeds_refused` with reason
33
+
`syminfo_mintick_invalid`; an invalid point value uses the existing symbol metadata error, `symbol_metadata_rejected` with field `point_value`.
34
34
-`strategy_get_run_warnings` exposes one named warning per `request.security` call site whose requested timeframe is not a multiple of its evaluator's feed timeframe; values, trades and run acceptance are unchanged (#718).
35
35
- The Docker report and `scripts/run_strategy.py` now show the engine's run warnings as `diagnostics.warnings` when a run has any, and are unchanged otherwise (#718).
36
36
- A percent-of-equity default quantity above 100 percent is now capped at 100 percent of equity when `margin_long` and `margin_short` are both 0 (#805).
37
-
-`strategy.close(qty = ...)` now floors the quantity to the declared quantity step and closes that much, as TradingView does; a quantity that floors to zero or exceeds the entry id's position closes that whole position. Positive explicit `strategy.exit(qty = ...)` quantities now floor to the declared step; a quantity below one step is ignored, so the exit covers the whole position with the default `qty_percent = 100`, as TradingView does. Measured against TradingView on one instrument and lot (a 0.00001 step, pyramiding 1, the default close rule, one entry id); not measured: `close_entries_rule = "ANY"`, pyramided entry ids, whole-unit steps, lots that are not a power of ten, and a sub-step `strategy.exit` quantity with `qty_percent` below 100 (#716).
37
+
-`strategy.close(qty = ...)` now floors the quantity to the declared quantity step and closes that much, as TradingView does; a quantity that floors to zero or exceeds the entry id's position closes that whole position. Positive explicit `strategy.exit(qty = ...)` quantities now floor to the declared step; a quantity below one step is ignored unless `qty_percent` is below 100, so with the default `qty_percent = 100` the exit covers the whole position, as TradingView does; with `qty_percent` below 100 such a quantity is kept as given, as before. Measured against TradingView on one instrument and lot (a 0.00001 step, pyramiding 1, the default close rule, one entry id); not measured: `close_entries_rule = "ANY"`, pyramided entry ids, whole-unit steps, lots that are not a power of ten, and a sub-step `strategy.exit` quantity with `qty_percent` below 100 (#716).
38
38
- With `process_orders_on_close` and the default FIFO close rule, the named `strategy.exit` calls of a reversing `strategy.entry` with an explicit quantity, placed in the same execution after a `strategy.close` of the old position, are now sized from the new entry's own quantity: a percentage exit takes its share of the new entry and an absolute-quantity exit keeps its quantity, instead of being sized from a basis reduced by the old position (#803).
39
39
- Without `process_orders_on_close`, the named `strategy.exit` calls placed with a reversing `strategy.entry` of explicit quantity now take their percentage from the new entry when its size differs from the position it replaces, and a take-profit given as an absolute quantity now fires; before, the percentage was taken from the position being replaced and an absolute-quantity take-profit never fired (#803).
40
40
-`strategy.risk.max_drawdown` is now tested at the order fills that close units, on the equity at that fill with open positions included, against the highest equity at such fills (the equity at an opening fill or at a bar close does not raise it), and a breach closes every open position at that fill's price (exit text "Close Position (Max Drawdown)"), cancels the pending orders and blocks later entries; before, it was measured once per bar close and only refused new entries (#804).
"description": "A timezone argument is not accepted by the calendar. TradingView runtime error RE10133. bar_index is the bar being executed, and -1 when the stop is raised before the first bar (the message then begins \"Error before the first bar: \" instead of \"Error on bar N: \").",
50
-
"english": [
51
-
"Error on bar {bar_index}: Incorrect `timezone` value for the {function}() function: \"{zone}\". The value must be a string in either UTC/GMT notation (e.g. \"UTC-5\", \"GMT+0530\") or an IANA time zone database name (e.g. \"America/New_York\")."
52
-
],
53
-
"retryable": false,
54
-
"since": "1.12.0"
55
-
}
56
-
}
57
-
],
18
+
"added": [],
58
19
"changed": [
59
-
{
60
-
"code": "pine_string_error",
61
-
"collection": "codes",
62
-
"fields": [
63
-
{
64
-
"path": "args.reason.values",
65
-
"beforePresent": true,
66
-
"afterPresent": true,
67
-
"before": [
68
-
"substring_out_of_range",
69
-
"format_index_overflow"
70
-
],
71
-
"after": [
72
-
"substring_out_of_range",
73
-
"format_index_overflow",
74
-
"invalid_regex_pattern",
75
-
"regex_resource_limit"
76
-
]
77
-
},
78
-
{
79
-
"path": "english",
80
-
"beforePresent": true,
81
-
"afterPresent": true,
82
-
"before": [
83
-
"basic_string::substr: __pos (which is {pos}) > this->size() (which is {size})",
84
-
"stoul"
85
-
],
86
-
"after": [
87
-
"basic_string::substr: __pos (which is {pos}) > this->size() (which is {size})",
88
-
"stoul",
89
-
"Invalid regex pattern in the 'str.match' function.",
90
-
"A regular expression exceeds the limits of the engine's regular-expression library."
Copy file name to clipboardExpand all lines: docs/design/native-feature-parity.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1671,7 +1671,7 @@ the rule gives 9.9 + 9.89).
1671
1671
| P5 | **Test asymmetry:** 430 adapter test files vs 14 native when this plan was written (on this tree 486 `tests/*.cpp` name `source::PineStrategyHost`, 128 `NativeStrategyHost`) | native-only tests in every lane (§3.1 b) | O |
1672
1672
| P6 | **Stream vs batch.** The stream refuses monthly input, mixed modes, in-session gaps, security feeds and source setters, and tick input under an FX curve (any non-empty curve until the FX stream audit) (`native-engine.md`, "Stream limitations (current)") | L5 and L6 must state which refusals are generic and which are deliberate source limits | S |
1673
1673
| P7 | **C ABI variant growth** | §2.iii hardening rules | S |
1674
-
| P8 | **Unverified in the inputs:** whether `execution::LifecycleEffects` (execution.hpp:136-139) is ever non-empty from the Pine path, else `PlacementSnapshot::legs` (pine_adapter.hpp:385) is the only live lifecycle (O); the `strategy.risk.allow_entry_in` setter chain beyond `set_pine_risk_direction` pine_strategy_host.cpp:1245 → `set_risk_direction` pine_adapter.cpp:27365 (O); what the ABI receipts pin (F); the probe corpus itself lives outside this tree (F) | verify inside the lane that touches each | F O |
1674
+
| P8 | **Unverified in the inputs:** whether `execution::LifecycleEffects` (execution.hpp:136-139) is ever non-empty from the Pine path, else `PlacementSnapshot::legs` (pine_adapter.hpp:385) is the only live lifecycle (O); the `strategy.risk.allow_entry_in` setter chain beyond `set_pine_risk_direction` pine_strategy_host.cpp:1245 → `set_risk_direction` pine_adapter.cpp:27365 (O); what the ABI receipts pin (F); the probe corpus itself lives outside this tree (F) | verify inside the work item that touches each | F O |
Copy file name to clipboardExpand all lines: docs/pages/pine-to-native.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,7 +192,7 @@ source-only features state why a native counterpart does not exist.
192
192
| SZ9 | Mapped by the migration table above. |
193
193
| SZ10 | No separate native counterpart: Pine money rounding is an adapter policy over the native sizing basis. |
194
194
| SZ10a | No separate native counterpart: the money band's affordable price is TradingView's ten-significant-digit whole-drop price, adapter policy measured on the famr / famr3 tapes; every money-to-units conversion the adapter makes is the kernel's `native_sized_units`. |
195
-
| SZ11 | No separate native counterpart: Pine quantity floors are adapter policy; native `quantity_grid` is the generic knob. With a declared quantity step, a positive finite `strategy.close(qty = ...)` quantity is floored to that step; a quantity that floors to zero or exceeds the entry id's position closes that whole position. Positive explicit `strategy.exit(qty = ...)` quantities also floor to that step; a quantity below one step is ignored, so the exit covers the whole position with the default `qty_percent = 100`, as TradingView does. Measured on a 0.00001 step with pyramiding 1, the default close rule and one entry id; `close_entries_rule = "ANY"`, pyramided entry ids, whole-unit steps, lots that are not a power of ten and a sub-step exit quantity with `qty_percent` below 100 are not measured. |
195
+
| SZ11 | No separate native counterpart: Pine quantity floors are adapter policy; native `quantity_grid` is the generic knob. With a declared quantity step, a positive finite `strategy.close(qty = ...)` quantity is floored to that step; a quantity that floors to zero or exceeds the entry id's position closes that whole position. Positive explicit `strategy.exit(qty = ...)` quantities also floor to that step; a quantity below one step is ignored unless `qty_percent` is below 100, so with the default `qty_percent = 100` the exit covers the whole position, as TradingView does; with `qty_percent` below 100 such a quantity is kept as given. Measured on a 0.00001 step with pyramiding 1, the default close rule and one entry id; `close_entries_rule = "ANY"`, pyramided entry ids, whole-unit steps, lots that are not a power of ten and a sub-step exit quantity with `qty_percent` below 100 are not measured. |
196
196
| SZ12 | No separate native counterpart: Pine reservation ledger details stay in the adapter over native scope claims. |
0 commit comments