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

New generic accessors HLC3, HL2 and OHLC4 #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

priikone
Copy link
Contributor

Add HLC3 ((h + l + c) / 3), HL2 ((h + l) / 2) and OHLC4
((o + h + l + c) / 4) as generic accessors that can be used with different
indicators. Most indicators access the data with p.accessor(d) and with
the new accessors they can now get the data in various different forms
(and not only the close price what OHLC accessor provides).

Change the VWAP to use p.accessor(d) and HLC3 accessor by default.

Add HLC3 ((h + l + c) / 3), HL2 ((h + l) / 2) and OHLC4
((o + h + l + c) / 4) as generic accessors that can be used with different
indicators.  Most indicators access the data with p.accessor(d) and with
the new accessors they can now get the data in various different forms
(and not only the close price what OHLC accessor provides).

Change the VWAP to use p.accessor(d) and HLC3 accessor by default.
@andredumas
Copy link
Owner

Thanks again for the contribution.

Let me have a think about this one. The purpose of accessors is to allow users to redefine how elements are read from their data. By redefining the default method to a calculation it changes the purpose somewhat. I feel these are very specific to indicators or calculations rather than data accessors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants