Extreme events are those bars with a true range larger than 3*sigma+average,
where average and standard deviation are estimated from the last 200 bars.
In this way the ATR is not altered by exceptional events (e.g. the flash crash of Jan 3rd 2019)
and can still be used safely for Stop Losses and Take Profits.
Hitting the like button is a free sign of gratitude, thanks.