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 288f189
Browse filesBrowse the repository at this point in the historyBrowse files
Exact tick-built bar volume and a genuine-tick equivalence harness (#319)
* Qualify genuine tick tapes against realtime and modeled references
* Accumulate tick volume on decimal quantity grids
A bar built from ticks must equal the same bar built offline from the same prints.
Keep a Neumaier fallback for off-grid quantities and integer overflow. Hash all tick-volume accumulator state; tick stream hashes change forward-only. Confirmed-bar batch accumulation remains unchanged.
* Re-anchor consumer documentation after tick-volume changes
* Preserve legacy hashes without tick-volume precision state
A bar built from ticks must equal the same bar built offline from the same prints. Omit default and redundant additive state from the tick-volume hash extension; retain every accumulator field when integer-grid or compensated state adds information. Preserve existing tick pins as well as bar and batch hashes.
Copy file name to clipboardExpand all lines: docs/pages/pine-to-native.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
@@ -127,8 +127,8 @@ rather than defaulted.
127
127
|`commission_type`|`NativeFeeKind` native_run_spec.hpp:19 |`fee_kind` pineforge.h:502 |`native_open_lots_strategy.cpp`|`Percent`, `CashPerUnit`, `CashPerExecution` — the same three TradingView offers. |
128
128
|`commission_value`|`fee_value` native_run_spec.hpp:658 |`fee_value` pineforge.h:502 |`native_open_lots_strategy.cpp`| Quoted per execution by `quote_execution_commissions` engine_execution.cpp:1588. A cash-per-execution ticket is split by units over every slice of that execution. |
129
129
|`slippage`|`slippage_ticks` native_run_spec.hpp:652 |`slippage_ticks` pineforge.h:502 |`native_price_grid_strategy.cpp`| Raw `ticks * price_tick`, applied once native_execution_consumer.cpp:3980-3981. TradingView's round-then-slip order is adapter-only. |
130
-
|`process_orders_on_close`|`NativeCloseExecution` native_run_spec.hpp:33 |`close_execution` pineforge.h:503 |`native_open_lots_strategy.cpp`|`AfterCalculation` emits the post-calculation close point native_execution_consumer.cpp:7786-7787, so a request submitted in bar *k*'s calculation fills at bar *k*'s own close. |
131
-
|`pyramiding`|`max_open_lots` native_run_spec.hpp:664 |`max_open_lots` pineforge.h:505 |`native_open_lots_strategy.cpp`| Caps surviving+new physical lots (`resulting_lot_count` native_execution_consumer.cpp:3096). The Pine adapter keeps its own per-cycle *entry count*, ruled **adapter-policy** in ADR-0001's table row `max_open_lots`; measured against TradingView it is not TradingView's rule, and this cap is the closer one (14 of 15 tape scenarios against 13, `tests/test_pyramiding_count_differential.cpp`). Lowered onto the cap, four corpus probes move away from TradingView, for want of its first-eligible-point rule, so the adapter keeps its count. |
130
+
|`process_orders_on_close`|`NativeCloseExecution` native_run_spec.hpp:33 |`close_execution` pineforge.h:503 |`native_open_lots_strategy.cpp`|`AfterCalculation` emits the post-calculation close point native_execution_consumer.cpp:7813-7814, so a request submitted in bar *k*'s calculation fills at bar *k*'s own close. |
131
+
|`pyramiding`|`max_open_lots` native_run_spec.hpp:664 |`max_open_lots` pineforge.h:505 |`native_open_lots_strategy.cpp`| Caps surviving+new physical lots (`resulting_lot_count` native_execution_consumer.cpp:3122). The Pine adapter keeps its own per-cycle *entry count*, ruled **adapter-policy** in ADR-0001's table row `max_open_lots`; measured against TradingView it is not TradingView's rule, and this cap is the closer one (14 of 15 tape scenarios against 13, `tests/test_pyramiding_count_differential.cpp`). Lowered onto the cap, four corpus probes move away from TradingView, for want of its first-eligible-point rule, so the adapter keeps its count. |
132
132
|`default_qty_type`|`Sized` native_order.hpp:164 with `CashValue` native_order.hpp:91 or `EquityFraction` native_order.hpp:97 |`PF_NATIVE_INTENT_SIZED` native_c_api.h:348 with `size_basis` native_c_api.h:2147 |`native_sized_report_strategy.cpp`| The size is a property of the *request*, not of the run: a native host may size one order by cash and the next by equity fraction. `Transact` native_order.hpp:41 is the fixed-units form. Pine itself has no per-call `qty_type` — TradingView's compiler refuses one — so a script's `strategy.entry(qty = ...)` is always units; the source layer's typed per-call entry, which only generated or C++ callers reach, converts its money exactly as the declared default does. |
133
133
|`default_qty_value`| the basis's own scalar: `CashValue::cash` native_order.hpp:92, `EquityFraction::fraction` native_order.hpp:98 |`intent_value` native_c_api.h:2151 |`native_sized_report_strategy.cpp`|`SizeTime` native_order.hpp:106 chooses *when* the basis resolves and `SizePrice` native_order.hpp:146 *which* price it converts at; both compose. |
134
134
|`calc_on_order_fills`|`NativeCalculationTrigger` native_run_spec.hpp:94 |`calculation` native_c_api.h:2321 |`native_calc_on_fills_strategy.cpp`|`BarCloseAndFills` recalculates once at the cursor of each applied execution, bounded by `max_recalculations_per_point` native_run_spec.hpp:695. The generic cadence only: TradingView's waypoint-only refill, its two-fills-at-open rule and its script-state rollback stay in the adapter. |
@@ -296,7 +296,7 @@ is `strategy_native_submit_v1` native_c_api.h:2723 over a
296
296
|`strategy.oca.reduce`|`GroupEffect::Reduce` native_order.hpp:466 |`PF_NATIVE_GROUP_REDUCE` native_c_api.h:479 |`tests/test_native_resting_group_contract.cpp`| The sibling's quantity is reduced instead of cancelled. |
297
297
|`strategy.oca.none`|`NoGroup` native_order.hpp:467 |`PF_NATIVE_GROUP_NONE` native_c_api.h:472 |`hello_kernel.cpp`| The default: no group, no sibling effect. |
298
298
|`strategy.direction.all`|`NativeOpenDirections::Both` native_run_spec.hpp:76 |`allowed_open_directions` pineforge.h:503 |`native_risk_limits_strategy.cpp`| The default. |
299
-
|`strategy.direction.long`|`NativeOpenDirections::Long` native_run_spec.hpp:74 |`allowed_open_directions` pineforge.h:503 |`tests/test_native_run_spec.cpp`| An opening the direction forbids is refused with `OpeningDirection` native_execution_consumer.cpp:3085. |
299
+
|`strategy.direction.long`|`NativeOpenDirections::Long` native_run_spec.hpp:74 |`allowed_open_directions` pineforge.h:503 |`tests/test_native_run_spec.cpp`| An opening the direction forbids is refused with `OpeningDirection` native_execution_consumer.cpp:3111. |
300
300
|`strategy.direction.short`|`NativeOpenDirections::Short` native_run_spec.hpp:75 |`allowed_open_directions` pineforge.h:503 |`tests/test_native_run_spec.cpp`| Same, the other way. |
301
301
|`strategy.commission.percent`|`NativeFeeKind::Percent` native_run_spec.hpp:20 |`fee_kind` pineforge.h:502 |`native_sized_report_strategy.cpp`|`fee_value` is percent ÷ 100 of the absolute account notional. |
302
302
|`strategy.commission.cash_per_contract`|`NativeFeeKind::CashPerUnit` native_run_spec.hpp:21 |`fee_kind` pineforge.h:502 |`tests/test_native_selected_requests.cpp`| Account currency per unit. |
@@ -405,7 +405,7 @@ block is the `PF_NATIVE_SPEC_EXT_RISK` native_c_api.h:739 tail.
405
405
406
406
| Pine | C++ | C | Runs in | Notes |
407
407
| --- | --- | --- | --- | --- |
408
-
|`strategy.risk.allow_entry_in()`|`allowed_open_directions` native_run_spec.hpp:665 |`allowed_open_directions` pineforge.h:503 |`native_risk_limits_strategy.cpp`| The one `strategy.risk.*` rule that is already the kernel's, per ADR-0001's `risk` ruling row. Rejects with `OpeningDirection` native_execution_consumer.cpp:3085. |
408
+
|`strategy.risk.allow_entry_in()`|`allowed_open_directions` native_run_spec.hpp:665 |`allowed_open_directions` pineforge.h:503 |`native_risk_limits_strategy.cpp`| The one `strategy.risk.*` rule that is already the kernel's, per ADR-0001's `risk` ruling row. Rejects with `OpeningDirection` native_execution_consumer.cpp:3111. |
409
409
|`strategy.risk.max_position_size()`|`max_abs_units` native_run_spec.hpp:663 |`max_abs_units` pineforge.h:504 |`tests/test_native_run_spec.cpp`| Tests the *resulting* book. TradingView gates the *live* book before the fill, so an entry is refused only once the book already holds the limit — ruled **adapter-policy** in ADR-0001's `max_abs_units` row, with lane N12's measurement (the adapter ends at 4 where the kernel cap ends at 2). |
410
410
|`strategy.risk.max_drawdown()`|`NativeRiskLimits::max_drawdown` native_run_spec.hpp:311 |`risk_max_drawdown` native_c_api.h:2357 |`native_risk_limits_strategy.cpp`|`NativeLossLimit` native_run_spec.hpp:259 is account currency, or a percent of the running peak when `percent` native_run_spec.hpp:261 is set. Blocks openings to the end of the run. |
411
411
|`strategy.risk.max_intraday_loss()`|`NativeRiskLimits::max_intraday_loss` native_run_spec.hpp:312 |`risk_max_intraday_loss` native_c_api.h:2360 |`native_risk_limits_strategy.cpp`| Percent is of the day's opening equity. Blocks to the end of its own day. |
0 commit comments