This project provides a small crypto trading signals API. It exposes REST endpoints for registering users and retrieving calculated signals for a trading pair. Price data is fetched from public APIs and indicators such as moving averages and RSI are computed in background Celery tasks. Signals can also be pushed over WebSockets using Flask-SocketIO.
Install dependencies with pip:
pip install -r requirements.txt- Ensure Redis is available (Docker Compose provides a ready to use setup).
- Start the Flask application:
python run.py- In a separate terminal, run Celery:
celery -A crypto_signals.tasks worker --loglevel=infoYou can then send POST /register requests with JSON {"email": "[email protected]"} to create users. Signals for a pair can be retrieved from /signals/<pair>.
- Install Homebrew if it is not already available.
- Install Python 3 and Redis:
brew install python redis
brew services start redis # start Redis as a background service- (Optional) create a virtual environment:
python3 -m venv venv
source venv/bin/activate- Install the required Python packages:
pip install -r requirements.txt- Start the Flask application and the Celery worker in separate terminals:
python run.py
celery -A crypto_signals.tasks worker --loglevel=infoOnce running, the API will be available at http://localhost:5000.