-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Update of finance.py to (O,H,L,C) instead of (O,C,H,L) #1783
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is the biggest problem - we have no way of detecting if the use is using the old interface or the new one. This kind of change is very hard for a user to track down, and is probably something that a user wouldn't even notice had changed. I don't dispute your assertion about the expected order, but it is because of this line that I am 👎 for this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we do
and rename the function with the new call order
plot_day_summary2
->plot_day_summary3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, better yet, add
plot_day_summary_ochl
as an alias forplot_day_summary2
and then addplot_day_summary_ohlc
? Then the intention is right in the name of the function, rather than just with a numerical suffix.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdboom - nice suggestion - I'd be in favour of that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pelson - You are absolutely right in that it must be clear to end-users which interface they are using. In fact, it shouldn' t be that hard to check which one they are using. You could simply check whether the fourth provided list (highs in the old ochl-interface, lows in the new ohlc-interface) is always larger or equal to the fifth list (lows in the old ochl-interface, closes in the new ohlc-interface). If this argument is true, they are using the old interface and we could raise an error. If this argument is false then they are using the new interface and all is good.
@mdboom - Indeed also a very good suggestion. I would be enthousiastic about this, although I still think that the ochl-flavour should eventually be removed to avoid confusion and simplify the interface by reducing the amount of functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer @mdboom's suggestion here. I am very in favour of verbose method names.
I agree here, but I'd prefer to see at least a deprecation warning before this is removed. That way our users are warned about a potential future alteration that requires a change to their code.