Skip to content

Commit 25aba77

Browse files
committed
Initial commit
1 parent 199c762 commit 25aba77

16 files changed

+95
-0
lines changed

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# PyIndicators
2+
3+
PyIndicators is a powerful and user-friendly Python library for technical analysis indicators and metrics. Written entirely in Python, it requires no external dependencies, ensuring seamless integration and ease of use.
4+
5+
## Features
6+
7+
* Native Python implementation
8+
* Supports both pandas dataframes and polars dataframes
9+
10+
## Indicators
11+
12+
### Trend Indicators
13+
14+
#### Simple Moving Average (SMA)
15+
16+
```python
17+
from polars import DataFrame as plDataFrame
18+
from pandas import DataFrame as pdDataFrame
19+
20+
from pyindicators import sma
21+
22+
# Polars DataFrame
23+
pl_df = plDataFrame({"close": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]})
24+
25+
# Pandas DataFrame
26+
pd_df = pdDataFrame({"close": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]})
27+
28+
# Calculate SMA for Polars DataFrame
29+
pl_df = sma(pl_df, "close", 3)
30+
pl_df.show(10)
31+
32+
# Calculate SMA for Pandas DataFrame
33+
pd_df = sma(pd_df, "close", 3)
34+
print(pd_df)
35+
```
36+
37+
#### Exponential Moving Average (EMA)
38+
39+
```python
40+
from polars import DataFrame as plDataFrame
41+
from pandas import DataFrame as pdDataFrame
42+
43+
from pyindicators import ema
44+
45+
# Polars DataFrame
46+
pl_df = plDataFrame({"close": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]})
47+
# Pandas DataFrame
48+
pd_df = pdDataFrame({"close": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]})
49+
50+
# Calculate EMA for Polars DataFrame
51+
pl_df = ema(pl_df, "close", 3)
52+
pl_df.show(10)
53+
54+
# Calculate EMA for Pandas DataFrame
55+
pd_df = ema(pd_df, "close", 3)
56+
print(pd_df)
57+
```
58+
59+
### Momentum Indicators
60+
61+
#### Relative Strength Index (RSI)
62+
63+
```python
64+
from polars import DataFrame as plDataFrame
65+
from pandas import DataFrame as pdDataFrame
66+
67+
from pyindicators import rsi
68+
69+
# Polars DataFrame
70+
pl_df = plDataFrame({"close": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]})
71+
# Pandas DataFrame
72+
pd_df = pdDataFrame({"close": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]})
73+
74+
# Calculate RSI for Polars DataFrame
75+
pl_df = rsi(pl_df, "close", 14)
76+
pl_df.show(10)
77+
78+
# Calculate RSI for Pandas DataFrame
79+
pd_df = rsi(pd_df, "close", 14)
80+
print(pd_df)
81+
```

pyindicators/__init__.py

Whitespace-only changes.

pyindicators/exceptions.py

Whitespace-only changes.

pyindicators/indicators/__init__.py

Whitespace-only changes.

pyindicators/indicators/crossover.py

Whitespace-only changes.

pyindicators/indicators/crossunder.py

Whitespace-only changes.

pyindicators/indicators/exponential_moving_average.py

Whitespace-only changes.

pyindicators/indicators/rsi.py

Whitespace-only changes.

pyindicators/indicators/simple_moving_average.py

Whitespace-only changes.

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[tool.poetry]
2+
name = "pyindicators"
3+
version = "0.1.0"
4+
description = "PyIndicators is a powerful Python library designed to simplify technical analysis in financial markets. Whether you're a seasoned quant or a novice trader, PyIndicators provides a user-friendly interface for integrating a wide range of technical indicators into your data analysis and trading strategies."
5+
authors = ["Marc van Duyn"]
6+
readme = "README.md"
7+
8+
[tool.poetry.dependencies]
9+
python = "^3.9"
10+
11+
12+
[build-system]
13+
requires = ["poetry-core"]
14+
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)