Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Return newly created indicator instance in addIndicator method #1871

Merged
merged 4 commits into from
Feb 19, 2018

Conversation

ansonphong
Copy link
Contributor

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Update / modification

  • What is the new behavior (if this is a feature change)?
    Return the instance of the indicator when creating it.

  • Other information:
    This helps to store a reference of the indicator for use in more advanced strategies, and is fully backward compatible.

@askmike
Copy link
Owner

askmike commented Feb 7, 2018

I don't see the problem of adding this, however I fail to see what it allows for that you can't currently do.

@ansonphong
Copy link
Contributor Author

Right, reason for this PR being, I employ substrategies which are selected by the main Strat, and they create their own indicators, so for initializing them and storing internal refs, it is cleaner and simpler if it returns the indicator on creation.

Also in all cases I like to store a ref to the indicator object on creation, so I don't need to always dig it out of subobjects.

@askmike
Copy link
Owner

askmike commented Feb 19, 2018

sounds great! 👍

I really do want to do a major refactor of the indicator logic, it's not really reusable and very testable code at the moment. This won't happen before the end of the month though.

@askmike askmike merged commit 7dfdc99 into askmike:develop Feb 19, 2018
@ansonphong
Copy link
Contributor Author

Yes, a full (backwards compatible) refactor of the indicators would be great. Along with that I would love to see a way to visualize indicator graphs and histograms in backtesting, it would help so much for strategy development.

@askmike
Copy link
Owner

askmike commented Feb 25, 2018

Along with that I would love to see a way to visualize indicator graphs and histograms in backtesting, it would help so much for strategy development.

Will be part of #1850.

This was referenced Mar 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants