Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Fibonacci Moving Averages Input

A Pine Script v5 strategy built on EMA or SMA (ohlc4, 34). 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. 55 settings; defaults include source ohlc4, long 34 and crossover 144.

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 Fibonacci Moving Averages Input repaint?
No
No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
How did Fibonacci Moving Averages Input do on BTCUSDT 1D with default settings?
+4.35%
From 26 Jan 2024 to 21 Oct 2026, over 5 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does Fibonacci Moving Averages Input 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: 5 before, 7 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download.
Does Fibonacci Moving Averages Input use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Fibonacci Moving Averages Input run in Zeal Terminal?
Yes
It compiles in 55 ms and runs 1,000 bars in 281 ms, in the browser.

BTCUSDT · 1D · default settings

  • 1
  • 2
  • 3
  • 5
  • 8
  • 13
  • 21
  • 34
  • 55
  • 89
  • 144
  • 233
  • 377
  • 610
  • 987
  • 50
Prerendered with the defaults. Change anything and run it here. The script runs in your browser.
Settings (55)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$1,050,390$2,025,273Equity from $1,000,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
+4.35%
$43,540.90
Buy and hold
+102.5%
same period
Closed trades
5
3 won · 2 lost
Profitable
60.0%
of closed trades
Profit factor
3.11
gross profit ÷ gross loss
Max drawdown
2.25%
−$22,547.20

One run with the author's default settings, $1,000,000 starting capital, commission as the script sets it. A long position was still open at the last bar. 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

    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.

Settings

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

SettingDefaultType and rangeFeeds
sourceohlc4sourcelong1 long2 short1 short2 out11 out18 out13 out9 out8 out7 out out2 out3 out4 out5 out6 out10 out14 out15 out16 out17 out19 ma50 ma100 ma150 ma200
longSignal Moving average long input34int · min 1long1
crossover EMA or SMAEMA checked or SMA uncheckedtrueboollong2
crossoverCrossed over Moving average long input144int · min 1long2
short EMA or SMAEMA checked or SMA uncheckedtrueboolshort1
shortSignal Moving average short input55int · min 1short1
crossunder EMA or SMAEMA checked or SMA uncheckedfalseboolshort2
crossunderCrossed under Moving average short input144int · min 1short2
MA1truebool1
ma Length1int · min 1out11
MA2truebool2
ma Length2int · min 1out18
MA3truebool3
ma Length3int · min 1out13
MA5truebool5
ma Length5int · min 1out9
MA8truebool8
ma Length8int · min 1out8
MA13truebool13
ma Length13int · min 1out7
MA21truebool21
ma Length21int · min 1out
MA34truebool34
ma Length34int · min 1out2
MA55truebool55
ma Length55int · min 1out3
MA89truebool89
ma Length89int · min 1out4
MA144truebool144
ma Length144int · min 1out5
MA233truebool233
ma Length233int · min 1out6
MA377truebool377
ma Length377int · min 1out10
MA610truebool610
ma Length610int · min 1out14
MA987truebool987
ma Length987int · min 1out15
MA1597truebool1597
ma Length1597int · min 1out16
MA2584truebool2584
ma Length2584int · min 1out17
MA4181truebool4181
ma Length4181int · min 1out19
MA50truebool50
ma Length50int · min 1ma50
MA100truebool100
ma Length100int · min 1ma100
MA150truebool150
ma Length150int · min 1ma150
MA200truebool200
ma Length200int · min 1ma200
Long or Short Settings
long EMA or SMAEMA checked or SMA uncheckedtrueboollong1
Visual FibMA Settings
Fib EMA or SMAEMA checked or SMA uncheckedtrueboolout11 out18 out13 out9 out8 out7 out out2 out3 out4 out5 out6 out10 out14 out15 out16 out17 out19
Visual MA Settings
EMA or SMAEMA checked or SMA uncheckedfalseboolma50 ma100 ma150 ma200

What it calculates

  • EMA / SMAsource (ohlc4), long (34)long1 · line 14
  • EMA / SMAsource (ohlc4), crossover (144)long2 · line 17
  • EMA / SMAsource (ohlc4), short (55)short1 · line 20
  • EMA / SMAsource (ohlc4), crossunder (144)short2 · line 23
  • EMA / SMAsource (ohlc4), ma Length (1)out11 · line 30
  • EMA / SMAsource (ohlc4), ma Length (2)out18 · line 37
  • EMA / SMAsource (ohlc4), ma Length (3)out13 · line 44
  • EMA / SMAsource (ohlc4), ma Length (5)out9 · line 51
  • EMA / SMAsource (ohlc4), ma Length (8)out8 · line 58
  • EMA / SMAsource (ohlc4), ma Length (13)out7 · line 65
  • EMA / SMAsource (ohlc4), ma Length (21)out · line 72
  • EMA / SMAsource (ohlc4), ma Length (34)out2 · line 79
  • EMA / SMAsource (ohlc4), ma Length (55)out3 · line 86
  • EMA / SMAsource (ohlc4), ma Length (89)out4 · line 93
  • EMA / SMAsource (ohlc4), ma Length (144)out5 · line 100
  • EMA / SMAsource (ohlc4), ma Length (233)out6 · line 107
  • EMA / SMAsource (ohlc4), ma Length (377)out10 · line 114
  • EMA / SMAsource (ohlc4), ma Length (610)out14 · line 121
  • EMA / SMAsource (ohlc4), ma Length (987)out15 · line 128
  • EMA / SMAsource (ohlc4), ma Length (1597)out16 · line 135
  • EMA / SMAsource (ohlc4), ma Length (2584)out17 · line 142
  • EMA / SMAsource (ohlc4), ma Length (4181)out19 · line 149
  • EMA / SMAsource (ohlc4), ma Length (50)ma50 · line 159
  • EMA / SMAsource (ohlc4), ma Length (100)ma100 · line 166
  • EMA / SMAsource (ohlc4), ma Length (150)ma150 · line 173
  • EMA / SMAsource (ohlc4), ma Length (200)ma200 · line 180

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.

The script has 100 named inputs, calculations, conditions and outputs, too many to draw legibly here; the tables above list them.

Order rules

OrderFires whenBy defaultLine
Open maL long(ta.crossover(long1, long2))On187
Open maS short(ta.crossunder(short1, short2))On189

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 1D+4.4%+102.5%560%3.112.3%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+0.2%+5.5%520%1.241.0%8 May 2026 – 21 Oct 2026
ETHUSDT 1D+0.1%+9.8%560%3.380.1%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+0.0%+8.4%1100%—0.1%8 May 2026 – 21 Oct 2026
SOLUSDT 1D−0.0%+16.7%729%0.590.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+0.0%+21.5%367%8.050.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+0.0%+148.3%580%18.130.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+0.0%+17.1%2100%—0.0%8 May 2026 – 21 Oct 2026

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

The trades

By market direction

At entry, last 90 barsTradesWonP&L
Rising market0—$0.00
Sideways market3100%$64,141.10
Falling market20%−$20,600.20

Rising and falling mean the market moved more than 15% over the 90 bars before entry.

How bad could the drawdown be?

2.0%

The 95th percentile of the worst drawdown when the same 5 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 1.3% to 2.0%; the tick is what actually happened, 1.3%. Order luck alone moves it this much.

0%2%
All 5 trades
SideEntryExitBarsP&L
short6 Jul 2024 56,628.8018 Jul 2024 64,088.0012−$7,459.20
long18 Jul 2024 64,088.0014 Mar 2025 81,115.80239$17,027.80
short14 Mar 2025 81,115.8030 Apr 2025 94,256.8047−$13,141.00
long30 Apr 2025 94,256.801 Nov 2025 109,608.00185$15,351.20
short1 Nov 2025 109,608.0029 Aug 2026 77,845.90301$31,762.10

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
Fibonacci Moving Averages Input this page—v5 strategy+4.4%52.3%
MACD Long Strat by TheGrindTodayema smav4 strategy+24.0%7920.1%
Stock trending strategy by exlux99ema smav4 strategy+35.3%2114.7%
4-Hour Stochastic EMA Trend by slymnturkogluema smav4 strategyNo trades on this market
4X EMA and volume strategy by SoftKill21ema smav4 strategy+1.8%325.8%
Simple Momentum Strategy Based on SMA, EMA and Volume by slip_streamsma emav4 strategy+7.4%1827.4%

Upgrade and export

Written in Pine Script v5. The clean-v5 step types the settings and moves when = into if blocks, which v6 requires; it is run before and after like any upgrade.

  • 29 settings use the untyped input() (line 9, 12, 15, 18, 21, 26, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, 98, 105, 112, 119, 126, 133, 140, 147, 156, 157, 164, 171, 178). It still compiles in v6; input.int, input.float or input.source state the type.
  • No v6-only features. v6 is not needed to run this script.

Clean v5

VerifiedDownload the v5 script

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

  • Line 9: input() → input.source()
  • Line 12: input() → input.bool()
  • Line 15: input() → input.bool()
  • Line 18: input() → input.bool()
  • Line 21: input() → input.bool()
  • Line 26: input() → input.bool()
23 more edits
  • Line 28: input() → input.bool()
  • Line 35: input() → input.bool()
  • Line 42: input() → input.bool()
  • Line 49: input() → input.bool()
  • Line 56: input() → input.bool()
  • Line 63: input() → input.bool()
  • Line 70: input() → input.bool()
  • Line 77: input() → input.bool()
  • Line 84: input() → input.bool()
  • Line 91: input() → input.bool()
  • Line 98: input() → input.bool()
  • Line 105: input() → input.bool()
  • Line 112: input() → input.bool()
  • Line 119: input() → input.bool()
  • Line 126: input() → input.bool()
  • Line 133: input() → input.bool()
  • Line 140: input() → input.bool()
  • Line 147: input() → input.bool()
  • Line 156: input() → input.bool()
  • Line 157: input() → input.bool()
  • Line 164: input() → input.bool()
  • Line 171: input() → input.bool()
  • Line 178: input() → input.bool()
