I've added a script from the Public Library, and it is calculated incorrectly and/or I don't understand how it works

Scripts of the Public Library are written by TradingView users. If you have any questions related to such a study, please contact its author directly. You can find the author nickname next to the script title in the Indicators dialog window:

Home Stock Screener Forex Screener Crypto Screener Economic Calendar About Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter