Skip to content

jimmymaise/signal_controller

Repository files navigation

Trading Signal Controller: An Solution for Managing Trading Signals

Table of Contents

  1. Introduction
  2. Prerequisites
  3. Quick Start
  4. Built With
  5. Project Structure
  6. Core Features
  7. How to Contribute
  8. Licensing

Introduction

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.

Prerequisites

  • Python: Version 3.11
  • Django: Version 4.1.7
  • Database: PostgreSQL

Quick Start

Conventional Installation

  1. Clone the Git Repo
    git clone <repository_link>
  2. Install Dependencies
    poetry install
  3. Migrate the Database
    poetry run python manage.py migrate
  4. Start the Dev Server
    poetry run python manage.py runserver

Docker Setup

Navigate to the root folder of the project:

  1. Create Docker Image
    docker build -t trading_signal_controller .
  2. Initiate Docker Container
    docker run -p 8000:8000 trading_signal_controller

Built With

  • Web Framework: Django
  • RESTful API: Django REST Framework

Project Structure

  • 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 like MasterTrader.

Core Features

Balancer for Assignment

Introduction

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.

Implementation Steps

  1. Fetch Active Instances: Enumerates all active CrawlRunner and MasterTrader instances.
  2. Calculate Metrics: Finds total and average MasterTrader instances for each CrawlRunner.
  3. Early Exit Check: Exits the function if no active instances are found.
  4. Average Computation: Evaluates the average MasterTrader instances for each CrawlRunner.
  5. Identify Pending Assignments: Determines any remaining MasterTrader instances that need to be assigned.

How to Contribute

For a detailed guide on contributing to this project, please see CONTRIBUTING.md.

Licensing

The software is distributed under the MIT License. For additional details, refer to LICENSE.md.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published