Skip to content

New generic accessors HLC3, HL2 and OHLC4#106

Open
priikone wants to merge 1 commit intoandredumas:masterfrom
priikone:pull-new-accessors
Open

New generic accessors HLC3, HL2 and OHLC4#106
priikone wants to merge 1 commit intoandredumas:masterfrom
priikone:pull-new-accessors

Conversation

@priikone
Copy link
Copy Markdown
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
Copy Markdown
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