Getting Started
Prerequisites: Python 3.11+ (Homebrew python3 on macOS is fine).
Create a virtualenv and install
cd fu-strategy
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
pip install -e .
# optional: pip install -e ".[dev]"Configure .env
cp .env.example .envFill in Capital.com credentials at minimum (CAPITAL_API_KEY, CAPITAL_IDENTIFIER,
CAPITAL_PASSWORD, CAPITAL_ENVIRONMENT=demo). See Configuration
for the full table.
Run the API
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000Or use the helpers:
./scripts/run.sh
# HOST=127.0.0.1 PORT=9000 ./scripts/run.sh
make run # after make install- OpenAPI: http://127.0.0.1:8000/docs
- Health: http://127.0.0.1:8000/health
Enable polling with POLLING_ENABLED=true once credentials and SYMBOLS are set. Live polling
runs on absolute minute boundaries regardless of POLLING_INTERVAL_SECONDS.
Verify notifications (optional)
curl -X POST http://127.0.0.1:8000/notifications/test \
-H 'Content-Type: application/json' \
-d '{"recipient":"+447700900000","message":"hello from fu-strategy"}'
curl -X POST http://127.0.0.1:8000/notifications/test/broadcast \
-H 'Content-Type: application/json' \
-d '{"message":"hello from fu-strategy"}'
curl http://127.0.0.1:8000/notificationsLast updated on