Moving Average Above / Below

Due to changes made by TradingView, my old script "Moving Average Trend-Buschi" is no longer functioning. Please use this indicator.
Description:
This script shows via selectable sorts of Moving Averages (normal, weighted or exponential) the amount of units (e. g. trading days) that are currently above (value in green) or under (value in red) the main series. The value is shown on the indicator line as an argument.
Due to the changes mentioned above, please add the corresponding built-in moving average as a separate indicator.
Deutsch:
Aufgrund von Änderungen seitens TradingView funktioniert mein altes Skript "Moving Average Trend-Buschi" nicht mehr. Bitte benutzt diesen Indikator.
Beschreibung:
Das Skript zeigt über auswählbare gleitende Durchschnitte (normal, gewichtet oder exponentiell) die Anzahl an Einheiten (z. B. Handelstage) auf, die zum jeweiligen Zeitpunkt hintereinander über (in grün) oder unter (in rot) dem Hauptsymbol verlaufen. Der Wert wird in der Indikator-Zeile als Argument angezeigt.
Aufgrund der oben beschriebenen Änderungen müsst / könnt ihr noch den zugehörigen eingebauten gleitenden Durchschnitt als separaten Indikator hinzufügen.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Để truy cập nhanh vào biểu đồ, hãy thêm tập lệnh này vào mục yêu thích của bạn — tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Để truy cập nhanh vào biểu đồ, hãy thêm tập lệnh này vào mục yêu thích của bạn — tìm hiểu thêm tại đây.