업데이트됨

Pono Smart Moving Averages

609
Pono Smart Moving Averages

Four fully customizable moving averages that automatically rescale themselves to your chart — with a bullish/bearish/neutral regime cloud, regime-colored MA lines, and built-in protection against Pine's 5,000-bar runtime error.

Overview

Most moving average indicators force you to recalculate your periods every time you change timeframes. A 390-period average means something completely different on a 1-minute chart than it does on a 15-minute chart — so traders either constantly edit settings or end up comparing apples to oranges.

Pono Smart Moving Averages solves that with Smart Adjust: define each MA once, anchored to a reference timeframe, and the indicator automatically converts that period to whatever timeframe you're currently viewing. Switch charts freely — your averages always span the same amount of market time.

How Smart Adjust Works

Each MA has a Period and a Reference Timeframe. When Smart Adjust is enabled, the plotted period is recalculated for your current chart:

Effective Period = Period × (Reference Timeframe ÷ Chart Timeframe)

Example: a 390-period MA referenced to the 5-minute timeframe becomes:


1,950 bars on a 1-minute chart

390 bars on a 5-minute chart

130 bars on a 15-minute chart

Same lookback window, same meaning — on any timeframe. Smart Adjust can be toggled off per-MA if you prefer a fixed bar count.

The Regime Cloud

A color-coded cloud fills the space between two MAs of your choice (MA 1 and MA 2 by default, any pair selectable):

Bullish — the fast MA is above the slow MA

Bearish — the fast MA is below the slow MA

Neutral — the MAs are within a user-defined tolerance of each other (default 0.05%), flagging crossovers and indecision instead of flickering between colors

On top of that, the MA lines themselves change color with the regime (enabled by default): the cloud pair adopts the solid bullish/bearish/neutral color so trend state is readable at a glance, even with the cloud fill turned off. Prefer classic fixed colors? One checkbox restores each MA's individual color. You can also extend regime coloring to all four MAs for a full-ribbon effect.

Never See RE10004 Again

On very low timeframes, Smart Adjust can push an effective period past Pine's hard limit of 5,000 historical bars — which normally kills the indicator with a runtime error. Pono Smart MAs detects this before it happens: the offending MA is quietly hidden and, if you leave the warning enabled, a small message in the corner tells you exactly how many bars that MA needs and suggests switching to a higher timeframe or lowering the period. No error banner, no broken chart — and it also warns you when your chart simply hasn't loaded enough history for an average to draw yet.

Key Features

4 independent moving averages — each with its own type (SMA/EMA), source, period, reference timeframe, color, width, and line style

Smart Adjust per MA — periods anchored to a reference timeframe, automatically rescaled to your chart

Regime cloud between any two MAs with bullish / bearish / neutral (tolerance-based) coloring

Regime-colored MA lines, on by default, with an option to tint all four MAs

Runtime-error suppression — no RE10004; affected MAs hide gracefully with an optional on-chart explanation

Insufficient-history warnings so a blank MA is never a mystery

No request.security, no repainting — everything is calculated from your chart's own data in real time

Ideas for Use

Trend filter: price above a bullish (green) cloud = long bias only; below a bearish (red) cloud = short bias only. Amber cloud = stand aside.

Dynamic support/resistance: intraday traders can anchor long-period averages (e.g. the default 390/780 pair) to a higher reference timeframe and watch them act as intraday levels without leaving their execution chart.

Crossover momentum: the neutral (amber) zone gives early warning that a cross is developing before it completes — useful for tightening stops or scaling out.

Notes & Limitations

Smart Adjust keeps the time span of an average constant; because the calculation runs on chart-timeframe bars, values will differ slightly from an MA computed natively on the reference timeframe's candles.

Very small chart timeframes combined with very large reference periods can still exceed what Pine can calculate — in that case the MA hides and the warning explains why, rather than erroring.

Neutral coloring is tolerance-based; set the tolerance to 0 if you only want neutral on an exact MA touch.

Pono Smart Moving Averages is provided for charting and educational purposes only and does not constitute financial advice. Always do your own analysis before making trading decisions.

Optional release notes (v1.0):
Initial release — 4 smart-adjusted SMA/EMA lines, bullish/bearish/neutral regime cloud with regime-colored MAs, and automatic RE10004 error suppression with on-chart data warnings.
릴리즈 노트
added comments to the script

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.