Skip to content

Commit

Permalink
docs: general updates for v0.6.0 (#182)
Browse files Browse the repository at this point in the history
+semver: minor

Co-authored-by: Dave Skender <[email protected]>
  • Loading branch information
LeeDongGeon1996 and DaveSkender authored Mar 17, 2022
1 parent 8e0a1e5 commit 4de7202
Show file tree
Hide file tree
Showing 13 changed files with 433 additions and 244 deletions.
8 changes: 8 additions & 0 deletions docs/_includes/candle-result.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### CandleResult

| name | type | notes
| -- |-- |--
| `date` | datetime | Date
| `price` | decimal, Optional | Price of the most relevant OHLC candle element when a signal is present
| `signal` | [Signal]({{site.baseurl}}/guide/#signal) | Generated signal type
| `candle` | [CandleProperties]({{site.baseurl}}/guide/#candle) | Candle properties
74 changes: 0 additions & 74 deletions docs/_indicators/.unimplemented/VolSma.md

This file was deleted.

72 changes: 72 additions & 0 deletions docs/_indicators/Doji.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: Doji (Preview)
permalink: /indicators/Doji/
layout: indicator
type: candlestick-pattern
---

# {{ page.title }}
<hr>

## **get_doji**(*quotes, max_price_change_percent=0.001*)

## Parameters

| name | type | notes
| -- |-- |--
| `quotes` | Iterable[Quote] | Iterable(such as list or an object having `__iter__()`) of the Quote class or [its sub-class]({{site.baseurl}}/guide/#using-custom-quote-classes).
| `max_price_change_percent` | float, *default 0.001* | Optional. Maximum absolute decimalized percent difference in open and close price. Must be between 0 and 0.005, if specified.

### Historical quotes requirements

You must have at least one historical quote; however, more is typically provided since this is a chartable candlestick pattern.

`quotes` is an `Iterable[Quote]` collection of historical price quotes. It should have a consistent frequency (day, hour, minute, etc). See [the Guide]({{site.baseurl}}/guide/#historical-quotes) for more information.

## Return

```python
CandleResults[CandleResult]
```

- This method returns a time series of all available indicator values for the `quotes` provided.
- `CandleResults` is just a list of `CandleResult`.
- It always returns the same number of elements as there are in the historical quotes.
- It does not return a single incremental indicator value.
- The candlestick pattern is indicated on dates where `signal` is `Signal.NEUTRAL`.
- `price` is `close` price; however, all OHLC elements are included in the `candle` properties.
- There is no intrinsic basis or confirmation signal provided for this pattern.

{% include candle-result.md %}

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)

See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information.

## Example

```python
from stock_indicators import indicators

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

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

## About: {{ page.title }}

[Doji](https://en.wikipedia.org/wiki/Doji) is a single candlestick pattern where open and close price are virtually identical, representing market indecision.
[[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/734 "Community discussion about this indicator")

![image]({{site.charturl}}/Doji.png)

### Sources

- [C# core]({{site.base_sourceurl}}/a-d/Doji/Doji.cs)
- [Python wrapper]({{site.sourceurl}}/doji.py)
72 changes: 72 additions & 0 deletions docs/_indicators/Marubozu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: Marubozu (Preview)
permalink: /indicators/Marubozu/
layout: indicator
type: candlestick-pattern
---

# {{ page.title }}
<hr>

## **get_marubozu**(*quotes, min_body_percent=0.95*)

## Parameters

| name | type | notes
| -- |-- |--
| `quotes` | Iterable[Quote] | Iterable(such as list or an object having `__iter__()`) of the Quote class or [its sub-class]({{site.baseurl}}/guide/#using-custom-quote-classes).
| `min_body_percent` | float, *default 0.95* | Minimum body size as a decimalized percent of total candle size. Must be between 0.8 and 1, if specified.

### Historical quotes requirements

You must have at least one historical quote; however, more is typically provided since this is a chartable candlestick pattern.

`quotes` is an `Iterable[Quote]` collection of historical price quotes. It should have a consistent frequency (day, hour, minute, etc). See [the Guide]({{site.baseurl}}/guide/#historical-quotes) for more information.

## Return

```csharp
CandleResults[CandleResult]
```

- This method returns a time series of all available indicator values for the `quotes` provided.
- `CandleResults` is just a list of `CandleResult`.
- It always returns the same number of elements as there are in the historical quotes.
- It does not return a single incremental indicator value.
- The candlestick pattern is indicated on dates where `signal` is `Signal.BULL_SIGNAL` or `Signal.BEAR_SIGNAL`.
- `price` is `close` price; however, all OHLC elements are included in the `candle` properties.
- There is no intrinsic basis or confirmation signal provided for this pattern.

{% include candle-result.md %}

### Utilities

- [.condense()]({{site.baseurl}}/utilities#condense)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)

See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information.

## Example

```python
from stock_indicators import indicators

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

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

## About: {{ page.title }}

[Marubozu](https://en.wikipedia.org/wiki/Marubozu) is a single candlestick pattern that has no wicks, representing consistent directional movement.
[[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/512 "Community discussion about this indicator")

![image]({{site.charturl}}/Marubozu.png)

### Sources

- [C# core]({{site.base_sourceurl}}/m-r/Marubozu/Marubozu.cs)
- [Python wrapper]({{site.sourceurl}}/marubozu.py)
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,18 @@ layout: indicator
---

# {{ page.title }}
<hr>

Created by Larry Williams, the [Ultimate Oscillator](https://en.wikipedia.org/wiki/Ultimate_oscillator) uses several lookback periods to weigh buying power against true range price to produce on oversold / overbought oscillator.
[[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/231 "Community discussion about this indicator")

![image]({{site.charturl}}/Ultimate.png)

```python
// usage
IEnumerable<UltimateResult> results =
quotes.GetUltimate(shortPeriods, middlePeriods, longPeriods)
```

## **get_ultimate**(*quotes, short_periods=7, middle_periods=14, long_periods=28*)

## Parameters

| name | type | notes
| -- |-- |--
| `shortPeriods` | int | Number of periods (`S`) in the short lookback. Must be greater than 0. Default is 7.
| `middlePeriods` | int | Number of periods (`M`) in the middle lookback. Must be greater than `S`. Default is 14.
| `longPeriods` | int | Number of periods (`L`) in the long lookback. Must be greater than `M`. Default is 28.
| `quotes` | Iterable[Quote] | Iterable(such as list or an object having `__iter__()`) of the Quote class or [its sub-class]({{site.baseurl}}/guide/#using-custom-quote-classes).
| `short_periods` | int, *default 7* | Number of periods (`S`) in the short lookback. Must be greater than 0.
| `middle_periods` | int, *default 14* | Number of periods (`M`) in the middle lookback. Must be greater than `S`.
| `long_periods` | int, *default 28* | Number of periods (`L`) in the long lookback. Must be greater than `M`.

### Historical quotes requirements

Expand All @@ -35,10 +28,11 @@ You must have at least `L+1` periods of `quotes` to cover the warmup periods.
## Return

```python
IEnumerable<UltimateResult>
UltimateResults[UltimateResult]
```

- This method returns a time series of all available indicator values for the `quotes` provided.
- `UltimateResults` is just a list of `UltimateResult`.
- It always returns the same number of elements as there are in the historical quotes.
- It does not return a single incremental indicator value.
- The first `L-1` periods will have `None` Ultimate values since there's not enough data to calculate.
Expand All @@ -47,23 +41,37 @@ IEnumerable<UltimateResult>

| name | type | notes
| -- |-- |--
| `Date` | DateTime | Date
| `Ultimate` | decimal | Simple moving average for `N` lookback periods
| `date` | datetime | Date
| `ultimate` | Decimal, Optional | Simple moving average for `N` lookback periods

### Utilities

- [.Find(lookupDate)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.RemoveWarmupPeriods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.RemoveWarmupPeriods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.find(lookup_date)]({{site.baseurl}}/utilities#find-indicator-result-by-date)
- [.remove_warmup_periods()]({{site.baseurl}}/utilities#remove-warmup-periods)
- [.remove_warmup_periods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods)

See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information.

## Example

```python
// fetch historical quotes from your feed (your method)
IEnumerable<Quote> quotes = GetHistoryFromFeed("MSFT")
from stock_indicators import indicators

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

// calculate 20-period Ultimate
IEnumerable<UltimateResult> results = quotes.GetUltimate(7,14,28)
# calculate 20-period Ultimate
results = indicators.get_ultimate(quotes, 7, 14, 28)
```

## About: {{ page.title }}

Created by Larry Williams, the [Ultimate Oscillator](https://en.wikipedia.org/wiki/Ultimate_oscillator) uses several lookback periods to weigh buying power against true range price to produce on oversold / overbought oscillator.
[[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/231 "Community discussion about this indicator")

![image]({{site.charturl}}/Ultimate.png)

### Sources

- [C# core]({{site.base_sourceurl}}/s-z/Ultimate/Ultimate.cs)
- [Python wrapper]({{site.sourceurl}}/ultimate.py)
Loading

0 comments on commit 4de7202

Please sign in to comment.