Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ logo: /assets/icons/android-chrome-192x192.png

# .NET site URL refs
dotnet:
repo: "https://github.com/DaveSkender/Stock.Indicators"
src: "https://github.com/DaveSkender/Stock.Indicators/blob/main/src"
charts: "https://raw.githubusercontent.com/DaveSkender/Stock.Indicators/main/docs/assets/charts"
repo: "https://github.com/facioquo/stock-indicators-dotnet"
src: "https://github.com/facioquo/stock-indicators-dotnet/blob/main/src"
# The .NET docs moved to VitePress in v3.0.0 (896ae089), which deleted
# docs/assets/charts and renamed the surviving images to kebab-case.
# raw.githubusercontent does not follow repo renames, so the old
# DaveSkender/Stock.Indicators URLs 404. Pinned to the last commit that
# still carries the full PascalCase set — four of the images referenced
# here (AdIndex, Correlation, HeikinAshi, StdDevChannelsFull) have no
# equivalent in the current tree.
charts: "https://raw.githubusercontent.com/facioquo/stock-indicators-dotnet/d0b99458e17505c32b966109b5e38979cd25c047/docs/assets/charts"

# this site URL refs
python:
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Beta.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-r

```python
from stock_indicators import indicators
from stock_indicators import BetaType # Short path, version >= 0.8.1
from stock_indicators import BetaType # Short path, version >= 0.8.1

# This method is NOT a part of the library.
history_SPX = get_historical_quotes("SPX")
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Chandelier.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-r

```python
from stock_indicators import indicators
from stock_indicators import ChandelierType # Short path, version >= 0.8.1
from stock_indicators import ChandelierType # Short path, version >= 0.8.1

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Doji.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ from stock_indicators import indicators
quotes = get_historical_quotes("SPY")

# Calculate
results = indicators.get_doji(quotes);
results = indicators.get_doji(quotes)
```

## About {{ page.title }}
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Ema.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-r

```python
from stock_indicators import indicators
from stock_indicators import CandlePart # Short path, version >= 0.8.1
from stock_indicators import CandlePart # Short path, version >= 0.8.1

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Kama.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ from stock_indicators import indicators
quotes = get_historical_quotes("SPY")

# Calculate KAMA(10,2,30)
results = indicators.get_kama(quotes, 10,2,30)
results = indicators.get_kama(quotes, 10, 2, 30)
```

## About {{ page.title }}
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Keltner.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ from stock_indicators import indicators
quotes = get_historical_quotes("SPY")

# Calculate Keltner(20)
results = indicators.get_keltner(quotes, 20,2.0,10)
results = indicators.get_keltner(quotes, 20, 2.0, 10)
```

## About {{ page.title }}
Expand Down
4 changes: 2 additions & 2 deletions docs/_indicators/MaEnvelopes.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-r

```python
from stock_indicators import indicators
from stock_indicators import MAType # Short path, version >= 0.8.1
from stock_indicators import MAType # Short path, version >= 0.8.1

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")

# Calculate 20-period SMA envelopes with 2.5% offset
results = indicators.get_ma_envelopes(quotes, 20, 2.5, MAType.SMA);
results = indicators.get_ma_envelopes(quotes, 20, 2.5, MAType.SMA)
```

## About {{ page.title }}
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Mama.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ from stock_indicators import indicators
quotes = get_historical_quotes("SPY")

# Calculate Mama(0.5,0.05)
results = indicators.get_mama(quotes, 0.5,0.05)
results = indicators.get_mama(quotes, 0.5, 0.05)
```

## About {{ page.title }}
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Marubozu.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ from stock_indicators import indicators
quotes = get_historical_quotes("SPY")

# Calculate
results = indicators.get_marubozu(quotes);
results = indicators.get_marubozu(quotes)
```

## About {{ page.title }}
Expand Down
4 changes: 2 additions & 2 deletions docs/_indicators/PivotPoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-r

```python
from stock_indicators import indicators
from stock_indicators import PeriodSize, PivotPointType # Short path, version >= 0.8.1
from stock_indicators import PeriodSize, PivotPointType # Short path, version >= 0.8.1

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")

# Calculate Woodie-style month-based Pivot Points
results = indicators.get_pivot_points(quotes, PeriodSize.MONTH, PivotPointType.WOODIE);
results = indicators.get_pivot_points(quotes, PeriodSize.MONTH, PivotPointType.WOODIE)
```

## About {{ page.title }}
Expand Down
4 changes: 2 additions & 2 deletions docs/_indicators/Pivots.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-r

```python
from stock_indicators import indicators
from stock_indicators import EndType # Short path, version >= 0.8.1
from stock_indicators import EndType # Short path, version >= 0.8.1

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")

# Calculate Pivots(2,2,20) using High/Low values
results = indicators.get_pivots(quotes, 2, 2, 20, EndType.HIGH_LOW);
results = indicators.get_pivots(quotes, 2, 2, 20, EndType.HIGH_LOW)
```

## About {{ page.title }}
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Pmo.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ from stock_indicators import indicators
quotes = get_historical_quotes("SPY")

# Calculate 20-period PMO
results = indicators.get_pmo(quotes, 35,20,10)
results = indicators.get_pmo(quotes, 35, 20, 10)
```

## About {{ page.title }}
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Pvo.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ from stock_indicators import indicators
quotes = get_historical_quotes("SPY")

# Calculate Pvo(12,26,9)
results = indicators.get_pvo(quotes, 12, 26, 9);
results = indicators.get_pvo(quotes, 12, 26, 9)
```

## About {{ page.title }}
Expand Down
6 changes: 3 additions & 3 deletions docs/_indicators/Renko.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-r

```python
from stock_indicators import indicators
from stock_indicators import EndType # Short path, version >= 0.8.1
from stock_indicators import EndType # Short path, version >= 0.8.1

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")

# Calculate
results = indicators.get_renko(quotes, 2.5, EndType.CLOSE);
results = indicators.get_renko(quotes, 2.5, EndType.CLOSE)
```

## ATR Variant
Expand Down Expand Up @@ -122,7 +122,7 @@ from stock_indicators import indicators
quotes = get_historical_quotes("SPY")

# Calculate
results = indicators.get_renko_atr(quotes, atr_periods);
results = indicators.get_renko_atr(quotes, atr_periods)
```

## About {{ page.title }}
Expand Down
4 changes: 2 additions & 2 deletions docs/_indicators/RollingPivots.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-r

```python
from stock_indicators import indicators
from stock_indicators import PivotPointType # Short path, version >= 0.8.1
from stock_indicators import PivotPointType # Short path, version >= 0.8.1

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")

# Calculate Woodie-style 14 period Rolling Pivot Points
results = indicators.get_rolling_pivots(quotes, 14, 0, PivotPointType.Woodie);
results = indicators.get_rolling_pivots(quotes, 14, 0, PivotPointType.Woodie)
```

## About {{ page.title }}
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Sma.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-r

```python
from stock_indicators import indicators
from stock_indicators import CandlePart # Short path, version >= 0.8.1
from stock_indicators import CandlePart # Short path, version >= 0.8.1

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/StdDevChannels.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ from stock_indicators import indicators
quotes = get_historical_quotes("SPY")

# calculate StdDevChannels(20,2)
results = indicators.get_stdev_channels(quotes, 20,2)
results = indicators.get_stdev_channels(quotes, 20, 2)
```

## Alternative depiction for full quotes variant
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Vortex.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ from stock_indicators import indicators
quotes = get_historical_quotes("SPY")

# Calculate 14-period VI
results = indicators.get_vortex(quotes, 14);
results = indicators.get_vortex(quotes, 14)
```

## About {{ page.title }}
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Vwap.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ from stock_indicators import indicators
quotes = get_historical_quotes("SPY")

# Calculate
results = indicators.get_vwap(quotes);
results = indicators.get_vwap(quotes)
```

## About {{ page.title }}
Expand Down
2 changes: 1 addition & 1 deletion docs/_indicators/Wma.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-r

```python
from stock_indicators import indicators
from stock_indicators import CandlePart # Short path, version >= 0.8.1
from stock_indicators import CandlePart # Short path, version >= 0.8.1

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")
Expand Down
4 changes: 2 additions & 2 deletions docs/_indicators/ZigZag.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-r

