Mirrored from the engine repository. Prefer reading here for a consistent experience; use GitHub for file history and blame.
This example shows how to compute public WFA blocks using analyzeFromTrades() and the canonical WFAAnalysisOutput.
Key points:
wfaInputModeis required and must betradeSlicedPseudoWfa.- For
analyzeFromTrades(), each trade must includeopenTimeandcloseTime(unix ms). parameterStabilityandbenchmarkmay be unavailable, and that is represented explicitly in the output viaavailable: false.
TypeScript (synthetic trades)
Optional permutationN on the analyze options (and on AnalyzeConfig when using the full contract) controls how many OOS shuffles are used for the WFE permutation p-value (default 1000, bounds 100..10000).
CLI (using a canonical engine input shape)
Prepare two files:
trade-based-wfa.json- the canonical engine input shape (forvalidate)
trades-array.json- raw trades array (foranalyze-trades)
Validate the canonical contract:
Then run:
Note:
analyze-trades --format autoaccepts a JSON array of trades or a.csvfile. Bot-specific JSON objects are not parsed in-tree; convert toTrade[]or CSV first.