From 3554e8bf39d39346e114d615287600a04ddbb059 Mon Sep 17 00:00:00 2001 From: Dong-Geon Lee Date: Thu, 20 Jan 2022 10:46:43 +0900 Subject: [PATCH 01/12] Add docs for BOP --- docs/_indicators/.unimplemented/Bop.md | 68 ----------------------- docs/_indicators/Bop.md | 76 ++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 68 deletions(-) delete mode 100644 docs/_indicators/.unimplemented/Bop.md create mode 100644 docs/_indicators/Bop.md diff --git a/docs/_indicators/.unimplemented/Bop.md b/docs/_indicators/.unimplemented/Bop.md deleted file mode 100644 index b7e4921b..00000000 --- a/docs/_indicators/.unimplemented/Bop.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: Balance of Power (BOP) -description: Balance of Power (BOP) / Balance of Market Power -permalink: /indicators/Bop/ -type: price-characteristic -layout: indicator ---- - -# {{ page.title }} - -Created by Igor Levshin, the [Balance of Power](https://school.stockcharts.com/doku.php?id=technical_indicators:balance_of_power) (aka Balance of Market Power) is a momentum oscillator that depicts the strength of buying and selling pressure. -[[Discuss] :speech_balloon:]({{site.github.repository_url}}/discussions/302 "Community discussion about this indicator") - -![image]({{site.charturl}}/Bop.png) - -```csharp -// usage -IEnumerable results = - quotes.GetBop(smoothPeriods); -``` - -## Parameters - -| name | type | notes -| -- |-- |-- -| `smoothPeriods` | int | Number of periods (`N`) for smoothing. Must be greater than 0. Default is 14. - -### Historical quotes requirements - -You must have at least `N` periods of `quotes`. - -`quotes` is an `IEnumerable` 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. - -## Response - -```csharp -IEnumerable -``` - -- This method returns a time series of all available indicator values for the `quotes` provided. -- 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 `N-1` periods will have `null` values since there's not enough data to calculate. - -### BopResult - -| name | type | notes -| -- |-- |-- -| `Date` | DateTime | Date -| `Bop` | decimal | Balance of Power - -### 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) - -See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information. - -## Example - -```csharp -// fetch historical quotes from your feed (your method) -IEnumerable quotes = GetHistoryFromFeed("MSFT"); - -// calculate 14-period BOP -IEnumerable results = quotes.GetBop(14); -``` diff --git a/docs/_indicators/Bop.md b/docs/_indicators/Bop.md new file mode 100644 index 00000000..eb348395 --- /dev/null +++ b/docs/_indicators/Bop.md @@ -0,0 +1,76 @@ +--- +title: Balance of Power (BOP) +description: Balance of Power (BOP) / Balance of Market Power +permalink: /indicators/Bop/ +type: price-characteristic +layout: indicator +--- + +# {{ page.title }} +
+ +## **get_bop**(*quotes, smooth_periods=14*) + +## Parameters + +| name | type | notes +| -- |-- |-- +| `quotes` | Iterable[Type[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). +| `smooth_periods` | int, *default 14* | Number of periods (`N`) for smoothing. Must be greater than 0. + +### Historical quotes requirements + +You must have at least `N` periods of `quotes`. + +`quotes` is an `Iterable[Type[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 +BOPResults[BOPResult] +``` + +- This method returns a time series of all available indicator values for the `quotes` provided. +- `BOPResults` is just a list of `BOPResult`. +- 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 `N-1` periods will have `None` values since there's not enough data to calculate. + +### BOPResult + +| name | type | notes +| -- |-- |-- +| `date` | datetime | Date +| `bop` | float, Optional | Balance of Power + +### Utilities + +- [.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 +from stock_indicators import indicators + +# This method is NOT a part of the library. +quotes = get_history_from_feed("SPY") + +# Calculate 14-period BOP +results = quotes.get_bop(quotes, 14); +``` + +## About: {{ page.title }} + +Created by Igor Levshin, the [Balance of Power](https://school.stockcharts.com/doku.php?id=technical_indicators:balance_of_power) (aka Balance of Market Power) is a momentum oscillator that depicts the strength of buying and selling pressure. +[[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/302 "Community discussion about this indicator") + +![image]({{site.charturl}}/Bop.png) + +### Sources + +- [C# core]({{site.base_sourceurl}}/a-d/Bop/Bop.cs) +- [Python wrapper]({{site.sourceurl}}/bop.py) From 04d7ac1b6b3b3461e6b4f97292256acfa5ce68be Mon Sep 17 00:00:00 2001 From: Dong-Geon Lee Date: Thu, 20 Jan 2022 10:58:19 +0900 Subject: [PATCH 02/12] Add docs dor CCI --- docs/_indicators/.unimplemented/Cci.md | 67 ----------------------- docs/_indicators/Cci.md | 75 ++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 67 deletions(-) delete mode 100644 docs/_indicators/.unimplemented/Cci.md create mode 100644 docs/_indicators/Cci.md diff --git a/docs/_indicators/.unimplemented/Cci.md b/docs/_indicators/.unimplemented/Cci.md deleted file mode 100644 index b298ec5e..00000000 --- a/docs/_indicators/.unimplemented/Cci.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: Commodity Channel Index (CCI) -permalink: /indicators/Cci/ -type: oscillator -layout: indicator ---- - -# {{ page.title }} - -Created by Donald Lambert, the [Commodity Channel Index](https://en.wikipedia.org/wiki/Commodity_channel_index) is an oscillator depicting deviation from typical price range, often used to identify cyclical trends. -[[Discuss] :speech_balloon:]({{site.github.repository_url}}/discussions/265 "Community discussion about this indicator") - -![image]({{site.charturl}}/Cci.png) - -```csharp -// usage -IEnumerable results = - quotes.GetCci(lookbackPeriods); -``` - -## Parameters - -| name | type | notes -| -- |-- |-- -| `lookbackPeriods` | int | Number of periods (`N`) in the moving average. Must be greater than 0. Default is 20. - -### Historical quotes requirements - -You must have at least `N+1` periods of `quotes`. - -`quotes` is an `IEnumerable` 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. - -## Response - -```csharp -IEnumerable -``` - -- This method returns a time series of all available indicator values for the `quotes` provided. -- 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 `N-1` periods will have `null` values since there's not enough data to calculate. - -### CciResult - -| name | type | notes -| -- |-- |-- -| `Date` | DateTime | Date -| `Cci` | decimal | CCI value 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) - -See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information. - -## Example - -```csharp -// fetch historical quotes from your feed (your method) -IEnumerable quotes = GetHistoryFromFeed("SPY"); - -// calculate 20-period CCI -IEnumerable results = quotes.GetCci(20); -``` diff --git a/docs/_indicators/Cci.md b/docs/_indicators/Cci.md new file mode 100644 index 00000000..0ac3f359 --- /dev/null +++ b/docs/_indicators/Cci.md @@ -0,0 +1,75 @@ +--- +title: Commodity Channel Index (CCI) +permalink: /indicators/Cci/ +type: oscillator +layout: indicator +--- + +# {{ page.title }} +
+ +## **get_cci**(*quotes, lookback_periods=20*) + +## Parameters + +| name | type | notes +| -- |-- |-- +| `quotes` | Iterable[Type[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). +| `lookback_periods` | int, *default 20* | Number of periods (`N`) in the moving average. Must be greater than 0. + +### Historical quotes requirements + +You must have at least `N+1` periods of `quotes`. + +`quotes` is an `Iterable[Type[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 +CCIResults[CCIResult] +``` + +- This method returns a time series of all available indicator values for the `quotes` provided. +- `CCIResults` is just a list of `CCIResult`. +- 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 `N-1` periods will have `None` values since there's not enough data to calculate. + +### CciResult + +| name | type | notes +| -- |-- |-- +| `date` | datetime | Date +| `cci` | float, Optional | CCI value for `N` lookback periods + +### Utilities + +- [.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 +from stock_indicators import indicators + +# This method is NOT a part of the library. +quotes = get_history_from_feed("SPY") + +# Calculate 20-period CCI +results = quotes.get_cci(quotes, 20); +``` + +## About: {{ page.title }} + +Created by Donald Lambert, the [Commodity Channel Index](https://en.wikipedia.org/wiki/Commodity_channel_index) is an oscillator depicting deviation from typical price range, often used to identify cyclical trends. +[[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/265 "Community discussion about this indicator") + +![image]({{site.charturl}}/Cci.png) + +### Sources + +- [C# core]({{site.base_sourceurl}}/a-d/Cci/Cci.cs) +- [Python wrapper]({{site.sourceurl}}/cci.py) From 42c8c92e28e1668489a73e3f3c5591225301a0b7 Mon Sep 17 00:00:00 2001 From: Dong-Geon Lee Date: Thu, 20 Jan 2022 11:04:40 +0900 Subject: [PATCH 03/12] Add docs for Chaikin Oscillator --- docs/_indicators/.unimplemented/ChaikinOsc.md | 75 ----------------- docs/_indicators/Bop.md | 2 +- docs/_indicators/Cci.md | 2 +- docs/_indicators/ChaikinOsc.md | 83 +++++++++++++++++++ 4 files changed, 85 insertions(+), 77 deletions(-) delete mode 100644 docs/_indicators/.unimplemented/ChaikinOsc.md create mode 100644 docs/_indicators/ChaikinOsc.md diff --git a/docs/_indicators/.unimplemented/ChaikinOsc.md b/docs/_indicators/.unimplemented/ChaikinOsc.md deleted file mode 100644 index 0fa9efba..00000000 --- a/docs/_indicators/.unimplemented/ChaikinOsc.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Chaikin Oscillator -permalink: /indicators/ChaikinOsc/ -type: volume-based -layout: indicator ---- - -# {{ page.title }} - -Created by Marc Chaikin, the [Chaikin Oscillator](https://en.wikipedia.org/wiki/Chaikin_Analytics#Chaikin_Oscillator) is the difference between fast and slow Exponential Moving Averages (EMA) of the [Accumulation/Distribution Line](../Adl#content) (ADL). -[[Discuss] :speech_balloon:]({{site.github.repository_url}}/discussions/264 "Community discussion about this indicator") - -![image]({{site.charturl}}/ChaikinOsc.png) - -```csharp -// usage -IEnumerable results = - quotes.GetChaikinOsc(fastPeriods, slowPeriods); -``` - -## Parameters - -| name | type | notes -| -- |-- |-- -| `fastPeriods` | int | Number of periods (`F`) in the ADL fast EMA. Must be greater than 0 and smaller than `S`. Default is 3. -| `slowPeriods` | int | Number of periods (`S`) in the ADL slow EMA. Must be greater `F`. Default is 10. - -### Historical quotes requirements - -You must have at least `2×S` or `S+100` periods of `quotes`, whichever is more. Since this uses a smoothing technique, we recommend you use at least `S+250` data points prior to the intended usage date for better precision. - -`quotes` is an `IEnumerable` 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. - -## Response - -```csharp -IEnumerable -``` - -- This method returns a time series of all available indicator values for the `quotes` provided. -- 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 `S-1` periods will have `null` values for `Oscillator` since there's not enough data to calculate. - -:hourglass: **Convergence Warning**: The first `S+100` periods will have decreasing magnitude, convergence-related precision errors that can be as high as ~5% deviation in indicator values for earlier periods. - -### ChaikinOscResult - -| name | type | notes -| -- |-- |-- -| `Date` | DateTime | Date -| `MoneyFlowMultiplier` | decimal | Money Flow Multiplier -| `MoneyFlowVolume` | decimal | Money Flow Volume -| `Adl` | decimal | Accumulation Distribution Line (ADL) -| `Oscillator` | decimal | Chaikin Oscillator - -:warning: **Warning**: absolute values in MFV, ADL, and Oscillator are somewhat meaningless, so use with caution. - -### 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) - -See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information. - -## Example - -```csharp -// fetch historical quotes from your feed (your method) -IEnumerable quotes = GetHistoryFromFeed("SPY"); - -// calculate 20-period Chaikin Oscillator -IEnumerable results = quotes.GetChaikinOsc(20); -``` diff --git a/docs/_indicators/Bop.md b/docs/_indicators/Bop.md index eb348395..ee2d793f 100644 --- a/docs/_indicators/Bop.md +++ b/docs/_indicators/Bop.md @@ -60,7 +60,7 @@ from stock_indicators import indicators quotes = get_history_from_feed("SPY") # Calculate 14-period BOP -results = quotes.get_bop(quotes, 14); +results = indicators.get_bop(quotes, 14); ``` ## About: {{ page.title }} diff --git a/docs/_indicators/Cci.md b/docs/_indicators/Cci.md index 0ac3f359..7c6ff494 100644 --- a/docs/_indicators/Cci.md +++ b/docs/_indicators/Cci.md @@ -59,7 +59,7 @@ from stock_indicators import indicators quotes = get_history_from_feed("SPY") # Calculate 20-period CCI -results = quotes.get_cci(quotes, 20); +results = indicators.get_cci(quotes, 20); ``` ## About: {{ page.title }} diff --git a/docs/_indicators/ChaikinOsc.md b/docs/_indicators/ChaikinOsc.md new file mode 100644 index 00000000..a65ba27f --- /dev/null +++ b/docs/_indicators/ChaikinOsc.md @@ -0,0 +1,83 @@ +--- +title: Chaikin Oscillator +permalink: /indicators/ChaikinOsc/ +type: volume-based +layout: indicator +--- + +# {{ page.title }} +
+ +## **get_chaikin_osc**(*quotes, fast_periods=3, slow_periods=10*) + +## Parameters + +| name | type | notes +| -- |-- |-- +| `quotes` | Iterable[Type[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). +| `fast_periods` | int | Number of periods (`F`) in the ADL fast EMA. Must be greater than 0 and smaller than `S`. Default is 3. +| `slow_periods` | int | Number of periods (`S`) in the ADL slow EMA. Must be greater `F`. Default is 10. + +### Historical quotes requirements + +You must have at least `2×S` or `S+100` periods of `quotes`, whichever is more. Since this uses a smoothing technique, we recommend you use at least `S+250` data points prior to the intended usage date for better precision. + +`quotes` is an `Iterable[Type[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 +ChaikinOscResults[ChaikinOscResult] +``` + +- This method returns a time series of all available indicator values for the `quotes` provided. +- `ChaikinOscResults` is just a list of `ChaikinOscResult`. +- 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 `S-1` periods will have `None` values for `Oscillator` since there's not enough data to calculate. + +:hourglass: **Convergence Warning**: The first `S+100` periods will have decreasing magnitude, convergence-related precision errors that can be as high as ~5% deviation in indicator values for earlier periods. + +### ChaikinOscResult + +| name | type | notes +| -- |-- |-- +| `date` | datetime | Date +| `money_flow_multiplier` | float | Money Flow Multiplier +| `money_flow_volume` | float | Money Flow Volume +| `adl` | float | Accumulation Distribution Line (ADL) +| `oscillator` | float, Optional | Chaikin Oscillator + +:warning: **Warning**: absolute values in MFV, ADL, and Oscillator are somewhat meaningless, so use with caution. + +### Utilities + +- [.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 +from stock_indicators import indicators + +# This method is NOT a part of the library. +quotes = get_history_from_feed("SPY") + +# Calculate 20-period Chaikin Oscillator +results = indicators.get_chaikin_osc(quotes, 20); +``` + +## About: {{ page.title }} + +Created by Marc Chaikin, the [Chaikin Oscillator](https://en.wikipedia.org/wiki/Chaikin_Analytics#Chaikin_Oscillator) is the difference between fast and slow Exponential Moving Averages (EMA) of the [Accumulation/Distribution Line](../Adl#content) (ADL). +[[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/264 "Community discussion about this indicator") + +![image]({{site.charturl}}/ChaikinOsc.png) + +### Sources + +- [C# core]({{site.base_sourceurl}}/a-d/ChaikinOsc/ChaikinOsc.cs) +- [Python wrapper]({{site.sourceurl}}/chaikin_oscillator.py) From c143c6b92c06d3abd078a487309691becbbc2b60 Mon Sep 17 00:00:00 2001 From: Dong-Geon Lee Date: Thu, 20 Jan 2022 11:18:58 +0900 Subject: [PATCH 04/12] Add docs for Chop --- docs/_indicators/.unimplemented/Chop.md | 66 ---------------------- docs/_indicators/ChaikinOsc.md | 4 +- docs/_indicators/Chop.md | 74 +++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 68 deletions(-) delete mode 100644 docs/_indicators/.unimplemented/Chop.md create mode 100644 docs/_indicators/Chop.md diff --git a/docs/_indicators/.unimplemented/Chop.md b/docs/_indicators/.unimplemented/Chop.md deleted file mode 100644 index 63643714..00000000 --- a/docs/_indicators/.unimplemented/Chop.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: Choppiness Index -permalink: /indicators/Chop/ -type: price-characteristic -layout: indicator ---- - -# {{ page.title }} - -Created by E.W. Dreiss, the Choppiness Index measures the trendiness or choppiness on a scale of 0 to 100, to depict steady trends versus conditions of choppiness. [[Discuss] :speech_balloon:]({{site.github.repository_url}}/discussions/357 "Community discussion about this indicator") - -![image]({{site.charturl}}/Chop.png) - -```csharp -// usage -IEnumerable results = - quotes.GetChop(lookbackPeriods); -``` - -## Parameters - -| name | type | notes -| -- |-- |-- -| `lookbackPeriods` | int | Number of periods (`N`) for the lookback evaluation. Must be greater than 1. Default is 14. - -### Historical quotes requirements - -You must have at least `N+1` periods of `quotes`. - -`quotes` is an `IEnumerable` 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. - -## Response - -```csharp -IEnumerable -``` - -- This method returns a time series of all available indicator values for the `quotes` provided. -- 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 `N` periods will have `null` values since there's not enough data to calculate. - -### ChopResult - -| name | type | notes -| -- |-- |-- -| `Date` | DateTime | Date -| `Chop` | decimal | Choppiness Index - -### 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) - -See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information. - -## Example - -```csharp -// fetch historical quotes from your feed (your method) -IEnumerable quotes = GetHistoryFromFeed("SPY"); - -// calculate CHOP(14) -IEnumerable results = quotes.GetChop(14); -``` diff --git a/docs/_indicators/ChaikinOsc.md b/docs/_indicators/ChaikinOsc.md index a65ba27f..b012080b 100644 --- a/docs/_indicators/ChaikinOsc.md +++ b/docs/_indicators/ChaikinOsc.md @@ -15,8 +15,8 @@ layout: indicator | name | type | notes | -- |-- |-- | `quotes` | Iterable[Type[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). -| `fast_periods` | int | Number of periods (`F`) in the ADL fast EMA. Must be greater than 0 and smaller than `S`. Default is 3. -| `slow_periods` | int | Number of periods (`S`) in the ADL slow EMA. Must be greater `F`. Default is 10. +| `fast_periods` | int, *default 3* | Number of periods (`F`) in the ADL fast EMA. Must be greater than 0 and smaller than `S`. +| `slow_periods` | int, *default 10* | Number of periods (`S`) in the ADL slow EMA. Must be greater `F`. ### Historical quotes requirements diff --git a/docs/_indicators/Chop.md b/docs/_indicators/Chop.md new file mode 100644 index 00000000..f63c093f --- /dev/null +++ b/docs/_indicators/Chop.md @@ -0,0 +1,74 @@ +--- +title: Choppiness Index +permalink: /indicators/Chop/ +type: price-characteristic +layout: indicator +--- + +# {{ page.title }} +
+ +## **get_chop**(*quotes, lookback_periods=14*) + +## Parameters + +| name | type | notes +| -- |-- |-- +| `quotes` | Iterable[Type[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). +| `lookback_periods` | int, *default 14* | Number of periods (`N`) for the lookback evaluation. Must be greater than 1. + +### Historical quotes requirements + +You must have at least `N+1` periods of `quotes`. + +`quotes` is an `Iterable[Type[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 +ChopResults[ChopResult] +``` + +- This method returns a time series of all available indicator values for the `quotes` provided. +- `ChopResults` is just a list of `ChopResult`. +- 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 `N` periods will have `None` values since there's not enough data to calculate. + +### ChopResult + +| name | type | notes +| -- |-- |-- +| `date` | datetime | Date +| `chop` | decimal, Optional | Choppiness Index + +### Utilities + +- [.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 +from stock_indicators import indicators + +# This method is NOT a part of the library. +quotes = get_history_from_feed("SPY") + +# Calculate CHOP(14) +results = indicators.get_chop(quotes, 14); +``` + +## About: {{ page.title }} + +Created by E.W. Dreiss, the Choppiness Index measures the trendiness or choppiness on a scale of 0 to 100, to depict steady trends versus conditions of choppiness. [[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/357 "Community discussion about this indicator") + +![image]({{site.charturl}}/Chop.png) + +### Sources + +- [C# core]({{site.base_sourceurl}}/a-d/Chop/Chop.cs) +- [Python wrapper]({{site.sourceurl}}/chop.py) From eb0e328283d414717bc1d87ac71a5f0574cd48f4 Mon Sep 17 00:00:00 2001 From: Dong-Geon Lee Date: Thu, 20 Jan 2022 11:36:24 +0900 Subject: [PATCH 05/12] Add docs for CMF --- docs/_indicators/.unimplemented/Cmf.md | 71 ----------------------- docs/_indicators/Cmf.md | 79 ++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 71 deletions(-) delete mode 100644 docs/_indicators/.unimplemented/Cmf.md create mode 100644 docs/_indicators/Cmf.md diff --git a/docs/_indicators/.unimplemented/Cmf.md b/docs/_indicators/.unimplemented/Cmf.md deleted file mode 100644 index a4b26332..00000000 --- a/docs/_indicators/.unimplemented/Cmf.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: Chaikin Money Flow (CMF) -permalink: /indicators/Cmf/ -type: volume-based -layout: indicator ---- - -# {{ page.title }} - -Created by Marc Chaikin, [Chaikin Money Flow](https://en.wikipedia.org/wiki/Chaikin_Analytics#Chaikin_Money_Flow) is the simple moving average of the Money Flow Volume. -[[Discuss] :speech_balloon:]({{site.github.repository_url}}/discussions/261 "Community discussion about this indicator") - -![image]({{site.charturl}}/Cmf.png) - -```csharp -// usage -IEnumerable results = - quotes.GetCmf(lookbackPeriods); -``` - -## Parameters - -| name | type | notes -| -- |-- |-- -| `lookbackPeriods` | int | Number of periods (`N`) in the moving average. Must be greater than 0. Default is 20. - -### Historical quotes requirements - -You must have at least `N+1` periods of `quotes`. - -`quotes` is an `IEnumerable` 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. - -## Response - -```csharp -IEnumerable -``` - -- This method returns a time series of all available indicator values for the `quotes` provided. -- 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 `N-1` periods will have `null` values since there's not enough data to calculate. - -### CmfResult - -| name | type | notes -| -- |-- |-- -| `Date` | DateTime | Date -| `MoneyFlowMultiplier` | decimal | Money Flow Multiplier -| `MoneyFlowVolume` | decimal | Money Flow Volume -| `Cmf` | decimal | Chaikin Money Flow = SMA of MFV for `N` lookback periods - -:warning: **Warning**: absolute values in MFV and CMF are somewhat meaningless, so use with caution. - -### 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) - -See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information. - -## Example - -```csharp -// fetch historical quotes from your feed (your method) -IEnumerable quotes = GetHistoryFromFeed("SPY"); - -// calculate 20-period CMF -IEnumerable results = quotes.GetCmf(20); -``` diff --git a/docs/_indicators/Cmf.md b/docs/_indicators/Cmf.md new file mode 100644 index 00000000..85ddbeb5 --- /dev/null +++ b/docs/_indicators/Cmf.md @@ -0,0 +1,79 @@ +--- +title: Chaikin Money Flow (CMF) +permalink: /indicators/Cmf/ +type: volume-based +layout: indicator +--- + +# {{ page.title }} +
+ +## **get_cmf**(*quotes, lookback_periods=20*) + +## Parameters + +| name | type | notes +| -- |-- |-- +| `quotes` | Iterable[Type[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). +| `lookback_periods` | int, *default 20* | Number of periods (`N`) in the moving average. Must be greater than 0. + +### Historical quotes requirements + +You must have at least `N+1` periods of `quotes`. + +`quotes` is an `Iterable[Type[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 +CMFResults[CMFResult] +``` + +- This method returns a time series of all available indicator values for the `quotes` provided. +- `CMFResults` is just a list of `CMFResult`. +- 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 `N-1` periods will have `None` values since there's not enough data to calculate. + +### CmfResult + +| name | type | notes +| -- |-- |-- +| `date` | datetime | Date +| `money_flow_multiplier` | float | Money Flow Multiplier +| `money_flow_volume` | float | Money Flow Volume +| `cmf` | float, Optional | Chaikin Money Flow = SMA of MFV for `N` lookback periods + +:warning: **Warning**: absolute values in MFV and CMF are somewhat meaningless, so use with caution. + +### Utilities + +- [.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 +from stock_indicators import indicators + +# This method is NOT a part of the library. +quotes = get_history_from_feed("SPY") + +# Calculate 20-period CMF +results = indicators.get_cmf(quotes, 20); +``` + +## About: {{ page.title }} + +Created by Marc Chaikin, [Chaikin Money Flow](https://en.wikipedia.org/wiki/Chaikin_Analytics#Chaikin_Money_Flow) is the simple moving average of the Money Flow Volume. +[[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/261 "Community discussion about this indicator") + +![image]({{site.charturl}}/Cmf.png) + +### Sources + +- [C# core]({{site.base_sourceurl}}/a-d/Cmf/Cmf.cs) +- [Python wrapper]({{site.sourceurl}}/cmf.py) From e2d1330cf9371b9689656e889f2fd9ef507d45f2 Mon Sep 17 00:00:00 2001 From: Dong-Geon Lee Date: Thu, 20 Jan 2022 11:43:15 +0900 Subject: [PATCH 06/12] Add docs for Connors RSI --- docs/_indicators/.unimplemented/ConnorsRsi.md | 75 ----------------- docs/_indicators/ConnorsRsi.md | 82 +++++++++++++++++++ 2 files changed, 82 insertions(+), 75 deletions(-) delete mode 100644 docs/_indicators/.unimplemented/ConnorsRsi.md create mode 100644 docs/_indicators/ConnorsRsi.md diff --git a/docs/_indicators/.unimplemented/ConnorsRsi.md b/docs/_indicators/.unimplemented/ConnorsRsi.md deleted file mode 100644 index ad699e32..00000000 --- a/docs/_indicators/.unimplemented/ConnorsRsi.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: ConnorsRSI -permalink: /indicators/ConnorsRsi/ -type: oscillator -layout: indicator ---- - -# {{ page.title }} - -Created by Laurence Connors, the [ConnorsRSI](https://alvarezquanttrading.com/wp-content/uploads/2016/05/ConnorsRSIGuidebook.pdf) is a composite oscillator that incorporates RSI, winning/losing streaks, and percentile gain metrics on scale of 0 to 100. See [analysis](https://alvarezquanttrading.com/blog/connorsrsi-analysis). -[[Discuss] :speech_balloon:]({{site.github.repository_url}}/discussions/260 "Community discussion about this indicator") - -![image]({{site.charturl}}/ConnorsRsi.png) - -```csharp -// usage -IEnumerable results = - quotes.GetConnorsRsi(rsiPeriods, streakPeriods, rankPeriods); -``` - -## Parameters - -| name | type | notes -| -- |-- |-- -| `rsiPeriods` | int | Lookback period (`R`) for the close price RSI. Must be greater than 1. Default is 3. -| `streakPeriods` | int | Lookback period (`S`) for the streak RSI. Must be greater than 1. Default is 2. -| `rankPeriods` | int | Lookback period (`P`) for the Percentile Rank. Must be greater than 1. Default is 100. - -### Historical quotes requirements - -`N` is the greater of `R+100`, `S`, and `P+2`. You must have at least `N` periods of `quotes`. Since this uses a smoothing technique, we recommend you use at least `N+150` data points prior to the intended usage date for better precision. - -`quotes` is an `IEnumerable` 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. - -## Response - -```csharp -IEnumerable -``` - -- This method returns a time series of all available indicator values for the `quotes` provided. -- 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 `MAX(R,S,P)-1` periods will have `null` values since there's not enough data to calculate. - -:hourglass: **Convergence Warning**: The first `N` periods will have decreasing magnitude, convergence-related precision errors that can be as high as ~5% deviation in indicator values for earlier periods. - -### ConnorsRsiResult - -| name | type | notes -| -- |-- |-- -| `Date` | DateTime | Date -| `RsiClose` | decimal | RSI(`R`) of the Close price. -| `RsiStreak` | decimal | RSI(`S`) of the Streak. -| `PercentRank` | decimal | Percentile rank of the period gain value. -| `ConnorsRsi` | decimal | ConnorsRSI - -### 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) - -See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information. - -## Example - -```csharp -// fetch historical quotes from your feed (your method) -IEnumerable quotes = GetHistoryFromFeed("SPY"); - -// calculate ConnorsRsi(3,2.100) -IEnumerable results - = quotes.GetConnorsRsi(3,2,100); -``` diff --git a/docs/_indicators/ConnorsRsi.md b/docs/_indicators/ConnorsRsi.md new file mode 100644 index 00000000..f10b7d9e --- /dev/null +++ b/docs/_indicators/ConnorsRsi.md @@ -0,0 +1,82 @@ +--- +title: ConnorsRSI +permalink: /indicators/ConnorsRsi/ +type: oscillator +layout: indicator +--- + +# {{ page.title }} +
+ +## **get_connors_rsi**(*quotes, rsi_periods=3, streak_periods=2, rank_periods=100*) + +## Parameters + +| name | type | notes +| -- |-- |-- +| `quotes` | Iterable[Type[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). +| `rsi_periods` | int, *default 3* | Lookback period (`R`) for the close price RSI. Must be greater than 1. +| `streak_periods` | int, *default 2* | Lookback period (`S`) for the streak RSI. Must be greater than 1. +| `rank_periods` | int, *default 100* | Lookback period (`P`) for the Percentile Rank. Must be greater than 1. + +### Historical quotes requirements + +`N` is the greater of `R+100`, `S`, and `P+2`. You must have at least `N` periods of `quotes`. Since this uses a smoothing technique, we recommend you use at least `N+150` data points prior to the intended usage date for better precision. + +`quotes` is an `Iterable[Type[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 +ConnorsRSIResults[ConnorsRSIResult] +``` + +- This method returns a time series of all available indicator values for the `quotes` provided. +- `ConnorsRSIResults` is just a list of `ConnorsRSIResult`. +- 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 `MAX(R,S,P)-1` periods will have `None` values since there's not enough data to calculate. + +:hourglass: **Convergence Warning**: The first `N` periods will have decreasing magnitude, convergence-related precision errors that can be as high as ~5% deviation in indicator values for earlier periods. + +### ConnorsRSIResult + +| name | type | notes +| -- |-- |-- +| `date` | datetime | Date +| `rsi_close` | float, Optional | RSI(`R`) of the Close price. +| `rsi_streak` | float, Optional | RSI(`S`) of the Streak. +| `percent_rank` | float, Optional | Percentile rank of the period gain value. +| `connors_rsi` | float, Optional | ConnorsRSI + +### Utilities + +- [.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 +from stock_indicators import indicators + +# This method is NOT a part of the library. +quotes = get_history_from_feed("SPY") + +# Calculate ConnorsRsi(3,2.100) +results = indicators.get_connors_rsi(quotes, 3, 2, 100); +``` + +## About: {{ page.title }} + +Created by Laurence Connors, the [ConnorsRSI](https://alvarezquanttrading.com/wp-content/uploads/2016/05/ConnorsRSIGuidebook.pdf) is a composite oscillator that incorporates RSI, winning/losing streaks, and percentile gain metrics on scale of 0 to 100. See [analysis](https://alvarezquanttrading.com/blog/connorsrsi-analysis). +[[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/260 "Community discussion about this indicator") + +![image]({{site.charturl}}/ConnorsRsi.png) + +### Sources + +- [C# core]({{site.base_sourceurl}}/a-d/ConnorsRsi/ConnorsRsi.cs) +- [Python wrapper]({{site.sourceurl}}/connors_rsi.py) From 935f12ab497856bda75ae4c352c2008a1216841d Mon Sep 17 00:00:00 2001 From: Dong-Geon Lee Date: Thu, 20 Jan 2022 11:51:31 +0900 Subject: [PATCH 07/12] Add docs for Correlation --- .../_indicators/.unimplemented/Correlation.md | 75 ----------------- docs/_indicators/Correlation.md | 82 +++++++++++++++++++ 2 files changed, 82 insertions(+), 75 deletions(-) delete mode 100644 docs/_indicators/.unimplemented/Correlation.md create mode 100644 docs/_indicators/Correlation.md diff --git a/docs/_indicators/.unimplemented/Correlation.md b/docs/_indicators/.unimplemented/Correlation.md deleted file mode 100644 index fdb82905..00000000 --- a/docs/_indicators/.unimplemented/Correlation.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Correlation Coefficient -description: Correlation Coefficient and R-Squared (Coefficient of Determination) -permalink: /indicators/Correlation/ -type: numerical-analysis -layout: indicator ---- - -# {{ page.title }} - -[Correlation Coefficient](https://en.wikipedia.org/wiki/Correlation_coefficient) between two quote histories, based on Close price. R-Squared (R²), Variance, and Covariance are also output. -[[Discuss] :speech_balloon:]({{site.github.repository_url}}/discussions/259 "Community discussion about this indicator") - -![image]({{site.charturl}}/Correlation.png) - -```csharp -// usage -IEnumerable results = - quotesA.GetCorr(quotesB, lookbackPeriods); -``` - -## Parameters - -| name | type | notes -| -- |-- |-- -| `quotesB` | IEnumerable\<[TQuote]({{site.baseurl}}/guide/#historical-quotes)\> | Historical quotes (B) must have at least the same matching date elements of `quotesA`. -| `lookbackPeriods` | int | Number of periods (`N`) in the lookback period. Must be greater than 0 to calculate; however we suggest a larger period for statistically appropriate sample size. - -### Historical quotes requirements - -You must have at least `N` periods for both versions of `quotes`. Mismatch histories will produce a `BadQuotesException`. Historical price quotes should have a consistent frequency (day, hour, minute, etc). - -`quotesA` is an `IEnumerable` 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. - -## Response - -```csharp -IEnumerable -``` - -- This method returns a time series of all available indicator values for the `quotes` provided. -- 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 `N-1` periods will have `null` values since there's not enough data to calculate. - -### CorrResult - -| name | type | notes -| -- |-- |-- -| `Date` | DateTime | Date -| `VarianceA` | decimal | Variance of A based on `N` lookback periods -| `VarianceB` | decimal | Variance of B based on `N` lookback periods -| `Covariance` | decimal | Covariance of A+B based on `N` lookback periods -| `Correlation` | decimal | Correlation `R` based on `N` lookback periods -| `RSquared` | decimal | R-Squared (R²), aka Coefficient of Determination. Simple linear regression models is used (square of Correlation). - -### 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) - -See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information. - -## Example - -```csharp -// fetch historical quotes from your feed (your method) -IEnumerable historySPX = GetHistoryFromFeed("SPX"); -IEnumerable historyTSLA = GetHistoryFromFeed("TSLA"); - -// calculate 20-period Correlation -IEnumerable results - = historySPX.GetCorr(historyTSLA,20); -``` diff --git a/docs/_indicators/Correlation.md b/docs/_indicators/Correlation.md new file mode 100644 index 00000000..7b0ecad3 --- /dev/null +++ b/docs/_indicators/Correlation.md @@ -0,0 +1,82 @@ +--- +title: Correlation Coefficient +description: Correlation Coefficient and R-Squared (Coefficient of Determination) +permalink: /indicators/Correlation/ +type: numerical-analysis +layout: indicator +--- + +# {{ page.title }} +
+ +## **get_correlation**(*quotes_a, quotes_b, lookback_periods*) + +## Parameters + +| name | type | notes +| -- |-- |-- +| `quotes_a` | Iterable[Type[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). +| `quotes_b` | Iterable[Type[Quote]] | Historical quotes (B) must have at least the same matching date elements of `quotes_a`. +| `lookback_periods` | int | Number of periods (`N`) in the lookback period. Must be greater than 0 to calculate; however we suggest a larger period for statistically appropriate sample size. + +### Historical quotes requirements + +You must have at least `N` periods for both versions of `quotes`. Mismatch histories will produce a `BadQuotesException`. Historical price quotes should have a consistent frequency (day, hour, minute, etc). + +`quotes_a` is an `Iterable[Type[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 +CorrelationResults[CorrelationResult] +``` + +- This method returns a time series of all available indicator values for the `quotes` provided. +- `CorrelationResults` is just a list of `CorrelationResult`. +- 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 `N-1` periods will have `None` values since there's not enough data to calculate. + +### CorrelationResult + +| name | type | notes +| -- |-- |-- +| `date` | datetime | Date +| `variance_a` | float, Optional | Variance of A based on `N` lookback periods +| `variance_b` | float, Optional | Variance of B based on `N` lookback periods +| `covariance` | float, Optional | Covariance of A+B based on `N` lookback periods +| `correlation` | float, Optional | Correlation `R` based on `N` lookback periods +| `r_squared` | float, Optional | R-Squared (R²), aka Coefficient of Determination. Simple linear regression models is used (square of Correlation). + +### Utilities + +- [.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 +from stock_indicators import indicators + +# This method is NOT a part of the library. +quotes_spx = get_history_from_feed("SPX") +quotes_tsla = get_history_from_feed("TSLA") + +# Calculate 20-period Correlation +results = indicators.get_correlation(quotes_spx, quotes_tsla, 20); +``` + +## About: {{ page.title }} + +[Correlation Coefficient](https://en.wikipedia.org/wiki/Correlation_coefficient) between two quote histories, based on Close price. R-Squared (R²), Variance, and Covariance are also output. +[[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/259 "Community discussion about this indicator") + +![image]({{site.charturl}}/Correlation.png) + +### Sources + +- [C# core]({{site.base_sourceurl}}/a-d/Correlation/Correlation.cs) +- [Python wrapper]({{site.sourceurl}}/correlation.py) From cd17e82907141e4de2e7cf1cc6ffd6e87eb2b477 Mon Sep 17 00:00:00 2001 From: Dong-Geon Lee Date: Thu, 20 Jan 2022 14:27:12 +0900 Subject: [PATCH 08/12] Add docs for DPO --- docs/_indicators/.unimplemented/Dpo.md | 68 ----------------------- docs/_indicators/Dpo.md | 76 ++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 68 deletions(-) delete mode 100644 docs/_indicators/.unimplemented/Dpo.md create mode 100644 docs/_indicators/Dpo.md diff --git a/docs/_indicators/.unimplemented/Dpo.md b/docs/_indicators/.unimplemented/Dpo.md deleted file mode 100644 index 1057d217..00000000 --- a/docs/_indicators/.unimplemented/Dpo.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: Detrended Price Oscillator (DPO) -permalink: /indicators/Dpo/ -type: oscillator -layout: indicator ---- - -# {{ page.title }} - -[Detrended Price Oscillator](https://en.wikipedia.org/wiki/Detrended_price_oscillator) depicts the difference between price and an offset simple moving average. It is used to identify trend cycles and duration. -[[Discuss] :speech_balloon:]({{site.github.repository_url}}/discussions/551 "Community discussion about this indicator") - -![image]({{site.charturl}}/Dpo.png) - -```csharp -// usage -IEnumerable results = - quotes.GetDpo(lookbackPeriods); -``` - -## Parameters - -| name | type | notes -| -- |-- |-- -| `lookbackPeriods` | int | Number of periods (`N`) in the moving average. Must be greater than 0. - -### Historical quotes requirements - -You must have at least `N` historical quotes. - -`quotes` is an `IEnumerable` 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. - -## Response - -```csharp -IEnumerable -``` - -- This method returns a time series of all available indicator values for the `quotes` provided. -- 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 `N/2-2` and last `N/2+1` periods will be `null` since they cannot be calculated. - -### DpoResult - -| name | type | notes -| -- |-- |-- -| `Date` | DateTime | Date -| `Sma` | decimal | Simple moving average offset by `N/2+1` periods -| `Dpo` | decimal | Detrended Price Oscillator (DPO) - -### Utilities - -- [.ConvertToQuotes()]({{site.baseurl}}/utilities#convert-to-quotes) -- [.Find(lookupDate)]({{site.baseurl}}/utilities#find-indicator-result-by-date) -- [.RemoveWarmupPeriods(qty)]({{site.baseurl}}/utilities#remove-warmup-periods) - -See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information. - -## Example - -```csharp -// fetch historical quotes from your feed (your method) -IEnumerable quotes = GetHistoryFromFeed("SPY"); - -// calculate -IEnumerable results = quotes.GetDpo(14); -``` diff --git a/docs/_indicators/Dpo.md b/docs/_indicators/Dpo.md new file mode 100644 index 00000000..50dbf9f0 --- /dev/null +++ b/docs/_indicators/Dpo.md @@ -0,0 +1,76 @@ +--- +title: Detrended Price Oscillator (DPO) +permalink: /indicators/Dpo/ +type: oscillator +layout: indicator +--- + +# {{ page.title }} +
+ +## **get_dpo**(*quotes, lookback_periods*) + +## Parameters + +| name | type | notes +| -- |-- |-- +| `quotes` | Iterable[Type[Quote]] | Iterable(such as list or an object having `__iter__()`) of the Quote class +| `lookback_periods` | int | Number of periods (`N`) in the moving average. Must be greater than 0. + +### Historical quotes requirements + +You must have at least `N` historical quotes. + +`quotes` is an `Iterable[Type[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 +DPOResults[DPOResult] +``` + +- This method returns a time series of all available indicator values for the `quotes` provided. +- `DPOResults` is just a list of `DPOResult`. +- 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 `N/2-2` and last `N/2+1` periods will be `None` since they cannot be calculated. + +### DPOResult + +| name | type | notes +| -- |-- |-- +| `date` | datetime | Date +| `sma` | Decimal, Optional | Simple moving average offset by `N/2+1` periods +| `dpo` | Decimal, Optional | Detrended Price Oscillator (DPO) + +### Utilities + +- [.to_quotes()]({{site.baseurl}}/utilities#convert-to-quotes) +- [.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_dpo(quotes, 14); +``` + +## About: {{ page.title }} + +[Detrended Price Oscillator](https://en.wikipedia.org/wiki/Detrended_price_oscillator) depicts the difference between price and an offset simple moving average. It is used to identify trend cycles and duration. +[[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/551 "Community discussion about this indicator") + +![image]({{site.charturl}}/Dpo.png) + +### Sources + +- [C# core]({{site.base_sourceurl}}/a-d/Dpo/Dpo.cs) +- [Python wrapper]({{site.sourceurl}}/dpo.py) From 3a99712a5d76aff14f535bc6db77f83a9e2f577d Mon Sep 17 00:00:00 2001 From: Dong-Geon Lee Date: Thu, 20 Jan 2022 14:31:20 +0900 Subject: [PATCH 09/12] Add docs for EPMA --- docs/_indicators/.unimplemented/Epma.md | 68 ---------------------- docs/_indicators/Epma.md | 76 +++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 68 deletions(-) delete mode 100644 docs/_indicators/.unimplemented/Epma.md create mode 100644 docs/_indicators/Epma.md diff --git a/docs/_indicators/.unimplemented/Epma.md b/docs/_indicators/.unimplemented/Epma.md deleted file mode 100644 index ee2608b7..00000000 --- a/docs/_indicators/.unimplemented/Epma.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: Endpoint Moving Average (EPMA) -description: Endpoint Moving Average (EPMA) and Least Squares Moving Average (LSMA) -permalink: /indicators/Epma/ -type: moving-average -layout: indicator ---- - -# {{ page.title }} - -Endpoint Moving Average (EPMA), also known as Least Squares Moving Average (LSMA), plots the projected last point of a linear regression lookback window. -[[Discuss] :speech_balloon:]({{site.github.repository_url}}/discussions/371 "Community discussion about this indicator") - -![image]({{site.charturl}}/Epma.png) - -```csharp -// usage -IEnumerable results = - quotes.GetEpma(lookbackPeriods); -``` - -## Parameters - -| name | type | notes -| -- |-- |-- -| `lookbackPeriods` | int | Number of periods (`N`) in the moving average. Must be greater than 0. - -### Historical quotes requirements - -You must have at least `N` periods of `quotes`. - -`quotes` is an `IEnumerable` 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. - -## Response - -```csharp -IEnumerable -``` - -- This method returns a time series of all available indicator values for the `quotes` provided. -- 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 `N-1` periods will have `null` values since there's not enough data to calculate. - -### EpmaResult - -| name | type | notes -| -- |-- |-- -| `Date` | DateTime | Date -| `Epma` | decimal | Endpoint moving average - -### 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) - -See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information. - -## Example - -```csharp -// fetch historical quotes from your feed (your method) -IEnumerable quotes = GetHistoryFromFeed("MSFT"); - -// calculate 20-period EPMA -IEnumerable results = quotes.GetEpma(20); -``` diff --git a/docs/_indicators/Epma.md b/docs/_indicators/Epma.md new file mode 100644 index 00000000..b4d88be0 --- /dev/null +++ b/docs/_indicators/Epma.md @@ -0,0 +1,76 @@ +--- +title: Endpoint Moving Average (EPMA) +description: Endpoint Moving Average (EPMA) and Least Squares Moving Average (LSMA) +permalink: /indicators/Epma/ +type: moving-average +layout: indicator +--- + +# {{ page.title }} +
+ +## **get_epma**(*quotes, lookback_periods*) + +## Parameters + +| name | type | notes +| -- |-- |-- +| `quotes` | Iterable[Type[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). +| `lookback_periods` | int | Number of periods (`N`) in the moving average. Must be greater than 0. + +### Historical quotes requirements + +You must have at least `N` periods of `quotes`. + +`quotes` is an `Iterable[Type[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 +EPMAResults[EPMAResult] +``` + +- This method returns a time series of all available indicator values for the `quotes` provided. +- `EPMAResults` is just a list of `EPMAResult`. +- 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 `N-1` periods will have `None` values since there's not enough data to calculate. + +### EPMAResult + +| name | type | notes +| -- |-- |-- +| `date` | datetime | Date +| `epma` | Decimal, Optional | Endpoint moving average + +### Utilities + +- [.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 +from stock_indicators import indicators + +# This method is NOT a part of the library. +quotes = get_history_from_feed("SPY") + +# Calculate 20-period EPMA +results = indicators.get_epma(quotes, 20); +``` + +## About: {{ page.title }} + +Endpoint Moving Average (EPMA), also known as Least Squares Moving Average (LSMA), plots the projected last point of a linear regression lookback window. +[[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/371 "Community discussion about this indicator") + +![image]({{site.charturl}}/Epma.png) + +### Sources + +- [C# core]({{site.base_sourceurl}}/e-k/Epma/Epma.cs) +- [Python wrapper]({{site.sourceurl}}/epma.py) From b2f776fa14ce3413f746991c754768e2aa1c6833 Mon Sep 17 00:00:00 2001 From: Dong-Geon Lee Date: Thu, 20 Jan 2022 14:52:09 +0900 Subject: [PATCH 10/12] Add docs for FCB --- docs/_indicators/.unimplemented/Fcb.md | 70 ----------------------- docs/_indicators/Fcb.md | 78 ++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 70 deletions(-) delete mode 100644 docs/_indicators/.unimplemented/Fcb.md create mode 100644 docs/_indicators/Fcb.md diff --git a/docs/_indicators/.unimplemented/Fcb.md b/docs/_indicators/.unimplemented/Fcb.md deleted file mode 100644 index b52a49fd..00000000 --- a/docs/_indicators/.unimplemented/Fcb.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: Fractal Chaos Bands (FCB) -permalink: /indicators/Fcb/ -type: price-channel -layout: indicator ---- - -# {{ page.title }} - -Created by Edward William Dreiss, Fractal Chaos Bands outline high and low price channels to depict broad less-chaotic price movements. FCB is a channelized depiction of [Williams Fractal](../Fractal#content). -[[Discuss] :speech_balloon:]({{site.github.repository_url}}/discussions/347 "Community discussion about this indicator") - -![image]({{site.charturl}}/Fcb.png) - -```csharp -// usage -IEnumerable results = - quotes.GetFcb(lookbackPeriods); -``` - -## Parameters - -| name | type | notes -| -- |-- |-- -| `windowSpan` | int | Fractal evaluation window span width (`S`). Must be at least 2. Default is 2. - -The total evaluation window size is `2×S+1`, representing `±S` from the evalution date. See [Williams Fractal](../Fractal#content) for more information about Fractals and `windowSpan`. - -### Historical quotes requirements - -You must have at least `2×S+1` periods of `quotes`; however, more is typically provided since this is a chartable candlestick pattern. - -`quotes` is an `IEnumerable` 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. - -## Response - -```csharp -IEnumerable -``` - -- This method returns a time series of all available indicator values for the `quotes` provided. -- 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 periods before the first fractal are `null` since they cannot be calculated. - -### FcbResult - -| name | type | notes -| -- |-- |-- -| `Date` | DateTime | Date -| `UpperBand` | decimal | FCB upper band -| `LowerBand` | decimal | FCB lower band - -### 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) - -See [Utilities and Helpers]({{site.baseurl}}/utilities#utilities-for-indicator-results) for more information. - -## Example - -```csharp -// fetch historical quotes from your feed (your method) -IEnumerable quotes = GetHistoryFromFeed("SPY"); - -// calculate Fcb(14) -IEnumerable results = quotes.GetFcb(14); -``` diff --git a/docs/_indicators/Fcb.md b/docs/_indicators/Fcb.md new file mode 100644 index 00000000..7b2f4c51 --- /dev/null +++ b/docs/_indicators/Fcb.md @@ -0,0 +1,78 @@ +--- +title: Fractal Chaos Bands (FCB) +permalink: /indicators/Fcb/ +type: price-channel +layout: indicator +--- + +# {{ page.title }} +
+ +## **get_fcb**(*quotes, window_span=2*) + +## Parameters + +| name | type | notes +| -- |-- |-- +| `quotes` | Iterable[Type[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). +| `window_span` | int | Fractal evaluation window span width (`S`). Must be at least 2. Default is 2. + +The total evaluation window size is `2×S+1`, representing `±S` from the evalution date. See [Williams Fractal](../Fractal#content) for more information about Fractals and `window_span`. + +### Historical quotes requirements + +You must have at least `2×S+1` periods of `quotes`; however, more is typically provided since this is a chartable candlestick pattern. + +`quotes` is an `Iterable[Type[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 +FCBResults[FCBResult] +``` + +- This method returns a time series of all available indicator values for the `quotes` provided. +- `FCBResults` is just a list of `FCBResult`. +- 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 periods before the first fractal are `None` since they cannot be calculated. + +### FCBResult + +| name | type | notes +| -- |-- |-- +| `date` | datetime | Date +| `upper_band` | Decimal, Optional | FCB upper band +| `lower_band` | Decimal, Optional | FCB lower band + +### Utilities + +- [.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 +from stock_indicators import indicators + +# This method is NOT a part of the library. +quotes = get_history_from_feed("SPY") + +# Calculate Fcb(14) +results = indicators.get_fcb(quotes, 14); +``` + +## About: {{ page.title }} + +Created by Edward William Dreiss, Fractal Chaos Bands outline high and low price channels to depict broad less-chaotic price movements. FCB is a channelized depiction of [Williams Fractal](../Fractal#content). +[[Discuss] :speech_balloon:]({{site.github.base_repository_url}}/discussions/347 "Community discussion about this indicator") + +![image]({{site.charturl}}/Fcb.png) + +### Sources + +- [C# core]({{site.base_sourceurl}}/e-k/Fcb/Fcb.cs) +- [Python wrapper]({{site.sourceurl}}/fcb.py) From c09b2da72f2e80999fbd4844bc07605b8d23ee7c Mon Sep 17 00:00:00 2001 From: Dong-Geon Lee Date: Mon, 24 Jan 2022 14:42:27 +0900 Subject: [PATCH 11/12] Add some emphasis --- docs/_indicators/Adl.md | 2 +- docs/_indicators/Alma.md | 2 +- docs/_indicators/Aroon.md | 2 +- docs/_indicators/Atr.md | 2 +- docs/_indicators/Awesome.md | 2 +- docs/_indicators/Beta.md | 3 +-- docs/_indicators/BollingerBands.md | 2 +- docs/_indicators/Bop.md | 2 +- docs/_indicators/Cci.md | 2 +- docs/_indicators/ChaikinOsc.md | 2 +- docs/_indicators/Chandelier.md | 2 +- docs/_indicators/Chop.md | 2 +- docs/_indicators/Cmf.md | 2 +- docs/_indicators/ConnorsRsi.md | 2 +- docs/_indicators/Correlation.md | 2 +- docs/_indicators/Donchian.md | 2 +- docs/_indicators/DoubleEma.md | 2 +- docs/_indicators/Dpo.md | 2 +- docs/_indicators/ElderRay.md | 2 +- docs/_indicators/Ema.md | 2 +- docs/_indicators/Epma.md | 2 +- docs/_indicators/Fcb.md | 2 +- docs/_indicators/Fractal.md | 2 +- docs/_indicators/HeikinAshi.md | 2 +- docs/_indicators/Ichimoku.md | 2 +- docs/_indicators/Macd.md | 2 +- docs/_indicators/ParabolicSar.md | 2 +- docs/_indicators/Roc.md | 2 +- docs/_indicators/Rsi.md | 2 +- docs/_indicators/Slope.md | 2 +- docs/_indicators/Sma.md | 2 +- docs/_indicators/StdDevChannels.md | 2 +- docs/_indicators/Stoch.md | 2 +- docs/_indicators/StochRsi.md | 2 +- docs/_indicators/SuperTrend.md | 2 +- docs/_indicators/TripleEma.md | 2 +- docs/_indicators/Trix.md | 2 +- 37 files changed, 37 insertions(+), 38 deletions(-) diff --git a/docs/_indicators/Adl.md b/docs/_indicators/Adl.md index 26f146d0..1963078d 100644 --- a/docs/_indicators/Adl.md +++ b/docs/_indicators/Adl.md @@ -19,7 +19,7 @@ layout: indicator ### Historical quotes requirements -You must have at least two historical quotes; however, since this is a trendline, more is recommended. +You must have at least two historical quotes to cover the warmup periods; however, since this is a trendline, more is recommended. `quotes` is an `Iterable[Type[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. diff --git a/docs/_indicators/Alma.md b/docs/_indicators/Alma.md index a27407f2..2d080f45 100644 --- a/docs/_indicators/Alma.md +++ b/docs/_indicators/Alma.md @@ -21,7 +21,7 @@ layout: indicator ### Historical quotes requirements -You must have at least `N` periods of `quotes`. +You must have at least `N` periods of `quotes` to cover the warmup periods. `quotes` is an `Iterable[Type[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. diff --git a/docs/_indicators/Aroon.md b/docs/_indicators/Aroon.md index d792ae32..bc094936 100644 --- a/docs/_indicators/Aroon.md +++ b/docs/_indicators/Aroon.md @@ -28,7 +28,7 @@ results = indicators.get_aroon(quotes, lookback_periods) ### Historical quotes requirements -You must have at least `N` periods of `quotes`. +You must have at least `N` periods of `quotes` to cover the warmup periods. `quotes` is an `Iterable[Type[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. diff --git a/docs/_indicators/Atr.md b/docs/_indicators/Atr.md index a01a3799..e0dc823f 100644 --- a/docs/_indicators/Atr.md +++ b/docs/_indicators/Atr.md @@ -19,7 +19,7 @@ layout: indicator ### Historical quotes requirements -You must have at least `N+100` periods of `quotes`. Since this uses a smoothing technique, we recommend you use at least `N+250` data points prior to the intended usage date for better precision. +You must have at least `N+100` periods of `quotes` to cover the convergence periods. Since this uses a smoothing technique, we recommend you use at least `N+250` data points prior to the intended usage date for better precision. `quotes` is an `Iterable[Type[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. diff --git a/docs/_indicators/Awesome.md b/docs/_indicators/Awesome.md index e9f33636..60bd826d 100644 --- a/docs/_indicators/Awesome.md +++ b/docs/_indicators/Awesome.md @@ -21,7 +21,7 @@ layout: indicator ### Historical quotes requirements -You must have at least `S` periods of `quotes`. +You must have at least `S` periods of `quotes` to cover the warmup periods. `quotes` is an `Iterable[Type[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. diff --git a/docs/_indicators/Beta.md b/docs/_indicators/Beta.md index 8f7c7a3e..5d375dd8 100644 --- a/docs/_indicators/Beta.md +++ b/docs/_indicators/Beta.md @@ -22,8 +22,7 @@ layout: indicator ### Historical quotes requirements - -You must have at least `N` periods of quotes. You must have at least the same matching date elements of `market_history`. Exception will be thrown if not matched. Historical price quotes should have a consistent frequency (day, hour, minute, etc). See [the Guide]({{site.baseurl}}/guide/#historical-quotes) for more information. +You must have at least `N` periods of quotes to cover the warmup periods. You must have at least the same matching date elements of `market_history`. Exception will be thrown if not matched. Historical price quotes should have a consistent frequency (day, hour, minute, etc). See [the Guide]({{site.baseurl}}/guide/#historical-quotes) for more information.