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-160] Add Relative Vigor Index #161

Merged
merged 1 commit into from
Jun 24, 2023
Merged

[GH-160] Add Relative Vigor Index #161

merged 1 commit into from
Jun 24, 2023

Conversation

jealous
Copy link
Owner

@jealous jealous commented Jun 24, 2023

The Relative Vigor Index (RVI) is a momentum indicator used in technical analysis that measures the strength of a trend by comparing a security's closing price to its trading range while smoothing the results using a simple moving average (SMA).

https://www.investopedia.com/terms/r/relative_vigor_index.asp

Formular

  • NUMERATOR= (a+(2×b)+(2×c)+d) / 6
  • DENOMINATOR= (e+(2×f)+(2×g)+h) / 6
  • RVI= SMA-N of DENOMINATOR / SMA-N of NUMERATOR
  • Signal Line = (RVI+(2×i)+(2×j)+k) / 6

where:

  • a=Close−Open
  • b=Close−Open One Bar Prior to a
  • c=Close−Open One Bar Prior to b
  • d=Close−Open One Bar Prior to c
  • e=High−Low of Bar a
  • f=High−Low of Bar b
  • g=High−Low of Bar c
  • h=High−Low of Bar d
  • i=RVI Value One Bar Prior
  • j=RVI Value One Bar Prior to i
  • k=RVI Value One Bar Prior to j
  • N=Minutes/Hours/Days/Weeks/Months

Examples:

  • df['rvgi'] retrieves the RVGI line of window 14
  • df['rvgis'] retrieves the RVGI signal line of window 14
  • df['rvgi_5'] retrieves the RVGI line of window 5
  • df['rvgis_5'] retrieves the RVGI signal line of window 5

The Relative Vigor Index (RVI) is a momentum indicator
used in technical analysis that measures the strength
of a trend by comparing a security's closing price to
its trading range while smoothing the results using a
simple moving average (SMA).

https://www.investopedia.com/terms/r/relative_vigor_index.asp

Formular

* NUMERATOR= (a+(2×b)+(2×c)+d) / 6
* DENOMINATOR= (e+(2×f)+(2×g)+h) / 6
* RVI= SMA-N of DENOMINATOR / SMA-N of NUMERATOR
* Signal Line = (RVI+(2×i)+(2×j)+k) / 6

where:

* a=Close−Open
* b=Close−Open One Bar Prior to a
* c=Close−Open One Bar Prior to b
* d=Close−Open One Bar Prior to c
* e=High−Low of Bar a
* f=High−Low of Bar b
* g=High−Low of Bar c
* h=High−Low of Bar d
* i=RVI Value One Bar Prior
* j=RVI Value One Bar Prior to i
* k=RVI Value One Bar Prior to j
* N=Minutes/Hours/Days/Weeks/Months

Examples:
* `df['rvgi']` retrieves the RVGI line of window 14
* `df['rvgis']` retrieves the RVGI signal line of window 14
* `df['rvgi_5']` retrieves the RVGI line of window 5
* `df['rvgis_5']` retrieves the RVGI signal line of window 5
@jealous jealous self-assigned this Jun 24, 2023
@codecov-commenter
Copy link

Codecov Report

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

Comparison is base (abe781d) 97.72% compared to head (b77d722) 98.01%.

❗ 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     #161      +/-   ##
==========================================
+ Coverage   97.72%   98.01%   +0.28%     
==========================================
  Files           1        1              
  Lines         880      907      +27     
==========================================
+ Hits          860      889      +29     
+ Misses         20       18       -2     
Impacted Files Coverage Δ
stockstats.py 98.01% <100.00%> (+0.28%) ⬆️

☔ 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 e486d15 into master Jun 24, 2023
@jealous jealous deleted the feature/rvgi branch June 24, 2023 16:39
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.

2 participants