Utilities for intrinsic time decomposition and fractal event analysis
Project description
IntrinsicTime
Utilities for decomposing intrinsic time events and analyzing fractal scaling behavior in price or signal data.
This package provides:
- dcos_core: A Directional Change and Overshoot (DcOS) event detector.
- dcos_fractal: Tools for fractal scaling and multi-threshold analysis.
- dcos_plot: Plotly visualization for interactive fractal plots.
Installation
From PyPi
pip install IntrinsicTime
From GitHub
pip install git+https://github.com/THouwe/IntrinsicTime.git
Local Install
git clone https://github.com/THouwe/IntrinsicTime.git
cd IntrinsicTime
pip install -e .
Dependencies
See requirements.txt.
Overview
DcOS events are first‑passage moves of size δ in log space
Robust power‑law behaviour can be observed for many phenomena. For instance, Intrinsic Time event density of BTCUSDT price ticks scale linearly with DcOS δ threshold in log space (cit), consistently with first‑passage theory (cit) plus market microstructure. However, this is the case only within a given range of δ thresholds, as the power law may brake at 'extremely low' or 'extremely high' δs.
For small δs, issues relate to microstructure noise (tick size, latency, and irregular sampling inject high‑frequency mean reversion. This raises event frequency toward a ceiling and flattens the log–log curve) and discretization limits (time and sample - e.g., price - granularity cap how many distinct first‑passage events you can observe).
For large δs, issues relate to data scarcity: too few events reduce fit quality and increase variance.
Fractal brakepoint formalization
Compute local slopes (b(\delta)) with a sliding window (w) on ((\log \delta,\log f)). Mark the smallest δ where either (R^2 < R^2_{\min}) or (|\Delta b|) exceeds one standard error from adjacent windows. Your windowed method will return something close to δ ≈ 6e‑4 for this dataset if your visual read is correct.
Example Usage
import numpy as np
import pandas as pd
from IntrinsicTime import DcOS_fractal
# Example input DataFrame
df = pd.DataFrame({
"Timestamp": range(1000),
"Price": 100 + np.cumsum(np.random.randn(1000))
})
# Initialize and run
analyzer = DcOS_fractal(debugMode=True)
results, ranges = analyzer.run(df)
# Display results
print(results.head())
print(ranges)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file intrinsictime-0.1.3.tar.gz.
File metadata
- Download URL: intrinsictime-0.1.3.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c867b7db8f2a1d5d94985fa5a440d9982aa7e69ce89de6733de0e81389f2d7aa
|
|
| MD5 |
67532ab0b354097a7cf5e1e670d8e713
|
|
| BLAKE2b-256 |
9e1df342e6cc05826ed0b755d1f9fa1e43518d7a15f9e8fda46ec42b91d2eea0
|
File details
Details for the file intrinsictime-0.1.3-py3-none-any.whl.
File metadata
- Download URL: intrinsictime-0.1.3-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d9f042e986b376691e37175951f40519db42ab04ab2ab689500b397f4ee6bc9
|
|
| MD5 |
e204c8e607136951502a200e52c0cd04
|
|
| BLAKE2b-256 |
0160ae1efa7f4db5e95c6b6cc114ac23722a39527a08cc0f632d6e3c6f9d3339
|