AlertBridge
AlertBridge is a headless gateway that receives TradingView (or any bot) webhook alerts and translates them into authenticated Alpaca orders. It never contains trading strategy logic—it only validates, applies risk rules, logs, and forwards orders.
Features
- Webhook endpoint for receiving trading alerts
- Risk management rules (cooldown periods, PnL checks)
- Prometheus metrics integration
- Health check endpoint (
/healthz)
- Graceful shutdown handling
- Containerized deployment
Prerequisites
- Go 1.21 or later
- Docker (optional, for containerized deployment)
- Alpaca API credentials
Quickstart
- Build and test:
make build
make test
- Set required environment variables:
export ALP_KEY=your_key
export ALP_SECRET=your_secret
- Run the application:
./alertbridge
Configuration
See docs/deployment.md for Docker, Compose, and environment details.
Slack Integration
Configure either SLACK_WEBHOOK_URL for incoming webhooks or SLACK_TOKEN with chat:write permissions and SLACK_CHANNEL for OAuth-based posting. Optionally set SLACK_NOTIFY to control which events are sent (success, failure). When enabled, AlertBridge will post formatted messages to the specified Slack channel whenever orders succeed or fail. See docs/slack.md for full setup instructions.
See docs/webhook.md for full details and examples.
Metrics
Prometheus metrics are available at /metrics:
order_total{bot,side}: Counter of processed orders
Health Check
The /healthz endpoint returns 200 OK and can be used for container liveness checks.
Runbook
See docs/runbook.md for deployment, monitoring, and rollback steps.
License
This project is licensed under the MIT License - see the LICENSE file for details.