title: How to find tops and bottoms in time series?
body: <p>At first, this question can sound really stupid, but it is not in fundamental. Maybe, it can seem like unresolvable exactly by any algorithm, but I pretend to say it is.</p>
  
  <p>So question. I have chart, for example gold. I need to find where are tops and bottoms on time axial. The problem is I need to find where major upturns and major downturns start. The problem is that there is lot of small irrelevant upturns and downturns. </p>
  
  <p>Here is the picture for better understanding - the red spots are that I want to find(NOT EXACTLY, but in some way like this).</p>
  
  <p><img src="https://i.stack.imgur.com/lGIvD.jpg" alt="enter image description here"></p>
  
  <p>So I probably need to filter out small turnups and turndowns, but have no idea how to do it. I will be pleased by any ideas. I do not need algorithm in java etc, just in words it would be enough. </p>