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 f6fdc03
Browse filesBrowse the repository at this point in the historyBrowse files
* Add explicit report-only native intraday terminal quote
* Declare report-only terminal quote hash exemptions
* Make terminal quote provenance and presentation auditable
* Resolve remaining report hook documentation anchors
* Re-anchor documentation citations on 288f189; note the harness applied check reads timestamps only
The rebase onto 288f189 moved cited lines in the adapter boundary ADR and the
native feature parity page; the citations are carried across by line map.
The report quote page now says the harness APPLIED line is inferred from the
terminal timestamps, which is exact for a quote one interval after the mark
and not for a quote stamped at the mark itself.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Copy file name to clipboardExpand all lines: docs/pages/pine-to-native.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -534,9 +534,9 @@ range-end reporting is off.
534
534
| --- | --- | --- | --- | --- |
535
535
|`strategy.account_currency`|`currency` native_run_spec.hpp:639 |`currency` pineforge.h:499 |`hello_kernel.cpp` / `native_fx_roll_strategy.cpp`| Declared, never inferred. `account_fx` native_run_spec.hpp:650 is the one positive scalar that converts quote to account; a timestamped curve is `configure_native_fx_curve` native_host.hpp:1202. The FX-roll example runs a JPY account on a USD-quoted stock through such a curve, and a step of it is a margin check point of its own. |
536
536
|`strategy.initial_capital`|`initial_capital` native_run_spec.hpp:648 |`initial_capital` pineforge.h:501 |`hello_kernel.cpp`| The value you declared, unchanged by the run. |
537
-
|`strategy.equity`|`native_marked_equity(mark)` native_host.hpp:1301; on the Pine host `current_equity() + open_profit(mark)` pine_strategy_host.hpp:661|`strategy_native_marked_equity_v1` native_c_api.h:3060 |`native_open_lots_strategy.cpp`| Pine marks at the current `close`. The native marked call takes the mark explicitly and returns balance plus open lots' **net**`unrealized_pnl` native_host.hpp:341, which is Pine's equity: TradingView charges the open lots' paid entry fees. |
538
-
|`strategy.netprofit`| on the Pine host `net_profit` pine_strategy_host.hpp:660; `net_profit` engine.hpp:967 is the closed trades' figure |`net_profit` pineforge.h:374, less open lots' `entry_commission`|`native_open_lots_strategy.cpp`| The closed trades' net profit less the entry fees the open lots have paid. The report's figure is the closed trades'. |
539
-
|`strategy.netprofit_percent`| derive: `net_profit` pine_strategy_host.hpp:660 over `initial_capital` native_run_spec.hpp:648 |`pf_metrics_t` pineforge.h:320 |`native_sized_report_strategy.cpp`| The kernel keeps the facts, not the ratio. |
537
+
|`strategy.equity`|`native_marked_equity(mark)` native_host.hpp:1301; on the Pine host `current_equity() + open_profit(mark)` pine_strategy_host.hpp:664|`strategy_native_marked_equity_v1` native_c_api.h:3060 |`native_open_lots_strategy.cpp`| Pine marks at the current `close`. The native marked call takes the mark explicitly and returns balance plus open lots' **net**`unrealized_pnl` native_host.hpp:341, which is Pine's equity: TradingView charges the open lots' paid entry fees. |
538
+
|`strategy.netprofit`| on the Pine host `net_profit` pine_strategy_host.hpp:663; `net_profit` engine.hpp:967 is the closed trades' figure |`net_profit` pineforge.h:374, less open lots' `entry_commission`|`native_open_lots_strategy.cpp`| The closed trades' net profit less the entry fees the open lots have paid. The report's figure is the closed trades'. |
539
+
|`strategy.netprofit_percent`| derive: `net_profit` pine_strategy_host.hpp:663 over `initial_capital` native_run_spec.hpp:648 |`pf_metrics_t` pineforge.h:320 |`native_sized_report_strategy.cpp`| The kernel keeps the facts, not the ratio. |
|`strategy.grossprofit_percent`|`grossprofit_percent` engine.hpp:975 |`pf_metrics_t` pineforge.h:320 |`native_sized_report_strategy.cpp`| Of initial capital. |
542
542
|`strategy.grossloss`|`gross_loss` engine.hpp:969 |`pf_trade_stats_t::gross_loss` pineforge.h:224 |`native_open_lots_strategy.cpp`| For booked closed trades the protected C++ accessor is signed (negative for losses), while the C report stores a positive loss magnitude. With range-end reporting off, `-C.gross_loss == gross_loss()` and `netprofit == grossprofit - C.gross_loss`. With it on, C trade statistics include the report-only range-end rows; filter `open_at_end == 0` before comparing to Pine's closed-trade statistics. |
| Report / final equity point |`net_profit`; final `time_ms` and `equity`|
55
+
|`metrics.all` and the open lot's side | Net/gross profit or loss and percentages, profit factor, average trade/win/loss and percentages, win/loss ratio, largest win/loss and percentages, commission, expectancy; counts, profitable percentage and streaks only on a PnL sign flip |
56
+
|`metrics.equity`| Terminal-point drawdown/runup extremes and percentages, monthly/bar Sharpe and Sortino, CAGR, Calmar and recovery factor |
57
+
58
+
The projected row retains its old `max_runup`, `max_drawdown` and
59
+
`exit_bar_index`: the quote does not invent a traversed path or an execution
60
+
bar. `buy_hold_return` and its percentage retain the last executed close.
61
+
The last equity point is relabelled, not appended, so the ordinary completed
62
+
mark disappears and the curve can have a two-interval gap; TradingView has an
63
+
additional point. Crossing a month boundary creates a one-point trailing
64
+
monthly bucket for Sharpe/Sortino and makes the previous equity point the
65
+
closing month's sample. Those derived metrics are not validated against
66
+
TradingView by the trade-only grader; only the terminal trade mark is evidenced.
Copy file name to clipboardExpand all lines: scripts/broker_state_hash_waivers.txt
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -66,5 +66,7 @@ close_margin_follow_up_units_ # Transient within-bar value: the units the follow
66
66
symbol_calendar_ # Source-host run input (lane XAU-CAL): TradingView's session calendar for the chart's symbol, installed when the run begins and never changed by it (PineStrategyHost::set_symbol_calendar), as the feed and the syminfo session are; the session flags and time offsets it answers are rewritten before every source callback and fold nowhere.
67
67
symbol_calendar_closes_ # C-ABI transport of that calendar (syminfo metadata "symbol_calendar_close:<i>"), read once when the run begins; configuration, never next-decision state.
68
68
symbol_calendar_days_ # C-ABI transport of that calendar's day count (syminfo metadata "symbol_calendar_days"), read once when the run begins; configuration, never next-decision state.
69
+
report_quote_time_ms_ # Explicit report-only native chart input; read only by present_report after completion, pinned in the caller input manifest, never an execution or next-decision input. test_report_terminal_quote proves equal per-bar hashes and stored trades.
70
+
report_quote_close_ # Price of the same report-only native chart input; present_report projects returned rows without changing lots, fills, execution statistics, or hash state. test_report_terminal_quote proves repeated-report and execution identity.
69
71
symbol_calendar_opens_ # C-ABI transport of that calendar (syminfo metadata "symbol_calendar_open:<i>"), read once when the run begins; configuration, never next-decision state.
70
72
waypoint_chain_bar_ # Transient within-bar value: the script bar whose path took a waypoint margin call (rest_waypoint_margin_call), set on that bar's path and cleared by the same bar's post-script close; compared only for equality with the current script bar, so it is dead at every bar boundary.
0 commit comments