The engine distinguishes sharply between live and backtest (paper) persistence: live state is written to disk and survives restarts, while paper and backtest counterparts stay in memory or local temporary storage. This means you can kill and restart the trading process at any time without losing an open position, its brackets, or any of the history the agent has seen.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/theonetrade/ai-trading-mcp/llms.txt
Use this file to discover all available pages before exploring further.
Live vs Backtest Persistence
Persistence behavior is declared inconfig/setup.config.ts using the usePersist(), useMemory(), and useLocal() methods on each subsystem:
usePersist() writes state to dump/data/ and reloads it on the next startup. useMemory() keeps state in the process heap — it is gone when the process exits. useLocal() writes to a local temporary location that is not expected to survive across deployments.
What Persists in Live Mode
When running with--live (or --paper with usePersist() variants), the following subsystems write their state to dump/data/:
| Subsystem | What it holds |
|---|---|
| Signals | Active signals and their current lifecycle stage |
| Storage | Per-symbol key-value store used by strategy callbacks |
| Notifications | Queued and delivered notification history |
| Recent | Recent price and candle data cache |
| Memory | Agent memory written via MCP tool calls |
| State | Engine-level state including open positions and OCO bracket references |
| Sessions | Active command sessions and their history |
The dump/ Directory
All persistent and audit data lives underdump/ inside the strategy’s working folder (content/manual.strategy/dump/):
dump/data/ is the live engine state. Files here are read at startup and written on every state change. This is the directory you need to back up if you want cross-host recovery.
dump/mcp/ is the audit trail. Every get_status response — the full portfolio snapshot plus the last 15 Telegram posts — is dumped as a markdown file stamped with the minute it was generated. The web dashboard on :60050 includes a viewer for these files.
dump/images/ holds chart screenshots extracted from Telegram posts. The audit markdown files reference them with relative paths so they render inline in the dashboard and in any markdown viewer.
dump/report/ holds JSONL event streams that record the engine’s full trading history:
| File | Contents |
|---|---|
live.jsonl | All engine events in chronological order |
performance.jsonl | Per-position PnL records |
max_drawdown.jsonl | Maximum drawdown snapshots |
highest_profit.jsonl | Peak unrealized and realized profit snapshots |
Optional: Redis and MongoDB Backends
By default allusePersist() subsystems write to the local filesystem under dump/data/. The @backtest-kit/mongo package provides drop-in Redis and MongoDB backends for teams that need centralized state or higher durability guarantees.
To enable them, set the connection variables in your environment and wire in the package according to its documentation:
Restart Safety
The process is designed to be stopped and restarted without manual intervention:Process stops
Whether by a clean shutdown, a crash, or a
systemd restart, the process exits. All usePersist() subsystems have already written their latest state to dump/data/.Process restarts
On the next startup each subsystem calls
usePersist() and reloads from dump/data/. The engine reconstructs the full signal and position state.dump/mcp/ is also fully preserved — every markdown file and every referenced image from before the restart is still there.