New generic accessors HLC3, HL2 and OHLC4#106
Open
priikone wants to merge 1 commit intoandredumas:masterfrom
Open
New generic accessors HLC3, HL2 and OHLC4#106priikone wants to merge 1 commit intoandredumas:masterfrom
priikone wants to merge 1 commit intoandredumas:masterfrom
Conversation
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.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.