Customize trading parameters and risk management.
Edit agent-config.json (created on first run) or use the dashboard:
| Setting | Default | Description |
|---|---|---|
max_positions |
3 | Maximum stocks to hold at once |
max_position_value |
2000 | Maximum $ per position |
take_profit_pct |
8 | Auto-sell at this % profit |
stop_loss_pct |
4 | Auto-sell at this % loss |
min_sentiment_score |
0.3 | Minimum bullish sentiment to consider |
min_analyst_confidence |
0.6 | Minimum LLM confidence to execute trade |
min_volume |
10 | Minimum message volume to consider |
position_size_pct_of_cash |
20 | Max % of cash per position |
llm_model |
gpt-4o-mini | OpenAI model for analysis |
| Setting | Default | Description |
|---|---|---|
data_poll_interval_ms |
60000 | How often to fetch signals (ms) |
analyst_interval_ms |
120000 | How often to run trading logic (ms) |
Set these in .dev.vars:
| Variable | Required | Description |
|---|---|---|
ALPACA_API_KEY |
Yes | Your Alpaca API key |
ALPACA_API_SECRET |
Yes | Your Alpaca API secret |
ALPACA_PAPER |
Yes | true for paper, false for live |
OPENAI_API_KEY |
Yes | Your OpenAI API key |
KILL_SWITCH_SECRET |
Yes | Secret for HMAC signing tokens |
These are enforced by the MCP server's policy engine:
| Feature | Description |
|---|---|
| Kill Switch | Emergency halt for all trading |
| Position Limits | Max positions and $ per position |
| Daily Loss Limit | Stops trading after 2% daily loss |
| Cooldown Period | 30-minute pause after losses |
| Approval Tokens | Orders expire after 5 minutes |
| LLM Confidence Gate | Trades require minimum confidence |
| No Margin | Cash-only trading |
| No Shorting | Long positions only |
Agent not making trades?
min_analyst_confidence to 0.5min_sentiment_score to 0.2max_positions — might be at limitToo many trades?
min_analyst_confidence to 0.7+min_sentiment_score to 0.4+max_positionsHigh OpenAI costs?
data_poll_interval_msgpt-4o-mini (default, cheapest)