Skip to main content

A library for real-time macro grid calculation for stock daily and tick-level data

Project description

macro-gridder

A Python library for real-time macro grid calculation for stock daily and tick-level data.

中文文档 | English Documentation

Overview

macro-gridder is a specialized library designed to transform price data into grid-based representations, supporting both macro grids and micro units. It's particularly useful for technical analysis, algorithmic trading, and visualization of price movements in financial markets.

Features

  • Support for both daily and tick-level data
  • Real-time grid calculation for streaming data
  • Efficient data structures for high-frequency updates
  • Visualization tools for grid-based analysis
  • Compatible with various data sources

Installation

pip install macro-gridder

Quick Start

import pandas as pd
from macro_gridder import MacroGridder

# Load your price data
data = pd.read_csv('stock_data.csv')
prices = data['close']
times = data.index

# Configure the grid
config = {
    'horizontal_step': 10,  # Time dimension grid step
    'vertical_step': 20,    # Price dimension grid step
    'min_price_tick': 0.01  # Minimum price tick
}

# Create a grid
gridder = MacroGridder(config)
grid_df = gridder.create_grid(times, prices)

# Analyze grid data
print(grid_df.head())

Real-time Processing

from macro_gridder import RealtimeMacroGridder

# Initialize with historical data
gridder = RealtimeMacroGridder(config)
gridder.initialize_with_history(history_times, history_prices)

# Process new tick data
for time, price in new_data:
    h_idx, v_idx = gridder.update_with_tick(time, price)
    grid_info = gridder.get_current_macro_grid()
    # Use grid_info for trading decisions

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

macro_gridder-0.1.4.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

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

macro_gridder-0.1.4-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file macro_gridder-0.1.4.tar.gz.

File metadata

  • Download URL: macro_gridder-0.1.4.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for macro_gridder-0.1.4.tar.gz
Algorithm Hash digest
SHA256 97de55299c263d76dcb0afe7bfed6c08f28b4bd1aa3d26d8075759851688a666
MD5 382d00025756c27659747027bbf05fbb
BLAKE2b-256 2496d21d0fc74662a37493166493324e8cf2cd2ad7bc82f13992b213748a55a8

See more details on using hashes here.

File details

Details for the file macro_gridder-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: macro_gridder-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for macro_gridder-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 59cd3c456a812ba07466229b88e9d29d185164e84e21645c1d79927fc78a6c3b
MD5 89c1b48605bfbe480692de2e41fd9ae3
BLAKE2b-256 eae1237c512c22d8ca1bb2d0cecbbb694314c86cb980a4d5c26dd049d16a3278

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