Skip to content

TeroMeht/12_HandleTradeData

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

12_HandleTradeData

Problem

How to review your trades so that you can see multiple timeframes at the same time. Understanding price position is an important part of crafting your edge in the markets

Solution

Build database to organize trading data and executions. This will make pattern recognition much easier in the future similar situations.

Database design

There are 3 different tables for each market data timeframe. TradeId is used as primary key between these. All trades and their details are saved into trades table. Executions are fetched from Interactive Brokers .tlg tradelog file when processing the data.

image image

Example query from table marketdatad image

Software components

Common Folder

The common folder contains pieces of software that are commonly used across multiple projects. My aim is to keep this folder up-to-date so that calculations, such as the VWAP example, are always executed using the same code, ensuring consistency.

Helpers Folder

The helpers folder contains assisting functions. This folder still constitutes a major part of the program logic. For example:

HandleExecutions.py – Processes execution data from .tlg files.

ReadTlgFile.py – Reads Interactive Brokers trade log files.

FetchIBData.py – Handles fetching data from Interactive Brokers.

HandleDataFrames.py – Manages incoming bar data, which is already provided in a Pandas DataFrame structure.

Configuration

config.json – Specifies paths for .tlg files and, potentially, locations for manual data entry. Also TWS API connection details are here.

Main Entry Point

Main.py – The main script where the program starts execution.

Database folder

DBfunctions.py is responsible for all my database insert and fetch operations. Database is being build on top of PostgresSQL. As service providor I use Heroku

About

Trade database manager

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages