Detecting Floor-Ceils

Short Selling in Trading, Section: 7, 11

Hello, in this notebook we're creating code to detect floors and ceils and this code is supposed to delete intermediate swing highs followed by others swing highs or swing lows followed by swing lows but having this sequence: swing high>swing low>swing high>swing low... etc.

Can you check why here we have two consecutive swing highs?

Imgur: The magic of the Internet

Hi Daniel,



I printed the two instances where we had two consecutive swing highs:





As you can see both these values are exactly the same. The two consecutive swing highs occurred because the elimination logic does not account for cases where swing highs are equal. But this should not affect the trend analysis because the general trend direction and overall pattern remain the same.



Hope this helps!



Thanks

Rushda