⋯strategy(title="Fibonacci Moving Averages Input", shorttitle = "FibMAI", overlay=true)-src = input(ohlc4, 'source')+src = input.source(ohlc4, 'source')//string  GRP = "Long or Short Settings"-exponential1 = input(true, title="long EMA or SMA", tooltip="EMA checked or SMA unchecked", group = GRP)+exponential1 = input.bool(true, title="long EMA or SMA", tooltip="EMA checked or SMA unchecked", group = GRP)long = input.int(34, minval=1, title="long", tooltip="Signal Moving average long input")long1 = exponential1 ? ta.ema(src, long) : ta.sma(src, long)-exponential2 = input(true, title="crossover EMA or SMA", tooltip="EMA checked or SMA unchecked")+exponential2 = input.bool(true, title="crossover EMA or SMA", tooltip="EMA checked or SMA unchecked")longer = input.int(144, minval=1, title="crossover", tooltip="Crossed over Moving average long input")long2 = exponential2 ? ta.ema(src, longer) : ta.sma(src, longer)-exponential3 = input(true, title="short EMA or SMA", tooltip="EMA checked or SMA unchecked")+exponential3 = input.bool(true, title="short EMA or SMA", tooltip="EMA checked or SMA unchecked")short = input.int(55, minval=1, title="short", tooltip="Signal Moving average short input")short1 = exponential3 ? ta.ema(src, short) : ta.sma(src, short)-exponential4 = input(false, title="crossunder EMA or SMA", tooltip="EMA checked or SMA unchecked")+exponential4 = input.bool(false, title="crossunder EMA or SMA", tooltip="EMA checked or SMA unchecked")shorter = input.int(144, minval=1, title="crossunder", tooltip="Crossed under Moving average short input")⋯string  GRP2 = "Visual FibMA Settings"-exponential = input(true, title="Fib EMA or SMA", tooltip="EMA checked or SMA unchecked", group = GRP2)+exponential = input.bool(true, title="Fib EMA or SMA", tooltip="EMA checked or SMA unchecked", group = GRP2)//-smaplot11 = input (true, title="MA1")+smaplot11 = input.bool (true, title="MA1")len11 = input.int(1, minval=1, title="ma Length")⋯plot(out11 and smaplot11 ? out11 :na, title="1", color=mycolor11, linewidth=1)-smaplot18 = input (true, title="MA2")+smaplot18 = input.bool (true, title="MA2")len18 = input.int(2, minval=1, title="ma Length")⋯plot(out18 and smaplot18 ? out18 :na , title="2", color=mycolor18, linewidth=1)-smaplot13 = input (true, title="MA3")+smaplot13 = input.bool (true, title="MA3")len13 = input.int(3, minval=1, title="ma Length")⋯plot(out13 and smaplot13 ? out13 :na , title="3", color=mycolor11, linewidth=1)-smaplot9 = input (true, title="MA5")+smaplot9 = input.bool (true, title="MA5")len9 = input.int(5, minval=1, title="ma Length")⋯plot(out9 and smaplot9 ? out9 :na , title="5", color=mycolor9, linewidth=1)-smaplot8 = input (true, title="MA8")+smaplot8 = input.bool (true, title="MA8")len8 = input.int(8, minval=1, title="ma Length")⋯plot(out8 and smaplot8 ? out8 :na , title="8", color=mycolor8, linewidth=1)-smaplot7 = input (true, title="MA13")+smaplot7 = input.bool (true, title="MA13")len7 = input.int(13, minval=1, title="ma Length")⋯plot(out7 and smaplot7 ? out7 :na , title="13", color=mycolor7, linewidth=1)-smaplot = input (true, title="MA21")+smaplot = input.bool (true, title="MA21")len = input.int(21, minval=1, title="ma Length")⋯plot(out and smaplot ? out :na, title="21", color=mycolor, linewidth=1)-smaplot2 = input (true, title="MA34")+smaplot2 = input.bool (true, title="MA34")len2 = input.int(34, minval=1, title="ma Length")⋯plot(out2 and smaplot2 ? out2 :na , title="34", color=mycolor2, linewidth=1)-smaplot3 = input (true, title="MA55")+smaplot3 = input.bool (true, title="MA55")len3 = input.int(55, minval=1, title="ma Length")⋯plot(out3 and smaplot3 ? out3 :na, title="55", color=mycolor3, linewidth=1)-smaplot4 = input (true, title="MA89")+smaplot4 = input.bool (true, title="MA89")len4 = input.int(89, minval=1, title="ma Length")⋯plot(out4 and smaplot4 ? out4 :na , title="89", color=mycolor4, linewidth=1)-smaplot5 = input (true, title="MA144")+smaplot5 = input.bool (true, title="MA144")len5 = input.int(144, minval=1, title="ma Length")⋯plot(out5 and smaplot5 ? out5 :na, title="144", color=mycolor5, linewidth=1)-smaplot6 = input (true, title="MA233")+smaplot6 = input.bool (true, title="MA233")len6 = input.int(233, minval=1, title="ma Length")⋯plot(out6 and smaplot6 ? out6 :na , title="233", color=mycolor6, linewidth=1)-smaplot10 = input (true, title="MA377")+smaplot10 = input.bool (true, title="MA377")len10 = input.int(377, minval=1, title="ma Length")⋯plot(out10 and smaplot10 ? out10 :na , title="377", color=mycolor10, linewidth=1)-smaplot14 = input (true, title="MA610")+smaplot14 = input.bool (true, title="MA610")len14 = input.int(610, minval=1, title="ma Length")⋯plot(out14 and smaplot14 ? out14 :na , title="610", color=mycolor14, linewidth=1)-smaplot15 = input (true, title="MA987")+smaplot15 = input.bool (true, title="MA987")len15 = input.int(987, minval=1, title="ma Length")⋯plot(out15 and smaplot15 ? out15 :na , title="987", color=mycolor15, linewidth=1)-smaplot16 = input (true, title="MA1597")+smaplot16 = input.bool (true, title="MA1597")len16 = input.int(1597, minval=1, title="ma Length")⋯plot(out16 and smaplot16 ? out16 :na , title="1597", color=mycolor16, linewidth=1)-smaplot17 = input (true, title="MA2584")+smaplot17 = input.bool (true, title="MA2584")len17 = input.int(2584, minval=1, title="ma Length")⋯plot(out17 and smaplot17 ? out17 :na , title="2584", color=mycolor17, linewidth=1)-smaplot19 = input (true, title="MA4181")+smaplot19 = input.bool (true, title="MA4181")len19 = input.int(4181, minval=1, title="ma Length")⋯string  GRP3 = "Visual MA Settings"-exponential5 = input(false, title="EMA or SMA", tooltip="EMA checked or SMA unchecked", group = GRP3)+exponential5 = input.bool(false, title="EMA or SMA", tooltip="EMA checked or SMA unchecked", group = GRP3)-smaplot50 = input (true, title="MA50")+smaplot50 = input.bool (true, title="MA50")len50 = input.int(50, minval=1, title="ma Length")⋯plot(ma50 and smaplot50 ? ma50 :na , title="50", color=mycolor50, linewidth=1)-smaplot100 = input (true, title="MA100")+smaplot100 = input.bool (true, title="MA100")len100 = input.int(100, minval=1, title="ma Length")⋯plot(ma100 and smaplot100 ? ma100 :na , title="100", color=mycolor100, linewidth=1)-smaplot150 = input (true, title="MA150")+smaplot150 = input.bool (true, title="MA150")len150 = input.int(150, minval=1, title="ma Length")⋯plot(ma150 and smaplot150 ? ma150 :na , title="150", color=mycolor150, linewidth=1)-smaplot200 = input (true, title="MA200")+smaplot200 = input.bool (true, title="MA200")len200 = input.int(200, minval=1, title="ma Length")⋯

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: 5 before, 7 after on BTCUSDT 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.

