OpenClaw
OpenClaw is an experimental autonomous AI agent framework. Use it if you want to build custom trading agents or integrate with advanced AI pipelines.
Prerequisites
Section titled “Prerequisites”- OpenClaw installed and configured
- Your FIX credentials (see Before You Start
Portal Token Method
Section titled “Portal Token Method”OpenClaw primarily uses Bearer token authentication.
Step 1: Generate a Token
Section titled “Step 1: Generate a Token”Visit in your browser:
https://mcp.axiory.ai/token-portal- Select your broker server
- Enter your FIX credentials
- Choose trading mode (readonly/paper/live)
- Click Generate Token
- Copy the token immediately (shown only once)
Step 2: Configure OpenClaw
Section titled “Step 2: Configure OpenClaw”Edit your openclaw.json configuration file:
{ "mcpServers": [ { "name": "axiory-ai", "url": "https://mcp.axiory.ai/mcp", "headers": { "Authorization": "Bearer YOUR_TOKEN_HERE" } } ]}Replace YOUR_TOKEN_HERE with your token from the Token Portal.
Step 3: Initialize OpenClaw
Section titled “Step 3: Initialize OpenClaw”Start your OpenClaw agent:
openclaw run --config openclaw.jsonStep 4: Test Connection
Section titled “Step 4: Test Connection”Ask your OpenClaw agent:
“Check your connection to cTrader and show me my current positions”
The agent should respond with your account status.
Using OpenClaw for Custom Trading Agents
Section titled “Using OpenClaw for Custom Trading Agents”OpenClaw is powerful for building custom agents. Example:
# In your OpenClaw agent definition:tools: - axiory-ai/get_positions - axiory-ai/place_order - axiory-ai/get_quote
strategy: - name: "Daily MA Crossover" trigger: "Daily at 8:00 UTC" actions: - fetch_quote: "EURUSD" - calculate_ma_20: "EURUSD" - calculate_ma_50: "EURUSD" - if: "MA_20 > MA_50" then: "buy 100000 units of EURUSD" - else: "close all EURUSD positions"Making Your First Trade
Section titled “Making Your First Trade”Once configured:
openclaw ask "Buy 50,000 units of EURUSD at market price"Or build a more complex autonomous strategy that executes without human input.
Token Rotation
Section titled “Token Rotation”Portal tokens expire after 30 days. Before expiry:
- Visit the Token Portal
- Generate a new token
- Update your
openclaw.jsonwith the new token - Restart your agent
If your token expires, you’ll see “401 Unauthorized”. Generate a new one.
Troubleshooting
Section titled “Troubleshooting””Server connection failed”
Section titled “”Server connection failed””Check:
openclaw.jsonis valid JSON (no syntax errors)- Server URL is correct:
https://mcp.axiory.ai/mcp - Bearer token is set in the headers
- Token is not expired (valid for 30 days from generation)
“Invalid token” or “401 Unauthorized”
Section titled ““Invalid token” or “401 Unauthorized””Your token has expired or is invalid:
- Visit the Token Portal
- Generate a new token
- Update
openclaw.jsonwith the new token - Restart your agent
”FIX connection timeout”
Section titled “”FIX connection timeout””Your FIX credentials may be wrong or the broker’s server is unreachable:
- Verify credentials: SenderCompID, FIX API Password (NOT login password)
- Try regenerating a token at the Token Portal — it validates credentials
- Check that your network can reach the broker’s FIX servers (TCP port 5212/5211)
Agent not executing trades
Section titled “Agent not executing trades”Check:
- Is the agent enabled and running?
- Is trading mode set to live (not readonly or paper)?
- Are your risk limits configured in the agent?
- Check agent logs for error messages
Building Custom Agents
Section titled “Building Custom Agents”OpenClaw lets you define sophisticated trading logic:
# Example: Hedging agenttriggers: - position_size_limit_exceeded: true action: place_hedge_order
rules: - if: "daily_loss > loss_limit" then: "kill_switch" - if: "volatility > 2%" then: "reduce_position_size"See OpenClaw documentation for full syntax.
Safety Tips
Section titled “Safety Tips”- Always test in paper mode first before enabling live trading
- Set conservative risk limits in the agent config
- Monitor agent behavior — don’t set and forget
- Have a manual kill switch — ability to stop the agent immediately
- Use readonly mode for initial testing
Next Steps
Section titled “Next Steps”- Operating Modes — Understand readonly, paper, and live
- Risk Limits — Position size and daily loss limits
- Choosing an Agent — Compare with other MCP clients
OpenClaw is for advanced users. Take time to understand it before deploying live agents.
