trading_agent.client.checkpoint_commands
¶
The trading-agent checkpoints commands: list and restore a desk's snapshots.
Typical usage example:
exit_code = CheckpointCommands(checkpoints).run('list', None)
CheckpointCommands
¶
Prints and restores one desk's checkpoints for the user.
Creates the commands.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checkpoints
|
Checkpoints
|
The desk's checkpoint repository. |
required |
output
|
TextIO
|
Where to print. |
stdout
|
Source code in src/trading_agent/client/checkpoint_commands.py
run
¶
Runs one action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
str
|
"list" or "restore". |
required |
checkpoint_id
|
str | None
|
The checkpoint to restore, for "restore". |
required |
limit
|
int
|
The most checkpoints "list" prints. |
20
|
Returns:
| Type | Description |
|---|---|
int
|
0 on success, 1 when git failed or the checkpoint does not exist. |