alvarobartt / trendet

:chart_with_upwards_trend: Python package for trend detection on stock time series data :chart_with_downwards_trend:
https://trendet.readthedocs.io/
MIT License
443 stars 77 forks source link

develop a function to check that there are no conflictive trends #1

Closed alvarobartt closed 4 years ago

alvarobartt commented 4 years ago

Create a function to check that trends do not overlap, so the trend which last longer is the one to keep and the otherone is discarded.

For example, inside of a Down Trend between 01/01/2018 and 01/02/2018 there is an Up Trend between 05/01/2018 and 13/01/2018; and as the Down Trend lasts longer, it is expected to be the predominant trend on that market range of dates.

This issue was identified when developing the function identify_all_trends, where an Up Trend was overlapped inside a Down Trend, as shown below:

trendet

alvarobartt commented 4 years ago

Solved on commit 4a3042f16145b8f7af6e56f73d4d6dab66be961e as shown in the following plot generated via trendet gist:

trendet