Configuration¶
Configuration loading and management.
config
¶
Configuration management for TradeTracer Executor.
Handles loading and saving configuration from JSON files. The config file is stored in the data directory (mounted as /data in Docker).
Example
Config
dataclass
¶
Executor configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
api_key |
str
|
TradeTracer API key for authentication. |
adapter |
str
|
Adapter type (e.g., "sandbox", "ibkr"). |
adapter_config |
dict[str, Any]
|
Adapter-specific configuration. |
api_url |
str
|
TradeTracer API base URL. |
poll_interval |
int
|
Seconds between ticks. |
data_path |
str
|
Path to data directory. |
Source code in executor/config.py
save(path)
¶
Save configuration to JSON file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Path to config file. |
required |
Source code in executor/config.py
load(path)
classmethod
¶
Load configuration from JSON file.
If file doesn't exist, returns default config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Path to config file. |
required |
Returns:
| Type | Description |
|---|---|
Config
|
Loaded or default Config instance. |
Source code in executor/config.py
is_valid()
¶
get_tick_url()
¶
Get full URL for tick endpoint.
Returns:
| Type | Description |
|---|---|
str
|
URL like "https://tradetracer.ai/api/models/tick". |