Skip to content
PoivronJaune edited this page Oct 10, 2023 · 3 revisions

LogoMapleFrogStudio

Introduction

The hobby trader package is targeted to hobbyist who want to code in python using a practical project based in the financial world. This project will offer tools to grab historical price data, build local databases and apply technical analysis to try and get buy signals for stocks on the north american exchange market.

Objectives

  • Learn the basics of stock prices and how to get historical data
  • Build a local database with price information
  • Add trend analysis, technical analysis indicators or candlestick price patterns to help identify buying opportunities
  • Build trading strategies and backtest (from scratch - backtesting packages are complicated)
  • Simulate trades using a simple multi-asset portfolio and log the results
  • Analyse trades through simulations to improve and optimize strategies
  • Implement an automated interface with a broker tool for paper trading (or live trading for the more risk tolerent hobbyists)

High level view of project components

Package Components Schema

This project serves three main functions:

  • download historical price data (minute data is difficult to obtain for long periods)
  • Build trading universe to test out strategies
  • Expose a standard API to integrate with brokers for paper trading (simulated trading)

All downloaded data is stored in a github repo (symbols and minute price data).
A build_db example script can grab the minute data from github and build a SQLite3 Database with millions of prices available for testing strategies.
Universe and connected modules are the core of the project to learn, test trading strategies & integrate with brokers

Proposed project structure

For now, the project structure consists of a DATASET folder and a package folder with modules. The proposed folder hiearchy is shown below:

root of prokect folder/
├─ DATASET/
│  ├─ CSV               
│  ├─ PARQUET           
├─ examples/ 
├─ experiments/   
├─ hobbytrader/  
│  ├─ assets              
│  ├─ __init__.py              
│  ├─ database.py       
│  ├─ download.py       
│  ├─ github.py       
│  ├─ scrappers.py       
│  ├─ trades.py       
│  ├─ universe.py           
│  ├─ view.py
│  └─ yahoo.py       
└─ tests/         

Modules overview

Module Status Description
assets Not used Folder to store visual elements used in graphic presentations
databse Ready Main interaction with local SQLite3 database (mix of OOP & Procedural)
download Ready Main historical prices download module (built to use github actions)
github Ready Web scrapper to download files from github repos
portfolio Not started Trading Portfolio management for available cash & risk management
scrappers Ready Web scrapper to capture lists of symbols from different sources (Mostly OOP)
trades Not started Trades simulator - mostly backtesting (to be developped)
universe Ready Trading universe to organize multiple assets
symbols Refactored Move to scrappers or github - Grabs organized symbols lists from github or other sources
view Ready Command line utility to loop through daily data for all symbols loaded in universe
yahoo Ready Wrapper for yahoo finance api to download price data

Clone this wiki locally