Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GH-152] Extract Kaufman's Adaptive Moving Average #153

Merged
merged 1 commit into from
Jun 23, 2023
Merged

Conversation

jealous
Copy link
Owner

@jealous jealous commented Jun 23, 2023

The Efficiency Ratio (ER) is calculated by
dividing the price change over a period by the
absolute sum of the price movements that occurred
to achieve that change.

The resulting ratio ranges between 0 and 1 with
higher values representing a more efficient or
trending market.

The default column is close.

The default window is 10.

Formular:

  • window_change = ABS(close - close[n])
  • last_change = ABS(close-close[1])
  • volatility = moving sum of last_change in n
  • KER = window_change / volatility

Examples:

  • df['ker'] retrieves the 10 periods KER of the close price
  • df['high_5_ker'] retrieves 5 periods KER of the high price

@jealous jealous self-assigned this Jun 23, 2023
The Efficiency Ratio (ER) is calculated by
dividing the price change over a period by the
absolute sum of the price movements that occurred
to achieve that change.

The resulting ratio ranges between 0 and 1 with
higher values representing a more efficient or
trending market.

The default column is close.

The default window is 10.

Formular:
* window_change = ABS(close - close[n])
* last_change = ABS(close-close[1])
* volatility = moving sum of last_change in n
* KER = window_change / volatility

Examples:
* `df['ker']` retrieves the 10 periods KER of the close price
* `df['high_5_ker']` retrieves 5 periods KER of the high price
@codecov-commenter
Copy link

codecov-commenter commented Jun 23, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.44 🎉

Comparison is base (2bac991) 98.26% compared to head (01bc7bf) 98.71%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #153      +/-   ##
==========================================
+ Coverage   98.26%   98.71%   +0.44%     
==========================================
  Files           1        1              
  Lines         922      931       +9     
==========================================
+ Hits          906      919      +13     
+ Misses         16       12       -4     
Impacted Files Coverage Δ
stockstats.py 98.71% <100.00%> (+0.44%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jealous jealous merged commit b912fa5 into master Jun 23, 2023
5 checks passed
@jealous jealous deleted the bugfix/er branch July 10, 2023 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants