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

indicator chaining #802

Merged
merged 106 commits into from
Jun 19, 2022
Merged

indicator chaining #802

merged 106 commits into from
Jun 19, 2022

Conversation

DaveSkender
Copy link
Owner

@DaveSkender DaveSkender commented May 9, 2022

Description

Resolve #630 and adding general indicator chaining so you can do things like:

# choose any candle part or variant
# to override the default
var results = quotes
  .Use(CandlePart.OHLC4)
  .GetRsi(14);
# slope of any indicator
var results = quotes
  .GetMacd()
  .GetSlope();

Note: not all combinations are available as a secondary combination since some require the full quote for calculation (e.g. ATR, Heikin-Ashi require multiple candle parts).

Breaking changes

  • numerous result values and some parameters changed from decimal to double
  • result class is now sealed and cannot be used as a derived class (required for reusable chaining), though you can just replicate the class properties
  • IMPORTANT!: Beta and Price Relative Strength (PRS) have swapped positions of Eval and Base (Market) quote parameters positions, for consistency. Since these have the same data type profile, it does not naturally produce a warning! A warning is forced on v2.0.0 only as a precaution but will be removed in the next released version.
  • GetSmaExtended() was renamed to GetSmaAnalysis(). We'll expand on and improve extended analysis broadly in future versions. See Extended Analysis #320 on how this may change in the future.
  • results now return NaN instead of null in random div/0 scenarios; though, we intend to revert this change to reduce user friction, see random NaN values #839 --> please note, this was reversed in v2.0.3 and now returns null

@DaveSkender DaveSkender self-assigned this May 14, 2022
@LeeDongGeon1996
Copy link
Contributor

LeeDongGeon1996 commented Jun 14, 2022

This is going to be a giant step. I need to think about how to apply these changes to Python wrapper 😂(especially, indicator chaining)

@DaveSkender
Copy link
Owner Author

DaveSkender commented Jun 14, 2022

This is going to be a giant step. I need to think about how to apply these changes to Python wrapper 😂(especially, indicator chaining)

@LeeDongGeon1996, I know. It was a more significant thing than expected. It's likely going to be a major v2.0 release change.

The old APIs all still work just fine, so there's nothing major that should break its use in the Python wrapper, with the exception of a few noted things above, and there's certainly some new features to add. Most of the work in this PR is just refactoring code to make it more maintainable and to prepare for some future stuff (e.g. streaming uses cases).

It might be better to get the wrapper to a stable 1.0 before starting on some of this.

@LeeDongGeon1996
Copy link
Contributor

I've thought about the way to add these features(chaining, streaming) and figured out that it needs substantial refactoring.

It might be better to get the wrapper to a stable 1.0 before starting on some of this.

I think so. And if possible, I'd like to version up pythonnet so that the library can support .NET 6.0. :)

@DaveSkender DaveSkender marked this pull request as ready for review June 19, 2022 08:11
@DaveSkender DaveSkender merged commit 05bbd34 into main Jun 19, 2022
@DaveSkender DaveSkender deleted the chaining branch June 19, 2022 08:19
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Get the Slope of any indicator in the library
2 participants