Coder Social home page Coder Social logo

earningtrader's Introduction

earningtrader

A trading platform based on the Reinforcement Learning framework

(Warning) This project is under development, but not to be released and used yet. Currently, the architectural design and the executable functions barely outlines the initial idea of this library. Therefore, they are not yet stabilized at the moment. The architecture style, RL algorithms, and other performance features are intended to be added and continuously improved.

Getting Started

Prerequisites

This library assumes that:

  • your Python version is equal to or above 3.9
  • your operating system is either MacOS or Linux(We haven't tested Windows yet, but we will work on it in the near future)

Installation

(Remark) Since we won't release the package as a usuable one in production environment yet, currently you can only install the package fromo the TestPyPI.

pip install -i https://test.pypi.org/simple/ earningtrader

Hands-On Examples

(Remark) Note that the overall architectural design is premature; we will improve in the future updates.

Here is a list of examples:

Project Overview

Project Architecture

The image below depicts a general worflow of the entire system. However, this could vary depending on the algorithmic model or particular financial data you choose.

There are five main components in the project.

  1. Data Acquisition: This component retrieves financial data from external API vendors. We have only implemented a fetcher using yfinance for demonstration.

  2. Data Preprocessor: A preprocessor attempts to refine the retrieved data from a data acquisition component.

  3. RL Algorithmic Model: A reinforcement learning algorithm must be implemented to integrate with the system. That is, you need to define

  • state
  • a collection of actions
  • reward

The goal of this library is to provide the state-of-the-art RL algorithms for various financial trades. However, we would like to provide you with the freedom to implement your own algorithms in future updates.

  1. Trader: We need a component that handles actual trading using the external vendor APIs. This component is similar to the data acquisition part, but requires a more careful and sophisticated implementation(otherwise you will loose your money!).

  2. Storage: The storage is for accumulating model data, such as parameters or historical rewards. Therefore, classical relational databases are not suitable for our purpose. Currently we only provide a very simple storage solution using the shelve library.

On top of these essential components, we provide a temporary object called the "controller", which controlls the entire workflow of the system. However the actual usage of this component is little bit demanding for the clients; hence we will remove or modify this component for easier usage.

License

This project is licensed under the terms of the MIT license.

earningtrader's People

Contributors

uponthesky avatar

Watchers

Kostas Georgiou avatar  avatar

earningtrader's Issues

data preprocessing

Getting the data afterwards, preprocess the data according to the model(what does the model need?).

A pipeline is a chain of producer - consumer.

  • provide metadata for the returning values from the data acquisition part => add validation function
  • do the same thing for the data preprocessing part as well
  • implement the interface for the data preprocessing component

trading

Make a real trading action that has been determined from the previous training stage.

Remark: Currently we'll only design the interface for this component.

  • design interface

loggin system

Design and implement the logging system

  • implement file logger
    • logging to log files(output / error)
    • considering thread-safe
  • unit testing

storage

Implement the storage component

  • design the interface
  • implement a simple storage using shelve
  • unit testing

model training

Train the model with the given preprocessed data(implement Thompson Sampling)

  • implement the model component interface
  • load the model from the storage(parametric model)
  • make an action given the new state data from the preprocessing stage
  • get a reward and update the parameter

Basic setup

Basic setups

  • adding precommit hook
  • adding testing, formatting, linting framework

documentation

Project Documentation

  • Overview
  • Getting Started
  • Example
  • License

data acquisition

The data acquisition layer is responsible for fetching data from external sources such as REST APIs provided by finance data service vendors.

Our strategy here is to provide adapters of well known APIs/libraries, such as yfinance.

But at the same time, we also would like to provide the programmers freedom to implement their own customized adapters. Therefore, we will provide an abstract class(or an interface) that requires such adapters to implement necessary traits.

  • implement the interface for the adaptors
  • implement yfinance adaptor
  • write a test for yfinance adaptor
  • add cicd yaml

deploy as a library

Deploy: build - test - release

  • build the project
  • add to the CI/CD pipeline
  • add more comprehensive documentations

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.