Report the extra bar three candlestick patterns wait for - #9710
Open
mkzung wants to merge 2 commits into
Open
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
AbandonedBaby,MatHoldandRiseFallThreeMethodsoverrideIsReadytoSamples > Periodandleave
WarmUpPeriodatWindowIndicator'sPeriod, so each turns ready one bar after the count itpublishes. The override returns
Period + 1.Related Issue
Closes #9709
Motivation and Context
WarmUpIndicatorfeeds exactlyWarmUpPeriodbars and hands back an indicator the caller treats asready. For these three it is not, and the first value read after warming up is 0.
Changing the comparison instead would move what the patterns report. Accumulation runs under
if (!IsReady), so readiness a bar earlier drops one term from every average and the TA-Lib fixturevalues move with it.
Period + 1changes no value anywhere. If you would rather these three matchedthe other 58 and used
>=, that is a larger change and I am happy to do it that way instead.The other 58 patterns already agree with their own
WarmUpPeriod.EveningDojiStarandMorningDojiStarcarry AbandonedBaby's three candle settings and declare... + 2 + 1against its... + 2;BreakawayandLadderBottomhave MatHold's exact period expression with>=.Requires Documentation Change
No.
How Has This Been Tested?
Added
WarmsUpProperlytoCandlestickPatternTests, matchingCommonIndicatorTests.WarmsUpProperlyand using the same
PatternTestParameterssource as the three tests already there.CandlestickPatternTestsdoes not derive fromCommonIndicatorTests, so of the four shared teststhe patterns only ever ran two, which is why this went unseen.
My local NUnit host crashes in a Python.NET finalizer before any test runs, because
QuantConnect.pythonnet2.0.65 wants Python 3.11 and this machine has 3.10. So the test wasreplayed from a console program linked against
QuantConnect.Indicators, running the same loop overthe same bars: 61 patterns pass, and reverting the three overrides fails exactly AbandonedBaby,
MatHold and RiseFallThreeMethods. The same program drives and resets all 177 constructible
indicators and finds no other disagreement between
WarmUpPeriodandIsReady.Types of changes
Checklist:
bug-<issue#>-<description>orfeature-<issue#>-<description>