Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

Custom Triple Moving Average Strategy - Auto Backtesting

A Pine Script v4 strategy built on EMA (close, 200). It has 2 order rules, 2 entries among them, and trades long and short with the default settings. Exits wait for a signal; there is no stop loss. Each trade is one contract and pays no commission. 13 settings; defaults include MA1 Period 13, MA1 Type SMA and MA1 Source close.

Generated from the script's code by a template: every clause is a fact read from the source. Not written by a person or a model, and not taken from the author's description.

Does Custom Triple Moving Average Strategy - Auto Backtesting repaint?
No
No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
How did Custom Triple Moving Average Strategy - Auto Backtesting do on BTCUSDT 1D with default settings?
Not measured
It closed no trades there from 26 Jan 2024 to 21 Oct 2026 with the default settings, so there is no result to report. Its code limits trading to a date window, which can leave this period out. On BNBUSDT 1D it did trade; that row of the markets table below has its figures. A backtest, not investment advice.
Can Custom Triple Moving Average Strategy - Auto Backtesting be converted to Pine Script v5?
Yes
The upgrade takes 1 step, from v4; each was run before and after on the same candles with identical results, and the v5 script can be downloaded below.
Does Custom Triple Moving Average Strategy - Auto Backtesting use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Custom Triple Moving Average Strategy - Auto Backtesting run in Zeal Terminal?
Yes
It compiles in 21 ms and runs 1,000 bars in 40 ms, in the browser.

BTCUSDT · 1D · default settings

  • Plot
  • Plot
  • Plot
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
Prerendered with the defaults. Change anything and run it here. The script runs in your browser.
Settings (13)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$100,000$202,527Equity from $100,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. Lines are what the script plots.
Net profit
0.00%
$0.00
Buy and hold
+102.5%
same period
Closed trades
0
0 won · 0 lost
Profitable
0.0%
of closed trades
Profit factor
—
gross profit ÷ gross loss
Max drawdown
0.00%
$0.00

One run with the author's default settings, $100,000 starting capital, commission as the script sets it. A single backtest says little about future results and is not a recommendation. Backtests are simulations on historical data and are not investment advice.

Review

What a careful reader of this script would point out, found by checking the source and the backtest.

  • Check

    1 setting does nothing

    “Show Crosses” is declared but never read.

  • Check

    No stop loss

    Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.

  • Check

    No commission

    The backtest assumes free trading. Results on any real exchange will be lower.

  • Note

    No slippage

    Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.

  • Note

    Uses transp =, which v5 removed line 90

    transp = on line 90. v5 folds the transparency into the colour with color.new(c, transp).

Upgrade and export

Written in Pine Script v4. The upgrade to v5 takes 1 step, one per version, each applied to the result of the one before. A last clean-v5 pass then types the settings and moves when = into if blocks, which v6 requires. Every step runs before and after on the same candles in Zeal Terminal's engine; a step whose results differ is shown but not offered as a download. Upgrades preserve behaviour: bugs are fixed in the Review, never silently here.

  • Upgrading to v5 renames sma → ta.sma, ema → ta.ema, wma → ta.wma, rma → ta.rma, round → math.round, sqrt → math.sqrt, crossover → ta.crossover, crossunder → ta.crossunder.

v4 → v5

Verified

Same 4 trades and the same P&L on BNBUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 3: //@version=4 → //@version=5
  • Line 7: input(type = input.source) → input.source()
  • Line 8: input(type = input.bool) → input.bool()
  • Line 11: input(type = input.source) → input.source()
  • Line 12: input(type = input.bool) → input.bool()
  • Line 15: input(type = input.source) → input.source()
50 more edits
  • Line 16: input(type = input.bool) → input.bool()
  • Line 17: input(type = input.bool) → input.bool()
  • Line 19: sma → ta.sma
  • Line 22: ema → ta.ema
  • Line 25: wma → ta.wma
  • Line 28: rma → ta.rma
  • Line 31: wma → ta.wma
  • Line 31: wma → ta.wma
  • Line 31: wma → ta.wma
  • Line 31: round → math.round
  • Line 31: sqrt → math.sqrt
  • Line 34: ema → ta.ema
  • Line 35: ema → ta.ema
  • Line 38: ema → ta.ema
  • Line 39: ema → ta.ema
  • Line 39: ema → ta.ema
  • Line 39: ema → ta.ema
  • Line 42: sma → ta.sma
  • Line 45: ema → ta.ema
  • Line 48: wma → ta.wma
  • Line 51: rma → ta.rma
  • Line 54: wma → ta.wma
  • Line 54: wma → ta.wma
  • Line 54: wma → ta.wma
  • Line 54: round → math.round
  • Line 54: sqrt → math.sqrt
  • Line 57: ema → ta.ema
  • Line 58: ema → ta.ema
  • Line 61: ema → ta.ema
  • Line 62: ema → ta.ema
  • Line 62: ema → ta.ema
  • Line 62: ema → ta.ema
  • Line 65: sma → ta.sma
  • Line 68: ema → ta.ema
  • Line 71: wma → ta.wma
  • Line 74: rma → ta.rma
  • Line 77: wma → ta.wma
  • Line 77: wma → ta.wma
  • Line 77: wma → ta.wma
  • Line 77: round → math.round
  • Line 77: sqrt → math.sqrt
  • Line 80: ema → ta.ema
  • Line 81: ema → ta.ema
  • Line 84: ema → ta.ema
  • Line 85: ema → ta.ema
  • Line 85: ema → ta.ema
  • Line 85: ema → ta.ema
  • Line 90: transp = 80 → color.new(color.silver, 80)
  • Line 94: crossover → ta.crossover
  • Line 98: crossunder → ta.crossunder
⋯// © Meesemoo-//@version=4+//@version=5strategy("Custom MA Strategy Tester", overlay = true)⋯MA1Type = input(title="MA1 Type", defval="SMA", options=["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"])-MA1Source = input(title="MA1 Source", type=input.source, defval=close)+MA1Source = input.source(title="MA1 Source", defval=close)-MA1Visible = input(title="MA1 Visible", type=input.bool, defval=true)+MA1Visible = input.bool(title="MA1 Visible", defval=true)MA2Period = input(50, title="MA2 Period")MA2Type = input(title="MA2 Type", defval="SMA", options=["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"])-MA2Source = input(title="MA2 Source", type=input.source, defval=close)+MA2Source = input.source(title="MA2 Source", defval=close)-MA2Visible = input(title="MA2 Visible", type=input.bool, defval=true) +MA2Visible = input.bool(title="MA2 Visible", defval=true) MA3Period = input(200, title="MA3 Period")MA3Type = input(title="MA3 Type", defval="SMA", options=["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"])-MA3Source = input(title="MA3 Source", type=input.source, defval=close)+MA3Source = input.source(title="MA3 Source", defval=close)-MA3Visible = input(title="MA3 Visible", type=input.bool, defval=true)+MA3Visible = input.bool(title="MA3 Visible", defval=true)-ShowCrosses = input(title="Show Crosses", type=input.bool, defval=true)+ShowCrosses = input.bool(title="Show Crosses", defval=true)MA1 = if MA1Type == "SMA"-    sma(MA1Source, MA1Period)+    ta.sma(MA1Source, MA1Period)else    if MA1Type == "EMA"-        ema(MA1Source, MA1Period)+        ta.ema(MA1Source, MA1Period)    else        if MA1Type == "WMA"-            wma(MA1Source, MA1Period)+            ta.wma(MA1Source, MA1Period)        else            if MA1Type == "RMA"-                rma(MA1Source, MA1Period)+                ta.rma(MA1Source, MA1Period)            else                if MA1Type == "HMA"-                    wma(2*wma(MA1Source, MA1Period/2)-wma(MA1Source, MA1Period), round(sqrt(MA1Period)))+                    ta.wma(2*ta.wma(MA1Source, MA1Period/2)-ta.wma(MA1Source, MA1Period), math.round(math.sqrt(MA1Period)))                else                    if MA1Type == "DEMA"-                        e = ema(MA1Source, MA1Period)+                        e = ta.ema(MA1Source, MA1Period)-                        2 * e - ema(e, MA1Period)+                        2 * e - ta.ema(e, MA1Period)                    else                        if MA1Type == "TEMA"-                            e = ema(MA1Source, MA1Period)+                            e = ta.ema(MA1Source, MA1Period)-                            3 * (e - ema(e, MA1Period)) + ema(ema(e, MA1Period), MA1Period)+                            3 * (e - ta.ema(e, MA1Period)) + ta.ema(ta.ema(e, MA1Period), MA1Period)                    MA2 = if MA2Type == "SMA"-    sma(MA2Source, MA2Period)+    ta.sma(MA2Source, MA2Period)else    if MA2Type == "EMA"-        ema(MA2Source, MA2Period)+        ta.ema(MA2Source, MA2Period)    else        if MA2Type == "WMA"-            wma(MA2Source, MA2Period)+            ta.wma(MA2Source, MA2Period)        else            if MA2Type == "RMA"-                rma(MA2Source, MA2Period)+                ta.rma(MA2Source, MA2Period)            else                if MA2Type == "HMA"-                    wma(2*wma(MA2Source, MA2Period/2)-wma(MA2Source, MA2Period), round(sqrt(MA2Period)))+                    ta.wma(2*ta.wma(MA2Source, MA2Period/2)-ta.wma(MA2Source, MA2Period), math.round(math.sqrt(MA2Period)))                else                    if MA2Type == "DEMA"-                        e = ema(MA2Source, MA2Period)+                        e = ta.ema(MA2Source, MA2Period)-                        2 * e - ema(e, MA2Period)+                        2 * e - ta.ema(e, MA2Period)                    else                        if MA2Type == "TEMA"-                            e = ema(MA2Source, MA2Period)+                            e = ta.ema(MA2Source, MA2Period)-                            3 * (e - ema(e, MA2Period)) + ema(ema(e, MA2Period), MA2Period)+                            3 * (e - ta.ema(e, MA2Period)) + ta.ema(ta.ema(e, MA2Period), MA2Period)                    MA3 = if MA3Type == "SMA"-    sma(MA3Source, MA3Period)+    ta.sma(MA3Source, MA3Period)else    if MA3Type == "EMA"-        ema(MA3Source, MA3Period)+        ta.ema(MA3Source, MA3Period)    else        if MA3Type == "WMA"-            wma(MA3Source, MA3Period)+            ta.wma(MA3Source, MA3Period)        else            if MA3Type == "RMA"-                rma(MA3Source, MA3Period)+                ta.rma(MA3Source, MA3Period)            else                if MA3Type == "HMA"-                    wma(2*wma(MA3Source, MA3Period/2)-wma(MA3Source, MA3Period), round(sqrt(MA3Period)))+                    ta.wma(2*ta.wma(MA3Source, MA3Period/2)-ta.wma(MA3Source, MA3Period), math.round(math.sqrt(MA3Period)))                else                    if MA3Type == "DEMA"-                        e = ema(MA3Source, MA3Period)+                        e = ta.ema(MA3Source, MA3Period)-                        2 * e - ema(e, MA3Period)+                        2 * e - ta.ema(e, MA3Period)                    else                        if MA3Type == "TEMA"-                            e = ema(MA3Source, MA3Period)+                            e = ta.ema(MA3Source, MA3Period)-                            3 * (e - ema(e, MA3Period)) + ema(ema(e, MA3Period), MA3Period)+                            3 * (e - ta.ema(e, MA3Period)) + ta.ema(ta.ema(e, MA3Period), MA3Period)                    ⋯p3 = plot(MA3Visible ? MA3 : na, color=color.red, linewidth=2)-fill(p1, p2, color.silver, transp=80, title="Fill")+fill(p1, p2, color.new(color.silver, 80), title="Fill")start = timestamp(2019, 1, 1, 1, 0)⋯if time >= start and time <= end-    longCondition = crossover(MA1, MA2) and close > MA3+    longCondition = ta.crossover(MA1, MA2) and close > MA3    if (longCondition)⋯        -    shortCondition = crossunder(MA1, MA2) and close < MA3+    shortCondition = ta.crossunder(MA1, MA2) and close < MA3    if (shortCondition)⋯

Clean v5

VerifiedDownload the v5 script

Same 4 trades and the same P&L on BNBUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 5: input() → input.int()
  • Line 6: input() → input.string()
  • Line 9: input() → input.int()
  • Line 10: input() → input.string()
  • Line 13: input() → input.int()
  • Line 14: input() → input.string()
⋯strategy("Custom MA Strategy Tester", overlay = true)-MA1Period = input(13, title="MA1 Period")+MA1Period = input.int(13, title="MA1 Period")-MA1Type = input(title="MA1 Type", defval="SMA", options=["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"])+MA1Type = input.string(title="MA1 Type", defval="SMA", options=["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"])MA1Source = input.source(title="MA1 Source", defval=close)MA1Visible = input.bool(title="MA1 Visible", defval=true)-MA2Period = input(50, title="MA2 Period")+MA2Period = input.int(50, title="MA2 Period")-MA2Type = input(title="MA2 Type", defval="SMA", options=["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"])+MA2Type = input.string(title="MA2 Type", defval="SMA", options=["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"])MA2Source = input.source(title="MA2 Source", defval=close)MA2Visible = input.bool(title="MA2 Visible", defval=true) -MA3Period = input(200, title="MA3 Period")+MA3Period = input.int(200, title="MA3 Period")-MA3Type = input(title="MA3 Type", defval="SMA", options=["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"])+MA3Type = input.string(title="MA3 Type", defval="SMA", options=["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"])MA3Source = input.source(title="MA3 Source", defval=close)⋯

Does it run in Pine Script v6?

No

The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 4 before, 3 after on BNBUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © Meesemoo-//@version=5+//@version=6strategy("Custom MA Strategy Tester", overlay = true)⋯

Settings

Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.

SettingDefaultType and rangeFeeds
MA1 Period13intMA1 e
MA1 TypeSMAstring · options ["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"]MA1
MA1 SourceclosesourceMA1 e
MA1 Visibletrueboolp1 plot
MA2 Period50intMA2 e
MA2 TypeSMAstring · options ["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"]MA2
MA2 SourceclosesourceMA2 e
MA2 Visibletrueboolp2 plot
MA3 Period200inte MA3
MA3 TypeSMAstring · options ["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"]MA3
MA3 Sourceclosesourcee MA3
MA3 Visibletrueboolp3 plot
Show Crossestrueboolunused

What it calculates

  • EMA (ema, ta.ema in v5)MA3 Source (close), MA3 Period (200)e · line 84

Signal flow

How price data and settings reach the orders. Each box is a name in the script, or several computed the same way; each arrow is a value one of them reads. Hover a box for its members.

closecloseprice dataMA3PeriodMA3 Periodsetting · 200MA1TypeMA1 Typesetting · SMAMA1PeriodMA1 Periodsetting · 13MA2TypeMA2 Typesetting · SMAMA2PeriodMA2 Periodsetting · 50MA3TypeMA3 Typesetting · SMAeEMA→ elongConditionlongConditionconditionshortConditionshortConditionconditionMA1MA1conditionMA2MA2conditionMA3MA3conditionentry:LongOpen Longstrategy.entryentry:ShortOpen Shortstrategy.entryplot:87plotplotplot:88plotplotplot:89plotplotfill:FillFillfill

Order rules

OrderFires whenBy defaultLine
Open Long long(longCondition)On96
Open Short short(shortCondition)On100

Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.

Does it repaint?

No

No repainting patterns in the source.

Not measuredNo trades to compareThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, but neither the live nor the historical run produced any trades in them, so the replay says nothing either way.
  • ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • ClearIntrabar recalculationNo varip, calc_on_every_tick or realtime-only state. Orders are decided once per closed bar.
  • ClearOrder timingOrders fill at the next bar's open, after the signal bar has closed.

The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.

Other markets

The same script with default settings on 8 Binance markets. Each row is a separate backtest over the most recent 1,000 bars.

MarketNetBuy and holdTradesWonProfit factorMax drawdownPeriod
BTCUSDT 1D0.0%+102.5%00%—0.0%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h0.0%+5.5%00%—0.0%8 May 2026 – 21 Oct 2026
ETHUSDT 1D0.0%+9.8%00%—2.6%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h0.0%+8.4%00%—0.0%8 May 2026 – 21 Oct 2026
SOLUSDT 1D0.0%+16.7%00%—0.1%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h0.0%+21.5%00%—0.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−0.1%+148.3%40%0.000.2%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h0.0%+17.1%00%—0.0%8 May 2026 – 21 Oct 2026

Backtests are simulations on historical data and are not investment advice.

Settings heatmap

Two settings that feed the entry signal, moved around their defaults. The best in-sample pair (MA1 Period 7, MA2 Period 35) made 0.0% before 26 Dec 2025 and 0.0% after it, against 0.0% for the defaults. 0% of the 64 combinations made money in-sample and 0% out-of-sample.

Before 26 Dec 2025 · in-sample
MA2 Period ↓ · MA1 Period →7891113161822
25−17%−17%−14%−16%−19%−24%−24%−9%
30−17%−13%−16%−9%−11%−14%−14%−13%
350%0%0%0%−12%0%−7%−5%
430%0%0%0%0%0%−4%−6%
50−5%0%0%0%0%0%0%−7%
60−5%0%0%0%0%0%0%−7%
700%0%0%0%0%0%0%0%
850%0%0%0%0%0%0%0%
From 26 Dec 2025 · out-of-sample
MA2 Period ↓ · MA1 Period →7891113161822
250%0%0%0%0%0%0%0%
300%0%0%0%0%0%0%0%
350%0%0%0%0%0%0%0%
430%0%0%0%0%0%0%0%
500%0%0%0%0%0%0%0%
600%0%0%0%0%0%0%0%
700%0%0%0%0%0%0%0%
850%0%0%0%0%0%0%0%

Net P&L of trades opened in each period, as a share of starting capital. marks the defaults and the best in-sample cell. Hover a cell for its trade count. Backtests are simulations on historical data and are not investment advice.

Similar scripts

Indicators and strategies built from the same calculations, run on BTCUSDT 1D with their own defaults so they can be compared directly.

ScriptSharesTypeNetTradesMax drawdown
Custom Triple Moving Average Strategy - Auto Backtesting this page—v4 strategy0.0%00.0%
EMA Slope AyE by fajardoarelysemav4 strategyNo trades on this market
ROoT by realisticDove62527emav5 strategy−4.7%2259.4%
sachin5986 by mohitesachin78emav4 strategy+32.1%3517.6%
sonu1997 by Sonu1997emav4 strategy+960.7%21,103.8%
Moving Average Crossover by Muh4mm4demav4 strategy+19,990.1%301,274.2%

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 21 msYes 1,000 bars in 40 msNot measured
PineTSNo v5 and v6 only—Not measured

“Matches TradingView” needs this script's own output exported from TradingView and compared bar by bar, which has not been done for this script. The engine is built on OpenPineScript, whose conformance results are in its conformance report. PineTS runs Pine Script v5 and v6 only.

Source

Copied verbatim from the author's published script, with its licence header intact. The author may have updated the original since this snapshot.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © Meesemoo//@version=4strategy("Custom MA Strategy Tester", overlay = true)MA1Period = input(13, title="MA1 Period")MA1Type = input(title="MA1 Type", defval="SMA", options=["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"])MA1Source = input(title="MA1 Source", type=input.source, defval=close)MA1Visible = input(title="MA1 Visible", type=input.bool, defval=true)MA2Period = input(50, title="MA2 Period")MA2Type = input(title="MA2 Type", defval="SMA", options=["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"])MA2Source = input(title="MA2 Source", type=input.source, defval=close)MA2Visible = input(title="MA2 Visible", type=input.bool, defval=true) MA3Period = input(200, title="MA3 Period")MA3Type = input(title="MA3 Type", defval="SMA", options=["RMA", "SMA", "EMA", "WMA", "HMA", "DEMA", "TEMA"])MA3Source = input(title="MA3 Source", type=input.source, defval=close)MA3Visible = input(title="MA3 Visible", type=input.bool, defval=true)ShowCrosses = input(title="Show Crosses", type=input.bool, defval=true)MA1 = if MA1Type == "SMA"    sma(MA1Source, MA1Period)else    if MA1Type == "EMA"        ema(MA1Source, MA1Period)    else        if MA1Type == "WMA"            wma(MA1Source, MA1Period)        else            if MA1Type == "RMA"                rma(MA1Source, MA1Period)            else                if MA1Type == "HMA"                    wma(2*wma(MA1Source, MA1Period/2)-wma(MA1Source, MA1Period), round(sqrt(MA1Period)))                else                    if MA1Type == "DEMA"                        e = ema(MA1Source, MA1Period)                        2 * e - ema(e, MA1Period)                    else                        if MA1Type == "TEMA"                            e = ema(MA1Source, MA1Period)                            3 * (e - ema(e, MA1Period)) + ema(ema(e, MA1Period), MA1Period)                    MA2 = if MA2Type == "SMA"    sma(MA2Source, MA2Period)else    if MA2Type == "EMA"        ema(MA2Source, MA2Period)    else        if MA2Type == "WMA"            wma(MA2Source, MA2Period)        else            if MA2Type == "RMA"                rma(MA2Source, MA2Period)            else                if MA2Type == "HMA"                    wma(2*wma(MA2Source, MA2Period/2)-wma(MA2Source, MA2Period), round(sqrt(MA2Period)))                else                    if MA2Type == "DEMA"                        e = ema(MA2Source, MA2Period)                        2 * e - ema(e, MA2Period)                    else                        if MA2Type == "TEMA"                            e = ema(MA2Source, MA2Period)                            3 * (e - ema(e, MA2Period)) + ema(ema(e, MA2Period), MA2Period)                    MA3 = if MA3Type == "SMA"    sma(MA3Source, MA3Period)else    if MA3Type == "EMA"        ema(MA3Source, MA3Period)    else        if MA3Type == "WMA"            wma(MA3Source, MA3Period)        else            if MA3Type == "RMA"                rma(MA3Source, MA3Period)            else                if MA3Type == "HMA"                    wma(2*wma(MA3Source, MA3Period/2)-wma(MA3Source, MA3Period), round(sqrt(MA3Period)))                else                    if MA3Type == "DEMA"                        e = ema(MA3Source, MA3Period)                        2 * e - ema(e, MA3Period)                    else                        if MA3Type == "TEMA"                            e = ema(MA3Source, MA3Period)                            3 * (e - ema(e, MA3Period)) + ema(ema(e, MA3Period), MA3Period)                    p1 = plot(MA1Visible ? MA1 : na, color=color.green, linewidth=1)p2 = plot(MA2Visible ? MA2 : na, color=color.yellow, linewidth=1)p3 = plot(MA3Visible ? MA3 : na, color=color.red, linewidth=2)fill(p1, p2, color.silver, transp=80, title="Fill")start = timestamp(2019, 1, 1, 1, 0)end = timestamp(2025, 1, 1, 1, 0)if time >= start and time <= end    longCondition = crossover(MA1, MA2) and close > MA3    if (longCondition)        strategy.entry("Long", strategy.long)            shortCondition = crossunder(MA1, MA2) and close < MA3    if (shortCondition)        strategy.entry("Short", strategy.short)