PROTECTED SOURCE SCRIPT
3x Moving Averages with Optional Background Fill

Three MAs with toggles to fill MA2–MA1 and MA3–MA2.
below is Japanese too.
English
This Pine Script plots three moving averages—MA1, MA2, MA3—each with its own type, length, source, color, and offset. You can independently toggle background fills between MA2–MA1 and MA3–MA2.
- Common MA function: Selects calculation among SMA, EMA, SMMA, WMA, VWMA.
- Inputs: Each MA group defines settings; MA2 has a toggle for filling MA2–MA1, MA3 has a toggle for filling MA3–MA2.
- Computation: Each MA is computed only when its type isn’t “None”.
- Plotting: Three plot lines, hidden if disabled.
- Background fill: Uses translucent colors; fill(p1, p2, ...) for MA2–MA1 and fill(p2, p3, ...) for MA3–MA2, gated by their toggles.
Behavior notes: If either line in a pair is disabled, that fill won’t show. Different offsets can shift visuals; keep offsets aligned for clean fills.
日本語
このPineスクリプトは3本の移動平均(MA1・MA2・MA3)を描画し、各ラインに対してタイプ、期間、ソース、色、オフセットを個別設定できます。背景塗りはMA2とMA1、MA3とMA2のペアでそれぞれオン/オフ可能です。
- 共通MA関数: SMA、EMA、SMMA、WMA、VWMAから計算方式を選択。
- 入力: 各MAグループで設定を持ち、MA2は「MA2–MA1塗り」、MA3は「MA3–MA2塗り」のトグルを備えます。
- 計算: タイプが「None」でない場合のみ各MAを算出。
- 描画: 3本のplotで表示し、無効時は非表示。
- 背景塗り: 透過色を使用し、fill(p1, p2, ...)でMA2–MA1、fill(p2, p3, ...)でMA3–MA2を塗り、各トグルで制御します。
注意点: ペアのどちらかが無効なら塗りは出ません。オフセットが異なると塗り位置がずれるため、揃えると見やすくなります。
below is Japanese too.
English
This Pine Script plots three moving averages—MA1, MA2, MA3—each with its own type, length, source, color, and offset. You can independently toggle background fills between MA2–MA1 and MA3–MA2.
- Common MA function: Selects calculation among SMA, EMA, SMMA, WMA, VWMA.
- Inputs: Each MA group defines settings; MA2 has a toggle for filling MA2–MA1, MA3 has a toggle for filling MA3–MA2.
- Computation: Each MA is computed only when its type isn’t “None”.
- Plotting: Three plot lines, hidden if disabled.
- Background fill: Uses translucent colors; fill(p1, p2, ...) for MA2–MA1 and fill(p2, p3, ...) for MA3–MA2, gated by their toggles.
Behavior notes: If either line in a pair is disabled, that fill won’t show. Different offsets can shift visuals; keep offsets aligned for clean fills.
日本語
このPineスクリプトは3本の移動平均(MA1・MA2・MA3)を描画し、各ラインに対してタイプ、期間、ソース、色、オフセットを個別設定できます。背景塗りはMA2とMA1、MA3とMA2のペアでそれぞれオン/オフ可能です。
- 共通MA関数: SMA、EMA、SMMA、WMA、VWMAから計算方式を選択。
- 入力: 各MAグループで設定を持ち、MA2は「MA2–MA1塗り」、MA3は「MA3–MA2塗り」のトグルを備えます。
- 計算: タイプが「None」でない場合のみ各MAを算出。
- 描画: 3本のplotで表示し、無効時は非表示。
- 背景塗り: 透過色を使用し、fill(p1, p2, ...)でMA2–MA1、fill(p2, p3, ...)でMA3–MA2を塗り、各トグルで制御します。
注意点: ペアのどちらかが無効なら塗りは出ません。オフセットが異なると塗り位置がずれるため、揃えると見やすくなります。
受保護腳本
此腳本以閉源形式發佈。 However, you can use it freely and without any limitations – learn more here.
免責聲明
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
受保護腳本
此腳本以閉源形式發佈。 However, you can use it freely and without any limitations – learn more here.
免責聲明
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.