Skip to main content

Persnal project for stock market data analysis

Project description

Finmetry

This project is developed for my personal use. I am developing this to keep the documentation, architecture and pipeline consistent so that I can focus more on developing strategies instead of developing pipelines.

Visit Finmetry guide for further steps.

flowchart TB

subgraph DATA["Data handling"]
    %% direction  LR
    s1[Stock]
    
    subgraph Download["Downloading data"]
    dp[Client API]
    dh[finmetry<br>Client]
    end

    subgraph LOCAL["Local data"]
    db[(database <br> local storage)]
    end
    s1 --request--> dh --request--> dp --data--> dh --data-->s1
    s1 --write-->db --read--> s1

end

s1 --> sd1@{ shape: procs, label: "StockDict"}

subgraph STRATEGY["Strategy"]
    %% direction LR
    sdata[StgDataLoader] -->
    mgdata[MarketGraphData] -->
    stg1[Strategy]
end

orders@{ shape: docs, label: "Orders" }
stginput@{ shape: lean-r, label: "TimeStamp" }
stg1 --> orders
sd1 --> sdata
stginput --> sdata

%% sd1 --data for stock *i* from <br>*t1* to *t2* timestamp--> dh
%% dh --OHLCV dataframe--> sd1

This project is solely developed for my personal use. I am publishing this only to keep myself updated and to remove the headache of setting up the framework again and again.


Finmetry is a research-first quantitative trading framework designed to keep strategy logic, execution logic, and accounting logic strictly separated.

It exists to eliminate repeated reinvention of trading pipelines, so you can focus on researching strategies, not rebuilding infrastructure.

What Finmetry Is (and Is Not)

Finmetry is:

  • a framework for systematic trading research
  • equally suited for backtesting and live trading
  • opinionated by design
  • built around explicit, auditable abstractions

Finmetry is not:

  • a strategy library
  • a signal generator
  • a black-box trading system

If you want flexibility at the cost of correctness, this framework will feel restrictive. That restriction is intentional.

The Core Trading Loop

Every strategy in finmetry follows the same explicit loop:

Market Data → Strategy → Orders → Portfolio → Execution → Accounting

Each stage is implemented as a separate module with strict responsibilities.

This guarantees that:

  • strategies remain stateless
  • execution assumptions are explicit
  • accounting is consistent
  • backtests can be trusted
  • live trading reuses the same abstractions

High-Level Architecture

flowchart LR
    Data[Market Data]
    Strategy[Strategy]
    Orders[Orders]
    Portfolio[Portfolio]
    Execution[Execution Model]
    Accounting[State & PnL]

    Data --> Strategy
    Strategy --> Orders
    Orders --> Portfolio
    Portfolio --> Execution
    Execution --> Portfolio
    Portfolio --> Accounting

Major Modules

Finmetry is organized into the following conceptual modules:

Client Handling

Handles interaction with external systems such as broker APIs and live data feeds. Keeps the rest of the framework broker-agnostic.

Stocks

Manages symbols, historical data, and OHLCV storage. Acts as the foundation for all market data access.

Strategy

Consumes immutable market snapshots and emits order intent only. Strategies never manage cash, positions, or execution details.

Orders

Orders are the contract between strategy, portfolio, and execution. They represent intent, not outcome.

Executioners

Simulate (or connect to) market reality: slippage, brokerage, partial fills, or live execution.

Portfolio

The single source of truth for positions, cash, and PnL. All state mutation happens here.

Backtesting

Pure orchestration. Iterates over time and wires everything together without adding logic.

Final Note

I have built this for my personal use in mind.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finmetry-2.0.3.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finmetry-2.0.3-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file finmetry-2.0.3.tar.gz.

File metadata

  • Download URL: finmetry-2.0.3.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for finmetry-2.0.3.tar.gz
Algorithm Hash digest
SHA256 26643dbb2cc0f21f4aec4e6b44a59043d9d29830fbcb3f1e3d2b72724e2df121
MD5 8b010dfa1303f0ec99426c28b319c870
BLAKE2b-256 8bb088fc89dfe9aa5040cf378b4d26d7fe8e6ce64858a9d03578841e467ba628

See more details on using hashes here.

File details

Details for the file finmetry-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: finmetry-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for finmetry-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 47b1d84410e276fee9a14c4cc9b0a2cd9c7d857b0225ff87aae17646db59bb71
MD5 9dc057e29316b804ebacf71ccf9cad57
BLAKE2b-256 c45c483f6bfcaab6b499660c37f529808e6c59216b760edfbd1860c5d7325c92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page