- Introduction
- Prerequisites
- Quick Start
- Built With
- Project Structure
- Core Features
- How to Contribute
- Licensing
Trading Signal Controller is an application for managing trading signals. Built on Django, the system aims to streamline the handling of trading signals across both development and production settings.
- Python: Version 3.11
- Django: Version 4.1.7
- Database: PostgreSQL
- Clone the Git Repo
git clone <repository_link>
- Install Dependencies
poetry install
- Migrate the Database
poetry run python manage.py migrate
- Start the Dev Server
poetry run python manage.py runserver
Navigate to the root folder of the project:
- Create Docker Image
docker build -t trading_signal_controller .
- Initiate Docker Container
docker run -p 8000:8000 trading_signal_controller
- Web Framework: Django
- RESTful API: Django REST Framework
pyproject.toml
: Manages package metadata and dependencies.Dockerfile
: Sets up the Python runtime, handles dependencies, and starts the app with Gunicorn.nginx.conf
: Configures Nginx as a reverse proxy and serves static files.docker-compose.yaml
: Manages multi-container Docker applications.wsgi.py
&asgi.py
: Set up WSGI and ASGI servers for deployment.models.py
: Houses data models likeMasterTrader
.
The function balance_runner_assignment
in src/api/models.py
balances the allocation of MasterTrader
instances across active CrawlRunner
instances to prevent any one from being overloaded.
- Fetch Active Instances: Enumerates all active
CrawlRunner
andMasterTrader
instances. - Calculate Metrics: Finds total and average
MasterTrader
instances for eachCrawlRunner
. - Early Exit Check: Exits the function if no active instances are found.
- Average Computation: Evaluates the average
MasterTrader
instances for eachCrawlRunner
. - Identify Pending Assignments: Determines any remaining
MasterTrader
instances that need to be assigned.
For a detailed guide on contributing to this project, please see CONTRIBUTING.md.
The software is distributed under the MIT License. For additional details, refer to LICENSE.md.