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
- 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.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| source | ohlc4 | source | long1 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 input | 34 | int · min 1 | long1 |
| crossover EMA or SMAEMA checked or SMA unchecked | true | bool | long2 |
| crossoverCrossed over Moving average long input | 144 | int · min 1 | long2 |
| short EMA or SMAEMA checked or SMA unchecked | true | bool | short1 |
| shortSignal Moving average short input | 55 | int · min 1 | short1 |
| crossunder EMA or SMAEMA checked or SMA unchecked | false | bool | short2 |
| crossunderCrossed under Moving average short input | 144 | int · min 1 | short2 |
| MA1 | true | bool | 1 |
| ma Length | 1 | int · min 1 | out11 |
| MA2 | true | bool | 2 |
| ma Length | 2 | int · min 1 | out18 |
| MA3 | true | bool | 3 |
| ma Length | 3 | int · min 1 | out13 |
| MA5 | true | bool | 5 |
| ma Length | 5 | int · min 1 | out9 |
| MA8 | true | bool | 8 |
| ma Length | 8 | int · min 1 | out8 |
| MA13 | true | bool | 13 |
| ma Length | 13 | int · min 1 | out7 |
| MA21 | true | bool | 21 |
| ma Length | 21 | int · min 1 | out |
| MA34 | true | bool | 34 |
| ma Length | 34 | int · min 1 | out2 |
| MA55 | true | bool | 55 |
| ma Length | 55 | int · min 1 | out3 |
| MA89 | true | bool | 89 |
| ma Length | 89 | int · min 1 | out4 |
| MA144 | true | bool | 144 |
| ma Length | 144 | int · min 1 | out5 |
| MA233 | true | bool | 233 |
| ma Length | 233 | int · min 1 | out6 |
| MA377 | true | bool | 377 |
| ma Length | 377 | int · min 1 | out10 |
| MA610 | true | bool | 610 |
| ma Length | 610 | int · min 1 | out14 |
| MA987 | true | bool | 987 |
| ma Length | 987 | int · min 1 | out15 |
| MA1597 | true | bool | 1597 |
| ma Length | 1597 | int · min 1 | out16 |
| MA2584 | true | bool | 2584 |
| ma Length | 2584 | int · min 1 | out17 |
| MA4181 | true | bool | 4181 |
| ma Length | 4181 | int · min 1 | out19 |
| MA50 | true | bool | 50 |
| ma Length | 50 | int · min 1 | ma50 |
| MA100 | true | bool | 100 |
| ma Length | 100 | int · min 1 | ma100 |
| MA150 | true | bool | 150 |
| ma Length | 150 | int · min 1 | ma150 |
| MA200 | true | bool | 200 |
| ma Length | 200 | int · min 1 | ma200 |
| Long or Short Settings | |||
| long EMA or SMAEMA checked or SMA unchecked | true | bool | long1 |
| Visual FibMA Settings | |||
| Fib EMA or SMAEMA checked or SMA unchecked | true | bool | out11 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 unchecked | false | bool | ma50 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
| Order | Fires when | By default | Line |
|---|---|---|---|
| Open maL long | (ta.crossover(long1, long2)) | On | 187 |
| Open maS short | (ta.crossunder(short1, short2)) | On | 189 |
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.
- 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.
| Market | Net | Buy and hold | Trades | Won | Profit factor | Max drawdown | Period |
|---|---|---|---|---|---|---|---|
| BTCUSDT 1D | +4.4% | +102.5% | 5 | 60% | 3.11 | 2.3% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | +0.2% | +5.5% | 5 | 20% | 1.24 | 1.0% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | +0.1% | +9.8% | 5 | 60% | 3.38 | 0.1% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | +0.0% | +8.4% | 1 | 100% | — | 0.1% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | −0.0% | +16.7% | 7 | 29% | 0.59 | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | +0.0% | +21.5% | 3 | 67% | 8.05 | 0.0% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | +0.0% | +148.3% | 5 | 80% | 18.13 | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | +0.0% | +17.1% | 2 | 100% | — | 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 bars | Trades | Won | P&L |
|---|---|---|---|
| Rising market | 0 | — | $0.00 |
| Sideways market | 3 | 100% | $64,141.10 |
| Falling market | 2 | 0% | −$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.
All 5 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| short | 6 Jul 2024 56,628.80 | 18 Jul 2024 64,088.00 | 12 | −$7,459.20 |
| long | 18 Jul 2024 64,088.00 | 14 Mar 2025 81,115.80 | 239 | $17,027.80 |
| short | 14 Mar 2025 81,115.80 | 30 Apr 2025 94,256.80 | 47 | −$13,141.00 |
| long | 30 Apr 2025 94,256.80 | 1 Nov 2025 109,608.00 | 185 | $15,351.20 |
| short | 1 Nov 2025 109,608.00 | 29 Aug 2026 77,845.90 | 301 | $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.
| Script | Shares | Type | Net | Trades | Max drawdown |
|---|---|---|---|---|---|
| Fibonacci Moving Averages Input this page | — | v5 strategy | +4.4% | 5 | 2.3% |
| MACD Long Strat by TheGrindToday | ema sma | v4 strategy | +24.0% | 79 | 20.1% |
| Stock trending strategy by exlux99 | ema sma | v4 strategy | +35.3% | 21 | 14.7% |
| 4-Hour Stochastic EMA Trend by slymnturkoglu | ema sma | v4 strategy | No trades on this market | ||
| 4X EMA and volume strategy by SoftKill21 | ema sma | v4 strategy | +1.8% | 3 | 25.8% |
| Simple Momentum Strategy Based on SMA, EMA and Volume by slip_stream | sma ema | v4 strategy | +7.4% | 18 | 27.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.
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
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 55 ms | Yes 1,000 bars in 281 ms | Not measured |
| PineTS | Not tested | Not tested | 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.
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")////