Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

yoonbae81/yquant-py

Repository files navigation

yQuant

Python version PyPI version Test Build Coverage Docs License: GPL v3

Table of Contents

yQuant is an automatic trading system supporting backtest and trading engine with algorithmic trading strategy.

For detail on why I've been working on this project and what is the ultimate goal, take a look at the vision statement and features.

Installation

Install Python 3.10 on Ubuntu

$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt install python3.10 python3.10-venv

Clone repository from Github

$ git clone git@github.com:yoonbae81/yquant
$ cd yquant

Prepare Python runtime and virutal enviorment

$ python3.10 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Preparation

Fetching symbols of KOSPI and KOSDAQ exchanges:

$ python -m backtest.symbols.korea_symbols.json
Fetched 2,820 symbols
Saved in symbols.json

Usage

The following will execute the backtest with the symbols file, symbols.json in the same directory.

$ python backtest.py

Sample output as follows:

DEBUG monitor.bootstrap              Initializing...
DEBUG monitor.adapters.file_fetcher  Loading: 1.txt
DEBUG monitor.adapters.file_fetcher  Parsing: 091990 1000 1 1234512340
DEBUG monitor.messages               Created: TickFetched(chains=[], symbol='091990', price=1000.0, qty=1.0, timestamp=1234512340)
DEBUG monitor.facade                 Handler: <lambda> for TickFet hed(chains=[], symbol='091990', price=1000.0, qty=1.0, timestamp=1234512340)
DEBUG monitor.messages               Created: MarketClosed(chains=[], total_ticks=2)
DEBUG monitor.facade                 Handler: market_closed for MarketClosed(chains=[], total_ticks=2)

Support

Please open an issue for support.

Contributing

Please contribute using Github Flow. Create a branch, add commits, and open a pull request.

Testing

Test codes are prepared in tests/ based on PyTest framework.

About

An automatic algorithmic trading system supporting backtest and several brokerages

Resources

License

Stars

Watchers

Forks