```python
from stock_indicators import indicators
from stock_indicators import EndType # Short path, version >= 0.8.1
from stock_indicators import EndType # Short path, version >= 0.8.1

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")

# Calculate 3% change ZIGZAG
results = indicators.get_zig_zag(quotes, EndType.CLOSE, 3);
results = indicators.get_zig_zag(quotes, EndType.CLOSE, 3)
```

## About {{ page.title }}
Expand Down
22 changes: 11 additions & 11 deletions docs/pages/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ results = indicators.get_sma(quotes, 20)
# use results as needed for your use case (example only)
for r in results:
print(f"SMA on {r.date.date()} was ${r.sma or 0:.4f}")

```

```console
Expand Down Expand Up @@ -167,9 +166,10 @@ If you are using `pandas.DataFrame` to hold quote data, you have to convert it i
from stock_indicators import Quote

quotes_list = [
Quote(d,o,h,l,c,v)
for d,o,h,l,c,v
in zip(df['date'], df['open'], df['high'], df['low'], df['close'], df['volume'])
Quote(d, o, h, l, c, v)
for d, o, h, l, c, v in zip(
df["date"], df["open"], df["high"], df["low"], df["close"], df["volume"]
)
]
```

Expand All @@ -193,10 +193,9 @@ class MyCustomQuote(Quote):
from stock_indicators import indicators

# fetch historical quotes from your favorite feed
quotes: Iterable[MyCustomQuote] = get_historical_quotes("MSFT");

quotes: Iterable[MyCustomQuote] = get_historical_quotes("MSFT")
# example: get 20-period simple moving average
results = indicators.get_sma(quotes, 20);
results = indicators.get_sma(quotes, 20)
```

#### Using custom quote property names
Expand All @@ -208,9 +207,9 @@ Suppose your class has a property called `close_date` instead of `date`, it coul
```python
from stock_indicators.indicators.common.quote import Quote


class MyCustomQuote(Quote):
close_date = Quote.date

```

Note that the property `date` now can be accessed by both `close_date` and `date`.
Expand All @@ -225,16 +224,18 @@ Here's an example of how you'd set that up:
from stock_indicators import indicators
from stock_indicators.indicators.ema import EMAResult


class ExtendedEMA(EMAResult):
def __str__(self):
return f"EMA on {self.date.date()} was ${self.ema or 0:.4f}"


# compute indicator
quotes = get_historical_quotes("MSFT")
results = indicators.get_ema(quotes, 20)

# 1. list[ExtendedEMA]
extended_results = [ ExtendedEMA(r._csdata) for r in results ]
extended_results = [ExtendedEMA(r._csdata) for r in results]
for r in extended_results:
print(r)
```
Expand Down Expand Up @@ -265,11 +266,10 @@ quotes = get_historical_quotes("MSFT")
results = indicators.get_ema(quotes, 20)

# convert to synthetic quotes
quotes_from_ema = [ Quote(date=r.date, close=r.ema) for r in results ]
quotes_from_ema = [Quote(date=r.date, close=r.ema) for r in results]

# calculate SMA of EMA
sma_of_ema = indicators.get_sma(quotes_from_ema, 20)

```

## Candlestick patterns
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Explore more information:

## Samples

![image](https://raw.githubusercontent.com/DaveSkender/Stock.Indicators/main/docs/examples.webp)
![image](https://raw.githubusercontent.com/facioquo/stock-indicators-dotnet/d0b99458e17505c32b966109b5e38979cd25c047/docs/examples.webp)

### Example usage

Expand Down
3 changes: 2 additions & 1 deletion docs/pages/utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ layout: page

```python
# Example: only show Marubozu signals
results = quotes.get_marubozu(quotes).condense();
results = quotes.get_marubozu(quotes).condense()
```

>🚩 **Warning**: In all cases, `.condense()` will remove non-essential results and will produce fewer records than are in `quotes`.
Expand Down Expand Up @@ -51,6 +51,7 @@ results = indicators.get_ema(quotes, 20)

# find result on a specific date
from datetime import datetime

lookup_date = datetime(2018, 10, 12)
result = results.find(lookup_date)
```
Expand Down
Loading