Skip to main content

No project description provided

Project description

amarket

Abstract Market (or "Any Market", or just "A Market") is a high-level implementation of market entities like Orders, Positions, etc. (Abstract market functions/classes, that works on any market.)

This module use only standard Python library and contain no external dependencies from anywhere, except OHLC-related parts of it, that requires numpy and pandas (and also TA-Lib for calculating technical analysis features over OHLC data)

Overview

The amarket package provides a comprehensive framework for working with financial markets in a standardized way, abstracting away the specifics of different exchanges and trading platforms. It's designed to work with various market data sources while providing consistent interfaces for:

  • Market representation (symbols, exchanges, timeframes)
  • OHLC (Open-High-Low-Close) data handling
  • Trading positions and orders
  • Portfolio management and rebalancing
  • Market data providers

Key Components

Core Interfaces

  • IMarket: Abstract interface representing any trading market with specific symbol and timeframe
  • IOhlc: Interface for OHLC data management
  • ITradingAccount: Interface for trading account operations

Base Classes

  • MarketBase: Base class for implementing specific market functionality
  • Ohlc: Class for managing OHLC time-series data with support for current and closed candles
  • Portfolio: Class for portfolio management, including rebalancing and value calculation

Modules

  • base/: Core abstract classes and interfaces
  • interfaces/: Abstract interfaces defining the contract for market components
  • ohlc/: OHLC data handling and processing functionality
  • portfolio/: Portfolio management capabilities
  • types/: Type definitions used throughout the package

Features

  1. Exchange Agnostic: Designed to work with any exchange or trading platform through abstraction
  2. OHLC Data Management: Robust handling of time-series market data with configurable timeframes
  3. Portfolio Management: Tools for portfolio construction, rebalancing, and value tracking
  4. Singleton Pattern: Market instances are managed as singletons to ensure consistency
  5. Thread Safety: Built-in locking mechanisms for concurrent access

Dependencies

The project requires standard Python libraries plus:

  • numpy>=2.3.1 (for amarket.ohlc and amarket.portfolio packages)
  • pandas>=2.3.0 (for amarket.ohlc)
  • TA-Lib>=0.6.4 (for amarket.ohlc.Featurizer)

Usage

The package is designed to be extended by specific implementations for different exchanges or trading platforms, providing a consistent API while allowing for exchange-specific behavior.

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

amarket-0.1.0.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

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

amarket-0.1.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file amarket-0.1.0.tar.gz.

File metadata

  • Download URL: amarket-0.1.0.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for amarket-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b58ec5bfd5710cdb113ad3243c662eaf34cab723f591d456f0f1fd26bbcc7cb0
MD5 7aed976cf7274309ccdf14f4eb1abcab
BLAKE2b-256 7e01454fa4d1ea7a4e74f3898b8cc4bdd352b152c3e331bcb96113c53971ddb8

See more details on using hashes here.

File details

Details for the file amarket-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: amarket-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for amarket-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 652411ee01821ed5356d89f267ff4b31ce5b6c580a22cce750dee3932973e1e6
MD5 407a80299e13b9c4bc5e75f273b22a9a
BLAKE2b-256 a636867ff03e7bb0a3c19c521f2e82d5289a53a91f9bb0b210bafd51f3cebf7b

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