Skip to content

Releases: ff137/ohlc-toolkit

0.4.0

Choose a tag to compare

@ff137 ff137 released this 08 Jun 18:40
cd609f9

ohlc-toolkit 0.4.0

BitstampDatasetDownloader is now renamed to DatasetDownloader

Improved support for parsing or formatting timeframes

Added mypy and fixed errors

What's Changed

Full Changelog: 0.3.3...0.4.0

0.3.3

Choose a tag to compare

@ff137 ff137 released this 08 Jun 12:50
b036b02

ohlc-toolkit 0.3.3

Method to calculate future percentage returns has been added.

  • The pandas_ta dependency has been removed in favour of replicating required methods directly within ohlc-toolkit.

What's Changed

  • 📄 Update license by @ff137 in #17
  • ✨ Add function to calculate percentage return by @ff137 in #18
  • 🔖 Release 0.3.3 by @ff137 in #21

Full Changelog: 0.3.2...0.3.3

0.3.2

Choose a tag to compare

@ff137 ff137 released this 27 Feb 21:16
db931db

ohlc-toolkit 0.3.2

A helper downloader class (BitstampDatasetDownloader) has been added which allows automated downloading of historical and updated datasets from https://github.com/ff137/bitstamp-btcusd-minute-data

Example doc and script has been updated to reflect this new feature.

What's Changed

  • 👷 Deploy to GitHub Pages workflow by @ff137 in #12
  • 👷 Add Codacy workflow and coverage report by @ff137 in #14
  • ✨ Bitstamp Dataset Downloader by @ff137 in #13
  • 👷 Run tests on push to main by @ff137 in #15
  • 🎨 Add Codacy badges by @ff137 in #16

Full Changelog: 0.3.1...0.3.2

0.3.1

Choose a tag to compare

@ff137 ff137 released this 25 Feb 19:13
61c5d99

ohlc-toolkit 0.3.1

Quick patch release to configure the chunk-aggregation cut-off as an env var, and to update README to reflect new feature.

What's Changed

  • 🔧 Allow cut-off to be configured by env var by @ff137 in #11

Full Changelog: 0.3.0...0.3.1

0.3.0

Choose a tag to compare

@ff137 ff137 released this 25 Feb 18:59
0473507

ohlc-toolkit 0.3.0

This release adds support for transforming a 1-minute OHLC dataframe into any arbitrary timeframe that you like, with custom step sizes and robust data validation throughout.

A rolling-aggregation (ohlc_toolkit.transform.rolling_ohlc) method is defined that computes OHLC's for any desired timeframe.

This can be achieved using the new method: ✨

def transform_ohlc(
    df_input: pd.DataFrame, timeframe: Union[int, str], step_size_minutes: int = 1
) -> pd.DataFrame:
    """Transform OHLC data to a different timeframe resolution.

    Args:
        df_input (pd.DataFrame): Input DataFrame with OHLC data.
        timeframe (Union[int, str]): Desired timeframe resolution, which can be
            an integer (in minutes) or a string (e.g., '1h', '4h30m').
        step_size_minutes (int): Step size in minutes for the rolling window.

    Returns:
        pd.DataFrame: Transformed OHLC data.
    """

This means that if you have 1-minute data, you can use transform_ohlc to generate a new view of the data, for any arbitrary timeframe.


Developer notes:

The rolling-aggregation iterates at the same resolution of the input (1-minute data yields 1-minute granularity for any timeframe size). So, if you are only interested in large step-sizes (e.g. you want 1-week timeframe output, and a 1-minute granularity doesn't make sense for you), then rolling-aggregation can be very inefficient, since we will discard many of those computed values by applying the requested step size after the fact. Therefore, when appropriate, we optimize runtime by utilizing a chunk-based aggregation method instead of the rolling one.

Please be aware that a timeit script was used to determine a reasonable cut-off point for when to use rolling vs chunk-based OHLC aggregation. This script is included in examples/experiment/chunk_vs_rolling_aggregation.py for documentation purposes.

To compute a new OHLC dataset for 50 days of 1-minute data, it takes about 5 seconds (using rolling aggregation). If step-size is increased to 15m, it takes about 1 second (using chunk-based aggregation).

What's Changed

  • ✨ Transform 1-minute data into any OHLC timeframe by @ff137 in #10

Full Changelog: 0.2.0...0.3.0

0.2.0

Choose a tag to compare

@ff137 ff137 released this 25 Feb 15:15
7b64e95

ohlc-toolkit 0.2.0

Default data schemas have been updated as follows:

We now expect OHLCV (open-high-low-close-volume) values to be float32's, for lower memory usage by default.

Note: If you're working with 💩-coin data, with btc as the base currency, you may want to request float64's for higher precision. But this is only ~10 satoshi precision matters. float32 (7-decimal precision) is more than good enough for most datasets.

If you are working with data that requires no decimals, you can read data with int32 dtypes

We also add datetime representation of the timestamp to the index of the OHLC dataframe.

What's Changed

  • ✨ Enhance default dataframe schema by @ff137 in #9

Full Changelog: 0.1.1...0.2.0

0.1.1

Choose a tag to compare

@ff137 ff137 released this 25 Feb 10:19
f91f22e

ohlc-toolkit 0.1.1

Just a patch release with some minor logging fixes, improved validation error messages, more testing, and example docs.

What's Changed

  • 🎨 Fix logging in util methods by @ff137 in #4
  • 🎨 Raise helpful message for bad input data by @ff137 in #5
  • ✅ Test coverage for log_config by @ff137 in #6
  • 📖 Add examples by @ff137 in #7
  • 🔖 Release 0.1.1 by @ff137 in #8

Full Changelog: 0.1.0...0.1.1

0.1.0

Choose a tag to compare

@ff137 ff137 released this 21 Feb 20:05
28fe598

ohlc-toolkit 0.1.0

This marks our first release! 🎉

The ohlc-toolkit is designed to provide a flexible and efficient way to work with OHLC (Open, High, Low, Close) data.

The library currently only offers the most basic feature: reading OHLC data from CSV files, and performing basic data validation (no nulls, no duplicates, no missing minutes; logging warnings otherwise).

This is not intended to be a useful release. We've just laid the foundation, with automated workflows for testing and publishing to PyPI.

Next features coming up soon™️:

  • transform 1-minute or other datasets into other timeframes
  • compute technical indicators

What's Changed

  • 👷 Test and publish workflow by @ff137 in #1
  • 👷 Add Dependabot workflow by @ff137 in #2
  • 👷 Add workflow to publish to PyPI on release by @ff137 in #3

New Contributors

  • @ff137 made their first contribution in #1

Full Changelog: https://github.com/ff137/ohlc-toolkit/commits/0.1.0