A comprehensive guide to using the AgentX Crypto Trading Framework
Welcome to AgentX, a hierarchical agent-based system for cryptocurrency trading. This user guide will walk you through the setup, configuration, and operation of the AgentX system.
AgentX is designed to function like a professional hedge fund structure, with various AI agents working together to research, analyze, make decisions, and execute trades in the cryptocurrency market.
Before you begin, ensure your system meets the following requirements:
For detailed installation instructions, please refer to the Installation Guide.
To use AgentX for live trading, you'll need to set up API access with supported cryptocurrency exchanges:
The main configuration file is located at config/local.json
. Here's an overview of the key sections:
{
"system": {
"name": "AgentX Trading System",
"update_interval": 1.0,
"log_level": "INFO"
},
"agents": {
"executive": {
"chief_coordinator": {
"update_frequency": 0.5,
"allocation_limits": {
"max_per_asset": 0.2,
"max_per_strategy": 0.3
}
},
"risk_manager": {
"update_frequency": 0.5,
"risk_limits": {
"max_drawdown": 0.1,
"max_volatility": 0.2,
"max_correlation": 0.7
}
},
"performance_analyst": {
"update_frequency": 0.5,
"metrics": ["returns", "sharpe", "drawdown", "win_rate"]
}
},
"strategy": {
// Strategy agent configurations...
},
"execution": {
// Execution agent configurations...
}
},
"exchanges": {
"binance": {
"api_key": "YOUR_API_KEY",
"api_secret": "YOUR_API_SECRET"
},
"coinbase": {
"api_key": "YOUR_API_KEY",
"api_secret": "YOUR_API_SECRET"
}
},
"assets": {
"monitored_pairs": [
"BTC/USDT", "ETH/USDT", "BNB/USDT", "SOL/USDT", "ADA/USDT"
]
}
}
update_interval
: How frequently the system updates (in seconds)log_level
: Logging verbosity (DEBUG, INFO, WARNING, ERROR)max_drawdown
: Maximum allowed drawdown before risk alerts triggermax_volatility
: Maximum allowed portfolio volatilitymax_correlation
: Maximum allowed correlation between assetsmax_per_asset
: Maximum allocation to any single assetmax_per_strategy
: Maximum allocation based on a single strategyapi_key
: Your exchange API keyapi_secret
: Your exchange API secretOnce the system is running, access the dashboard at:
http://localhost:5000
The main dashboard page provides a high-level overview of system status, including:
The Agents section displays the status of all agents in the system:
The Performance section shows detailed trading performance metrics:
The Trades section displays:
The Portfolio section shows:
The Alerts section displays:
The Settings section allows you to configure:
python src/main.py
logs
directoryLog files are stored in the logs
directory:
system.log
: Main system logagents/*.log
: Individual agent logsdashboard.log
: Dashboard server logfrom src.strategy.base_strategy import BaseStrategyAgent
from src.protocols import MessageType, AgentType
class MyCustomStrategyAgent(BaseStrategyAgent):
def __init__(self, agent_id, router, config_file=None, logger=None):
super().__init__(
agent_id=agent_id,
agent_type=AgentType.CUSTOM_STRATEGY,
router=router,
config_file=config_file,
logger=logger
)
def update(self):
# Custom strategy logic here
pass
def handle_market_data(self, message):
# Process market data
pass
def generate_signals(self):
# Generate trading signals
recommendation = {
"asset": "BTC/USDT",
"action": "buy",
"confidence": 0.8,
# Additional details...
}
# Send recommendation to chief coordinator
self.broker.send(
to="chief_coordinator",
message_type=MessageType.TRADE_RECOMMENDATION,
content={"recommendation": recommendation}
)
docs
directory for detailed documentation