Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ version number follows semantic versioning over the surfaces the

## Unreleased

- `str.match` no longer reports "no match" after a memory failure; the failure now reaches `out_of_memory`.
A pattern over the limits of the engine's regular-expression library stops the run with `pine_string_error` and reason `regex_resource_limit`, which is not retryable.
An invalid regular expression now stops the run with a typed error, as TradingView does; it used to return an empty string. 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.
Patterns the engine's regular-expression library does not support also stop the run now, with the same error. On the Linux build these include lookbehind, named groups, inline flags such as `(?i)`, comment groups, atomic groups, conditionals, `\p{...}` classes and `{,n}` repeats; lookahead, lazy quantifiers, back-references, POSIX classes and `\b` are accepted.
- 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.
- 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).
- 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).
- 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).
Expand Down
7 changes: 6 additions & 1 deletion ci/cr150-source-bounds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ ceilings:
# Three more unreviewed groups: the selected-capacity Source stage's chunk
# buffer, its record window and its stored message. None is bounded in the
# gate's sense: no fixed input is declared for them.
unreviewed: 1413
# Two more unreviewed groups: the declarations of the run-error bar prefix
# function, in the installed header and in its source. Each call returns one
# short string and nothing retains it: 1413 -> 1415.
unreviewed: 1415
pending-flat-memory: 184
owners:
- {name: "generated-cpp", globs: ["tutorial/**"]}
Expand Down Expand Up @@ -362,6 +365,7 @@ entries:
- {id: "U0230", file: "include/pineforge/order_cancellation.hpp", symbol: "state_", ops: ["assign"], container: "unresolved by the index: state_ = ...", owner: "native-kernel", phase: "unclassified", state: "unreviewed", line: 92}
- {id: "U0231", file: "include/pineforge/position_close_obligation.hpp", symbol: "comment", ops: ["decl"], container: "std::string", owner: "native-kernel", phase: "unclassified", state: "unreviewed", line: 15}
- {id: "U0232", file: "include/pineforge/run_failure.hpp", symbol: "args", ops: ["assign", "decl", "grow"], container: "std::shared_ptr<const std::string>", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 216}
- {id: "U1800", file: "include/pineforge/run_failure.hpp", symbol: "run_error_bar_prefix", ops: ["decl"], container: "std::string", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 252}
- {id: "U0233", file: "include/pineforge/run_failure.hpp", symbol: "text", ops: ["assign", "decl"], container: "std::string", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 180}
- {id: "U0234", file: "include/pineforge/run_failure.hpp", symbol: "value", ops: ["decl"], container: "std::string", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 187}
- {id: "U0235", file: "include/pineforge/selected_window_plan.hpp", symbol: "input_tf", ops: ["decl"], container: "std::string", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 88}
Expand Down Expand Up @@ -852,6 +856,7 @@ entries:
- {id: "U0744", file: "src/run_failure.cpp", symbol: "json", ops: ["alloc", "append", "decl", "grow"], container: "unresolved by the index: make_shared", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 249}
- {id: "U0745", file: "src/run_failure.cpp", symbol: "matched", ops: ["decl", "grow"], container: "std::vector<std::pair<const RegistryArg*, const RunFailureArg*>>", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 176}
- {id: "U0746", file: "src/run_failure.cpp", symbol: "out", ops: ["grow"], container: "unresolved by the index: out.push_back(...)", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 120}
- {id: "U1801", file: "src/run_failure.cpp", symbol: "run_error_bar_prefix", ops: ["decl"], container: "std::string", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 408}
- {id: "U0747", file: "src/run_failure.cpp", symbol: "std::to_string", ops: ["temp"], container: "unresolved by the index: std::to_string(...)", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 259}
- {id: "U0748", file: "src/run_failure.cpp", symbol: "text", ops: ["append", "decl"], container: "std::string", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 318}
- {id: "U0749", file: "src/selected_report_view.cpp", symbol: "points", ops: ["alloc"], container: "unresolved by the index: new pf_equity_point_t", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 54}
Expand Down
31 changes: 31 additions & 0 deletions ci/cr150-source-sites.json
Original file line number Diff line number Diff line change
Expand Up @@ -8414,6 +8414,16 @@
"spelling": "std :: shared_ptr < const std :: string >",
"ordinal": 1
},
{
"file": "include/pineforge/run_failure.hpp",
"symbol": "run_error_bar_prefix",
"scope": [
"namespace pineforge #1"
],
"cls": "decl",
"spelling": "std :: string",
"ordinal": 1
},
{
"file": "include/pineforge/run_failure.hpp",
"symbol": "<temp:Base>",
Expand Down Expand Up @@ -27346,6 +27356,27 @@
"spelling": "json . push_back ( . . . )",
"ordinal": 2
},
{
"file": "src/run_failure.cpp",
"symbol": "run_error_bar_prefix",
"scope": [
"namespace pineforge #1"
],
"cls": "decl",
"spelling": "std :: string",
"ordinal": 1
},
{
"file": "src/run_failure.cpp",
"symbol": "std::to_string",
"scope": [
"namespace pineforge #1",
"std :: string run_error_bar_prefix ( ) #1"
],
"cls": "temp",
"spelling": "std :: to_string ( . . . )",
"ordinal": 1
},
{
"file": "src/run_failure.cpp",
"symbol": "text",
Expand Down
8 changes: 6 additions & 2 deletions docker/run_failure_codes.json
Original file line number Diff line number Diff line change
Expand Up @@ -835,15 +835,19 @@
"kind": "vocab",
"values": [
"substring_out_of_range",
"format_index_overflow"
"format_index_overflow",
"invalid_regex_pattern",
"regex_resource_limit"
]
}
},
"class": "strategy",
"description": "A string built-in refused its arguments.",
"english": [
"basic_string::substr: __pos (which is {pos}) > this->size() (which is {size})",
"stoul"
"stoul",
"Invalid regex pattern in the 'str.match' function.",
"A regular expression exceeds the limits of the engine's regular-expression library."
],
"retryable": false,
"since": "1.4.0"
Expand Down
41 changes: 39 additions & 2 deletions docker/run_failure_codes_diff.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,52 @@
"to": {
"version": null,
"unreleased": true,
"catalogSha256": "7e903f977be655901c877a3550008aeee19b7f69a9ecfad986ca6f0d9129c3be"
"catalogSha256": "440a8f9899a8bdbdff8a3e0f7e1c236854d469cbb05f7af542b0d392646330ab"
},
"catalogSchema": {
"before": "pineforge-run-failure-catalog/v1",
"after": "pineforge-run-failure-catalog/v1"
},
"metadataChanges": [],
"added": [],
"changed": [],
"changed": [
{
"code": "pine_string_error",
"collection": "codes",
"fields": [
{
"path": "args.reason.values",
"beforePresent": true,
"afterPresent": true,
"before": [
"substring_out_of_range",
"format_index_overflow"
],
"after": [
"substring_out_of_range",
"format_index_overflow",
"invalid_regex_pattern",
"regex_resource_limit"
]
},
{
"path": "english",
"beforePresent": true,
"afterPresent": true,
"before": [
"basic_string::substr: __pos (which is {pos}) > this->size() (which is {size})",
"stoul"
],
"after": [
"basic_string::substr: __pos (which is {pos}) > this->size() (which is {size})",
"stoul",
"Invalid regex pattern in the 'str.match' function.",
"A regular expression exceeds the limits of the engine's regular-expression library."
]
}
]
}
],
"removed": [],
"deprecated": []
}
Loading
Loading