-//@version=5+//@version=6// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 55 msYes 1,000 bars in 281 msNot measured
PineTSNot testedNot testedNot 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.

Source

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

//@version=5// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © Options360 : Fibonacci MAI (Moving Averages Input) beta 10/15/22// © Options360 original public release = 2/25/23// * This script uses altered pieces of code from my @Options360 "Fibonacci MA7" indicator*// 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811////strategy(title="Fibonacci Moving Averages Input", shorttitle = "FibMAI", overlay=true)src = input(ohlc4, 'source')//string  GRP = "Long or Short Settings"exponential1 = input(true, title="long EMA or SMA", tooltip="EMA checked or SMA unchecked", group = GRP)long = input.int(34, minval=1, title="long", tooltip="Signal Moving average long input")long1 = exponential1 ? ta.ema(src, long) : ta.sma(src, long)exponential2 = input(true, title="crossover EMA or SMA", tooltip="EMA checked or SMA unchecked")longer = input.int(144, minval=1, title="crossover", tooltip="Crossed over Moving average long input")long2 = exponential2 ? ta.ema(src, longer) : ta.sma(src, longer)exponential3 = input(true, title="short EMA or SMA", tooltip="EMA checked or SMA unchecked")short = input.int(55, minval=1, title="short", tooltip="Signal Moving average short input")short1 = exponential3 ? ta.ema(src, short) : ta.sma(src, short)exponential4 = input(false, title="crossunder EMA or SMA", tooltip="EMA checked or SMA unchecked")shorter = input.int(144, minval=1, title="crossunder", tooltip="Crossed under Moving average short input")short2 = exponential4 ? ta.ema(src, shorter) : ta.sma(src, shorter)//string  GRP2 = "Visual FibMA Settings"exponential = input(true, title="Fib EMA or SMA", tooltip="EMA checked or SMA unchecked", group = GRP2)//smaplot11 = input (true, title="MA1")len11 = input.int(1, minval=1, title="ma Length")out11 = exponential ? ta.ema(src, len11) : ta.sma(src, len11)up11 = out11 > out11[1]down11 = out11 < out11[1]mycolor11 = up11 ? #3cfe12 : down11 ? #ff0202 : #008effplot(out11 and smaplot11 ? out11 :na, title="1", color=mycolor11, linewidth=1)smaplot18 = input (true, title="MA2")len18 = input.int(2, minval=1, title="ma Length")out18 = exponential ? ta.ema(src, len18) : ta.sma(src, len18)up18 = out18 > out18[1]down18 = out18 < out18[1]mycolor18 = up18 ? #3cfe12 : down18 ? #ff0202 : #008effplot(out18 and smaplot18 ? out18 :na , title="2", color=mycolor18, linewidth=1)smaplot13 = input (true, title="MA3")len13 = input.int(3, minval=1, title="ma Length")out13 = exponential ? ta.ema(src, len13) : ta.sma(src, len13)up13 = out13 > out13[1]down13 = out13 < out13[1]mycolor13 = up13 ? #3cfe12 : down13 ? #ff0202 : #008effplot(out13 and smaplot13 ? out13 :na , title="3", color=mycolor11, linewidth=1)smaplot9 = input (true, title="MA5")len9 = input.int(5, minval=1, title="ma Length")out9 = exponential ? ta.ema(src, len9) : ta.sma(src, len9)up9 = out9 > out9[1]down9 = out9 < out9[1]mycolor9 = up9 ? #3cfe12 : down9 ? #ff0202 : #008effplot(out9 and smaplot9 ? out9 :na , title="5", color=mycolor9, linewidth=1)smaplot8 = input (true, title="MA8")len8 = input.int(8, minval=1, title="ma Length")out8 = exponential ? ta.ema(src, len8) : ta.sma(src, len8)up8 = out8 > out8[1]down8 = out8 < out8[1]mycolor8 = up8 ? #3cfe12 : down8 ? #ff0202 : #008effplot(out8 and smaplot8 ? out8 :na , title="8", color=mycolor8, linewidth=1)smaplot7 = input (true, title="MA13")len7 = input.int(13, minval=1, title="ma Length")out7 = exponential ? ta.ema(src, len7) : ta.sma(src, len7)up7 = out7 > out7[1]down7 = out7 < out7[1]mycolor7 = up7 ? #3cfe12 : down7 ? #ff0202 : #008effplot(out7 and smaplot7 ? out7 :na , title="13", color=mycolor7, linewidth=1)smaplot = input (true, title="MA21")len = input.int(21, minval=1, title="ma Length")out = exponential ? ta.ema(src, len) : ta.sma(src, len)up = out > out[1]down = out < out[1]mycolor = up ? #3cfe12 : down ? #ff0202 : #008effplot(out and smaplot ? out :na, title="21", color=mycolor, linewidth=1)smaplot2 = input (true, title="MA34")len2 = input.int(34, minval=1, title="ma Length")out2 = exponential ? ta.ema(src, len2) : ta.sma(src, len2)up2 = out2 > out2[1]down2 = out2 < out2[1]mycolor2 = up2 ? #3cfe12 : down2 ? #ff0202 : #008effplot(out2 and smaplot2 ? out2 :na , title="34", color=mycolor2, linewidth=1)smaplot3 = input (true, title="MA55")len3 = input.int(55, minval=1, title="ma Length")out3 = exponential ? ta.ema(src, len3) : ta.sma(src, len3)up3 = out3 > out3[1]down3 = out3 < out3[1]mycolor3 = up3 ? #3cfe12 : down3 ? #ff0202 : #008effplot(out3 and smaplot3 ? out3 :na, title="55", color=mycolor3, linewidth=1)smaplot4 = input (true, title="MA89")len4 = input.int(89, minval=1, title="ma Length")out4 = exponential ? ta.ema(src, len4) : ta.sma(src, len4)up4 = out4 > out4[1]down4 = out4 < out4[1]mycolor4 = up4 ? #3cfe12 : down4 ? #ff0202 : #008effplot(out4 and smaplot4 ? out4 :na , title="89", color=mycolor4, linewidth=1)smaplot5 = input (true, title="MA144")len5 = input.int(144, minval=1, title="ma Length")out5 = exponential ? ta.ema(src, len5) : ta.sma(src, len5)up5 = out5 > out5[1]down5 = out5 < out5[1]mycolor5 = up5 ? #3cfe12 : down5 ? #ff0202 : #008effplot(out5 and smaplot5 ? out5 :na, title="144", color=mycolor5, linewidth=1)smaplot6 = input (true, title="MA233")len6 = input.int(233, minval=1, title="ma Length")out6 = exponential ? ta.ema(src, len6) : ta.sma(src, len6)up6 = out6 > out6[1]down6 = out6 < out6[1]mycolor6 = up6 ? #3cfe12 : down6 ? #ff0202 : #008effplot(out6 and smaplot6 ? out6 :na , title="233", color=mycolor6, linewidth=1)smaplot10 = input (true, title="MA377")len10 = input.int(377, minval=1, title="ma Length")out10 = exponential ? ta.ema(src, len10) : ta.sma(src, len10)up10 = out10 > out10[1]down10 = out10 < out10[1]mycolor10 = up10 ? #3cfe12 : down10 ? #ff0202 : #008effplot(out10 and smaplot10 ? out10 :na , title="377", color=mycolor10, linewidth=1)smaplot14 = input (true, title="MA610")len14 = input.int(610, minval=1, title="ma Length")out14 = exponential ? ta.ema(src, len14) : ta.sma(src, len14)up14 = out14 > out14[1]down14 = out14 < out14[1]mycolor14 = up14 ? #3cfe12 : down14 ? #ff0202 : #008effplot(out14 and smaplot14 ? out14 :na , title="610", color=mycolor14, linewidth=1)smaplot15 = input (true, title="MA987")len15 = input.int(987, minval=1, title="ma Length")out15 = exponential ? ta.ema(src, len15) : ta.sma(src, len15)up15 = out15 > out15[1]down15 = out15 < out15[1]mycolor15 = up15 ? #3cfe12 : down15 ? #ff0202 : #008effplot(out15 and smaplot15 ? out15 :na , title="987", color=mycolor15, linewidth=1)smaplot16 = input (true, title="MA1597")len16 = input.int(1597, minval=1, title="ma Length")out16 = exponential ? ta.ema(src, len16) : ta.sma(src, len16)up16 = out16 > out16[1]down16 = out16 < out16[1]mycolor16 = up16 ? #3cfe12 : down16 ? #ff0202 : #008effplot(out16 and smaplot16 ? out16 :na , title="1597", color=mycolor16, linewidth=1)smaplot17 = input (true, title="MA2584")len17 = input.int(2584, minval=1, title="ma Length")out17 = exponential ? ta.ema(src, len17) : ta.sma(src, len17)up17 = out17 > out17[1]down17 = out17 < out17[1]mycolor17 = up17 ? #3cfe12 : down17 ? #ff0202 : #008effplot(out17 and smaplot17 ? out17 :na , title="2584", color=mycolor17, linewidth=1)smaplot19 = input (true, title="MA4181")len19 = input.int(4181, minval=1, title="ma Length")out19 = exponential ? ta.ema(src, len19) : ta.sma(src, len19)up19 = out19 > out19[1]down19 = out19 < out19[1]mycolor19 = up19 ? #3cfe12 : down19 ? #ff0202 : #008effplot(out19 and smaplot19 ? out19 :na , title="4181", color=mycolor19, linewidth=1)//string  GRP3 = "Visual MA Settings"exponential5 = input(false, title="EMA or SMA", tooltip="EMA checked or SMA unchecked", group = GRP3)smaplot50 = input (true, title="MA50")len50 = input.int(50, minval=1, title="ma Length")ma50 = exponential5 ? ta.ema(src, len50) : ta.sma(src, len50)up50 = ma50 > ma50[1]down50 = ma50 < ma50[1]mycolor50 = up50 ? #3cfe12 : down50 ? #ff0202 : #008effplot(ma50 and smaplot50 ? ma50 :na , title="50", color=mycolor50, linewidth=1)smaplot100 = input (true, title="MA100")len100 = input.int(100, minval=1, title="ma Length")ma100 = exponential5 ? ta.ema(src, len100) : ta.sma(src, len100)up100 = ma100 > ma100[1]down100 = ma100 < ma100[1]mycolor100 = up100 ? #3cfe12 : down100 ? #ff0202 : #008effplot(ma100 and smaplot100 ? ma100 :na , title="100", color=mycolor100, linewidth=1)smaplot150 = input (true, title="MA150")len150 = input.int(150, minval=1, title="ma Length")ma150 = exponential5 ? ta.ema(src, len150) : ta.sma(src, len150)up150 = ma150 > ma150[1]down150 = ma150 < ma150[1]mycolor150 = up150 ? #3cfe12 : down150 ? #ff0202 : #008effplot(ma150 and smaplot150 ? ma150 :na , title="150", color=mycolor150, linewidth=1)smaplot200 = input (true, title="MA200")len200 = input.int(200, minval=1, title="ma Length")ma200 = exponential5 ? ta.ema(src, len200) : ta.sma(src, len200)up200 = ma200 > ma200[1]down200 = ma200 < ma200[1]mycolor200 = up200 ? #3cfe12 : down200 ? #ff0202 : #008effplot(ma200 and smaplot200 ? ma200 :na , title="200", color=mycolor200, linewidth=1)//if (ta.crossover(long1, long2))    strategy.entry("maL", strategy.long, comment="maLong")if (ta.crossunder(short1, short2))    strategy.entry("maS", strategy.short, comment="maShort")////