alertbridge

module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2025 License: MIT

README

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

  1. Build and test:
    make build
    make test
    
  2. Set required environment variables:
    export ALP_KEY=your_key
    export ALP_SECRET=your_secret
    
  3. 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.

Webhook Format

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.

Directories

Path Synopsis
cmd
alertbridge command
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL