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.3.tar.gz (13.0 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.3-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: macro_gridder-0.1.3.tar.gz
  • Upload date:
  • Size: 13.0 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.3.tar.gz
Algorithm Hash digest
SHA256 82c70d8cdee75fa3a10c0d01c229c1656237484dd6816875712ad1dbd73fa505
MD5 4be7cfe8f99563c344599208778e1a69
BLAKE2b-256 9f6cd7396dab4e63063806bb0ebfc2a881775ec2613e7abb745e51c3068ce525

See more details on using hashes here.

File details

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

File metadata

  • Download URL: macro_gridder-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 14.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 77ec2c883613b9e13ec096934ffaf892389a2dfcd4094946b931825fd133b556
MD5 120cbd38fd8c46206df34da77d95a330
BLAKE2b-256 ef222289434ac65af0c20a8dc139f3a8d4e26e6349d63e58c3843b82f7057507

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