BiasBand

When a close breaks beyond the bands the indicator sets the state (flip) and saves a pivot (option to use the confirmed basis from the previous bar). To reduce false signals it includes:
- Pivot buffer percent — a percentage hysteresis around the pivot to avoid micro-flips.
- Recovery check — if the basis crosses the pivot (beyond the buffer) the state is updated even without a band breakout.
- Slope-based backup — ability to force a flip when the basis moves persistently in the opposite direction for N consecutive bars.
- Session shading (optional) and debug label for tuning.
BiasBand is intended for intraday traders and scalpers who want a quick indication of market bias with extra filters to reduce noise and false flips. The envelope always follows the chart timeframe (multi-TF consistency).
Main inputs (quick explanation)
- MA Period (lenEnv): period of the moving average used as the basis for the envelope.
- Envelope Percent (pctEnvIn): width of the bands expressed as a percentage of the basis.
- Pivot buffer percent (pivotBufPct): hysteresis around the pivot to avoid micro-flips (e.g. 0.001 = 0.1%).
- Save pivot = basisRaw[1] (pivotUsePrevBar): when true, the pivot is saved from the confirmed previous basis bar instead of the current basis — reduces intrabar noise.
- Enable basis-slope flip / Consecutive bars (basisSlopeBars): backup mechanism that forces a flip when the basis moves persistently for N bars.
- Session shading: optional hourly shading over a chosen time range.
- Show debug label: displays useful values for the latest bar to help parameter tuning.
Tập lệnh chỉ hiển thị cho người được mời
Chỉ những người dùng được tác giả đồng ý mới có thể truy cập tập lệnh này. Bạn cần yêu cầu và xin phép sử dụng tập lệnh này. Quyền truy cập thường được cấp sau khi thanh toán. Để biết thêm chi tiết, hãy làm theo hướng dẫn của tác giả bên dưới hoặc liên hệ trực tiếp với RiskGuard.
TradingView KHÔNG khuyến khích trả tiền hoặc sử dụng tập lệnh trừ khi bạn hoàn toàn tin tưởng tác giả và hiểu cách hoạt động của tập lệnh. Bạn cũng có thể tìm thấy các giải pháp thay thế miễn phí, mã nguồn mở trong mục tập lệnh cộng đồng của chúng tôi.
Hướng dẫn của tác giả
Thông báo miễn trừ trách nhiệm
Tập lệnh chỉ hiển thị cho người được mời
Chỉ những người dùng được tác giả đồng ý mới có thể truy cập tập lệnh này. Bạn cần yêu cầu và xin phép sử dụng tập lệnh này. Quyền truy cập thường được cấp sau khi thanh toán. Để biết thêm chi tiết, hãy làm theo hướng dẫn của tác giả bên dưới hoặc liên hệ trực tiếp với RiskGuard.
TradingView KHÔNG khuyến khích trả tiền hoặc sử dụng tập lệnh trừ khi bạn hoàn toàn tin tưởng tác giả và hiểu cách hoạt động của tập lệnh. Bạn cũng có thể tìm thấy các giải pháp thay thế miễn phí, mã nguồn mở trong mục tập lệnh cộng đồng của chúng tôi.