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

Add EnterAndHoldCriterion #1105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nimo23
Copy link
Contributor

@nimo23 nimo23 commented Sep 1, 2023

Fixes #.

Changes proposed in this pull request:

  • EnterAndHoldReturnCriterion replaced by EnterAndHoldCriterion to calculate the "enter and hold"-strategy of any criteria.

  • simplified VersusEnterAndHoldCriterion due to the use of EnterAndHoldCriterion

  • Added a check in EnterAndHoldCriterion and VersusEnterAndHoldCriterion: If a BarSeries is empty, then 1 is returned

  • added an entry with related ticket number(s) to the unreleased section of CHANGES.md

@nimo23 nimo23 force-pushed the Added-EnterAndHoldCriterion branch 2 times, most recently from 51875b9 to fc457df Compare September 1, 2023 07:33
@nimo23
Copy link
Contributor Author

nimo23 commented Sep 1, 2023

@team172011 Please check:

  • Added a check in EnterAndHoldCriterion and VersusEnterAndHoldCriterion: If a BarSeries is empty, then 0 is returned

Or should I return 1 instead of 0 when BarSeries is empty (as you did in #1095? If yes, then what does an EnterAndHold (or a VersusEnterAndHold) of "1" (100%) mean?

@team172011
Copy link
Member

what does an EnterAndHold (or a VersusEnterAndHold) of "1" (100%) mean?

It means that you have neither profit nor loss, so you still hold 100 % of your invested amount of money. So 1 would be the correct value for empty bar series, because you will not be able to invest your money and neither face any profits nor face any losses

@nimo23
Copy link
Contributor Author

nimo23 commented Sep 1, 2023

So 1 would be the correct value for empty bar series, because you will not be able to invest your money and neither face any profits nor face any losses

OK, that makes sense. I also improved the javadoc.

@team172011 Perhaps you can also check any other criteria where this should be changed (i.e. if (barSeries == null) return series.one());)

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.

None yet

2 participants