Log a trade by hand
journal_add_tradeAdd fills to manual/import journal accounts (not broker-synced) to log trades; derives long/short positions from buy/sell fills, skips duplicates, and returns insert counts plus trade keys.
Instructions
Log a trade by adding its fills to a manual or import journal account (never a broker-synced one — the sync owns those). The journal derives trades from fills: a long round trip is a buy fill then a sell fill, a short is sell then buy, scale-ins and partial exits are just more fills, and a lone fill opens a position. Times are ISO 8601 instants with offset; fees are per fill. Fills identical to existing ones are skipped as duplicates. Returns the insert counts and the trade(s) the fills now belong to, with keys for journal_update_trade. Correcting or removing an existing fill is done in the app, not here. Requires signing in with a LuxAlgo account (OAuth).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fills | Yes | The fills, in any order. | |
| accountId | Yes | A `manual` or `import` account id from journal_list_accounts. |