edit_txn
Update fields of an existing transaction by ID, with automatic price conversion to USD based on asset type and market.
Instructions
Update fields of an existing transaction by id. Only provided fields are changed.
When price is supplied it is converted to USD at the transaction date before storing. The native currency it is interpreted in depends on the (effective) asset type: for a stock it is the market's native currency (the new market if passed, else the existing one); for a non-stock asset it is the currency param (default USD).
Changing asset_type mirrors add_txn's fork: switching TO a non-stock type (crypto/commodity/real_estate/other) clears market to null (any market arg is ignored); switching TO 'stock' uses the supplied market (or keeps the existing one, defaulting to US).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| ticker | No | ||
| asset_type | No | Asset class: stock or crypto/commodity/real_estate/other. Switching to non-stock clears market. | |
| date | No | YYYY-MM-DD | |
| type | No | ||
| shares | No | ||
| price | No | Price per share — native to the market (stock) or to `currency` (non-stock); stored converted to USD. | |
| market | No | Stock market (listing exchange) | |
| currency | No | Currency of `price` for a NON-stock asset (default USD). Ignored for stocks. | |
| reason | No | Why this trade? (free-form) |