Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

My five in one strategy for ETHUSD 700x v4 --smooth code

A Pine Script v5 strategy built on MOM (close, 6), Barssince or Change and SMA (close, 365). 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 commits 1% of equity and pays no commission. 12 settings; defaults include Resolution for Funding Interval 480, Resolution for TWAP Interval 240 and Momentum 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 My five in one strategy for ETHUSD 700x v4 --smooth code repaint?
Yes
At least one pattern in the source can repaint: higher-timeframe data.
How did My five in one strategy for ETHUSD 700x v4 --smooth code do on BTCUSDT 1D with default settings?
+1.02%
From 26 Jan 2024 to 21 Oct 2026, over 87 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does My five in one strategy for ETHUSD 700x v4 --smooth code 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: 87 before, 79 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 My five in one strategy for ETHUSD 700x v4 --smooth code use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does My five in one strategy for ETHUSD 700x v4 --smooth code run in Zeal Terminal?
Yes
It compiles in 21 ms and runs 1,000 bars in 67 ms, in the browser.

BTCUSDT · 1D · default settings

  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$1,009,960$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. The script plots nothing itself; the lines and the lower pane are its own calculations, drawn for reference. The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market. The live re-run is not offered here: the script requests BITMEX:XBTUSD 480, BITMEX:XBT 480, BITMEX:XBTUSD 240, QUANDL:BCHAIN/MIREV D, which this page cannot load in your browser.

Needs BITMEX:XBTUSD 480 data, not available: a lower timeframe than the chart; the engine does not evaluate intrabar data Needs BITMEX:XBT 480 data, not available: a lower timeframe than the chart; the engine does not evaluate intrabar data Needs BITMEX:XBTUSD 240 data, not available: a lower timeframe than the chart; the engine does not evaluate intrabar data Needs QUANDL:BCHAIN/MIREV D data, not available: not a Binance spot market Values that depend on it are empty on this chart.

Net profit
+1.02%
$10,167.40
Buy and hold
+102.5%
same period
Closed trades
87
33 won · 54 lost
Profitable
37.9%
of closed trades
Profit factor
1.56
gross profit ÷ gross loss
Max drawdown
0.70%
−$7,042.58

One run with the author's default settings, $1,000,000 starting capital, commission as the script sets it. A short 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.

  • Check

    Every trade uses all the equity

    default_qty_value is 100% of equity.

  • Note

    2 settings have no label

    In the settings dialog top (line 31), bottom (line 32) show an empty name. The labels on this page come from the variable names.

  • Note

    No slippage

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

  • Note

    Uses an argument v6 removed

    when = on line 122, 127. The upgraded version below moves each call inside an if block.

Settings

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

SettingDefaultType and rangeFeeds
Resolution for Funding Interval480timeframeres
Resolution for TWAP Interval240timeframeres_1
Momentum Sourceclosesourcemom
Momentum Length6intmom
Aroon Length7int · min 1 · max 1000upper lower
From Year2018int · min 1900 · max 2100entry long entry short line 119 line 125
To Year2100int · min 1900 · max 2100entry long entry short line 119 line 125
Perp TickerBITMEX:XBTUSDsymboltypicalPrice_fut weight
Spot TickerBITMEX:XBTsymboltypicalPrice_idx
Top (no label in the script)0.7float · step 0.1yas1 smonadnu
Bottom (no label in the script)3.4float · step 0.1no1 smonavrhu
Select Strategymacdstring · options ['rsi', 'macd', 'bb', 'rsi + macd', 'tt','pm','aroon', 'aroon1 + pm']_buy _sell

What it calculates

  • MOMMomentum Source (close), Momentum Length (6)mom · line 36
  • Barssince / Changeta.change(request.security(perp_ticker, res_1, time, lookahead=barmerge.lookahead_on))weight · line 43
  • SMAclose, 365ma365 · line 79
  • Highestbarshigh, length+1upper · line 82
  • Lowestbarslow, length+1lower · line 83
  • MACDclose, 12, 26, 9macdLine · line 91
  • MACDclose, 12, 26, 9signalLine · line 91
  • MACDclose, 12, 26, 9histLine · line 91

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 data_lengthMomentum Lengthsetting · 6timetimeprice dataperp_tickerPerp Tickersetting · BITMEX:XBTUSDhighhighprice datalengthAroon Lengthsetting · 7lowlowprice dataresIn_0Resolution for Funding …setting · 480resIn_1Resolution for TWAP Int…setting · 240openopenprice dataspot_tickerSpot Tickersetting · BITMEX:XBTi_stratSelectSelect Strategysetting · macdtopTopsetting · 0.7bottomBottomsetting · 3.4momMOM→ momweightBarssince / Change→ weightma365SMA→ ma365upperHighestbars→ upperlowerLowestbars→ lowermacdLineMACD→ macdLinesignalLineMACD→ signalLinehistLineMACD→ histLineresresvalueres_1res_1valuetypicalPrice_futtypicalPrice_futvaluetypicalPrice_idxtypicalPrice_idxvalueratioratiovaluepricepricevaluetwaptwapvaluefunding_1hr, funding_8hrfunding_1hr · funding_8…2 valuescount_upcount_upvaluecount_downcount_downvalueminingRevenueminingRevenuevaluepuellMultiplepuellMultiplevalue_buy, _sell_buy · _sell2 valuessmonadnusmonadnuconditionsmonavrhusmonavrhuconditionsell, buysell · buy2 conditionsmacdbuyCondition, macdsellConditionmacdbuyCondition · macd…2 conditionsyas1yas1conditionno1no1conditionup1, dn1, up, dnup1 · dn1 +24 conditionsentry:longOpen longstrategy.entryentry:shortOpen shortstrategy.entry

Order rules

OrderFires whenBy defaultLine
Open long long_buyOn122
Open short short_sellOn127

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

Does it repaint?

Yes

At least one pattern in the source can repaint; it is marked Check below.

18/18trades identical when replayed liveThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, four per bar, and compared with the historical run. Orders are decided once per closed bar, so nothing can change mid-bar.
  • CheckHigher-timeframe data3 request.security call(s) use lookahead_on (line 43, 78, 79). Without a [1] offset this reads future bars in history.
  • 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

Not run on other markets: the script requests BITMEX:XBTUSD 480, BITMEX:XBT 480, BITMEX:XBTUSD 240, QUANDL:BCHAIN/MIREV D, and that data is not available here (a lower timeframe than the chart; the engine does not evaluate intrabar data; a lower timeframe than the chart; the engine does not evaluate intrabar data; a lower timeframe than the chart; the engine does not evaluate intrabar data; not a Binance spot market). Its results would rest on empty values.

The trades

By market direction

At entry, last 90 barsTradesWonP&L
Rising market2232%−$2,210.24
Sideways market4337%$7,436.02
Falling market2245%$4,941.63

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

How bad could the drawdown be?

0.8%

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

0%1%
All 87 trades
SideEntryExitBarsP&L
long3 Feb 2024 43,200.007 Feb 2024 43,099.004−$23.39
short7 Feb 2024 43,099.008 Feb 2024 44,349.601−$290.17
long8 Feb 2024 44,349.6016 Mar 2024 69,499.8037$5,669.13
short16 Mar 2024 69,499.8026 Mar 2024 69,880.0010−$54.99
long26 Mar 2024 69,880.0022 Apr 2024 64,941.2027−$710.51
short22 Apr 2024 64,941.2023 Apr 2024 66,819.301−$290.54
long23 Apr 2024 66,819.305 May 2024 63,892.0012−$439.97
short5 May 2024 63,892.007 May 2024 63,165.202$114.20
long7 May 2024 63,165.2014 May 2024 62,940.107−$35.78
short14 May 2024 62,940.1016 May 2024 66,206.502−$521.02
long16 May 2024 66,206.504 Jun 2024 68,809.9019$394.56
short4 Jun 2024 68,809.905 Jun 2024 70,537.801−$252.07
long5 Jun 2024 70,537.8014 Jun 2024 66,773.009−$535.63
short14 Jun 2024 66,773.002 Jul 2024 62,900.0018$581.78
long2 Jul 2024 62,900.0011 Jul 2024 57,725.809−$825.57
short11 Jul 2024 57,725.8014 Jul 2024 59,204.003−$256.78
long14 Jul 2024 59,204.006 Aug 2024 54,018.8023−$878.03
short6 Aug 2024 54,018.8011 Aug 2024 60,923.505−$1,280.30
long11 Aug 2024 60,923.5018 Aug 2024 59,492.007−$235.06
short18 Aug 2024 59,492.0020 Aug 2024 59,438.502$8.99
long20 Aug 2024 59,438.5021 Aug 2024 59,013.801−$71.46
short21 Aug 2024 59,013.8022 Aug 2024 61,156.001−$363.03
long22 Aug 2024 61,156.006 Sep 2024 56,180.0015−$813.42
short6 Sep 2024 56,180.0013 Sep 2024 58,132.307−$347.12
long13 Sep 2024 58,132.308 Oct 2024 62,224.0025$702.84
short8 Oct 2024 62,224.009 Oct 2024 62,160.501$10.20
long9 Oct 2024 62,160.5012 Oct 2024 62,540.003$61.00
short12 Oct 2024 62,540.0015 Oct 2024 66,084.003−$566.29
long15 Oct 2024 66,084.0028 Oct 2024 68,021.7013$292.85
short28 Oct 2024 68,021.7029 Oct 2024 69,962.201−$285.01
long29 Oct 2024 69,962.202 Dec 2024 97,185.2034$3,886.27
short2 Dec 2024 97,185.205 Dec 2024 98,587.303−$144.66
long5 Dec 2024 98,587.3024 Dec 2024 94,881.5019−$376.83
short24 Dec 2024 94,881.5029 Dec 2024 95,300.005−$44.20
long29 Dec 2024 95,300.003 Jan 2025 96,984.805$177.16
short3 Jan 2025 96,984.804 Jan 2025 98,174.201−$122.91
long4 Jan 2025 98,174.2015 Jan 2025 96,560.9011−$164.68
short15 Jan 2025 96,560.9016 Jan 2025 100,497.001−$408.47
long16 Jan 2025 100,497.002 Feb 2025 100,636.0017$13.78
short2 Feb 2025 100,636.0016 Feb 2025 97,569.7014$305.14
long16 Feb 2025 97,569.7020 Feb 2025 96,644.404−$95.01
short20 Feb 2025 96,644.4023 Feb 2025 96,551.003$9.68
long23 Feb 2025 96,551.003 Mar 2025 94,270.008−$236.67
short3 Mar 2025 94,270.005 Mar 2025 87,282.002$742.43
long5 Mar 2025 87,282.0016 Mar 2025 84,338.4011−$338.02
short16 Mar 2025 84,338.4018 Mar 2025 84,010.002$39.02
long18 Mar 2025 84,010.005 Apr 2025 83,889.9018−$14.33
short5 Apr 2025 83,889.9010 Apr 2025 82,615.205$152.25
long10 Apr 2025 82,615.209 Jun 2025 105,734.0060$2,804.36
short9 Jun 2025 105,734.0010 Jun 2025 110,263.001−$430.46
long10 Jun 2025 110,263.0024 Jun 2025 105,334.0014−$449.05
short24 Jun 2025 105,334.0026 Jun 2025 107,341.002−$191.28
long26 Jun 2025 107,341.0025 Jul 2025 118,341.0029$1,028.78
short25 Jul 2025 118,341.009 Aug 2025 116,675.0015$141.49
long9 Aug 2025 116,675.005 Sep 2025 110,731.0027−$512.01
short5 Sep 2025 110,731.006 Sep 2025 110,660.001$6.43
long6 Sep 2025 110,660.0026 Sep 2025 108,994.0020−$151.19
short26 Sep 2025 108,994.001 Oct 2025 114,049.005−$465.77
long1 Oct 2025 114,049.0016 Oct 2025 110,763.0015−$289.22
short16 Oct 2025 110,763.0024 Oct 2025 110,078.008$62.08
long24 Oct 2025 110,078.004 Nov 2025 106,583.0011−$318.69
short4 Nov 2025 106,583.0013 Nov 2025 101,654.009$463.99
long13 Nov 2025 101,654.0027 Nov 2025 90,484.0014−$1,103.08
short27 Nov 2025 90,484.0029 Nov 2025 90,890.702−$45.07
long29 Nov 2025 90,890.703 Dec 2025 91,277.904$42.71
short3 Dec 2025 91,277.904 Dec 2025 93,429.901−$236.42
long4 Dec 2025 93,429.9021 Dec 2025 88,360.9017−$543.90
short21 Dec 2025 88,360.9023 Dec 2025 88,620.802−$29.47
long23 Dec 2025 88,620.8030 Jan 2026 84,650.2038−$448.91
short30 Jan 2026 84,650.2018 Feb 2026 67,503.5019$2,028.58
long18 Feb 2026 67,503.5013 Mar 2026 70,541.3023$451.60
short13 Mar 2026 70,541.3014 Mar 2026 70,930.001−$55.32
long14 Mar 2026 70,930.0026 Mar 2026 71,336.5012$57.54
short26 Mar 2026 71,336.504 Apr 2026 66,964.309$615.33
long4 Apr 2026 66,964.302 May 2026 78,231.1028$1,690.21
short2 May 2026 78,231.105 May 2026 79,861.003−$209.65
long5 May 2026 79,861.0015 May 2026 81,090.0010$154.82
short15 May 2026 81,090.0013 Jun 2026 63,580.0029$2,172.73
long13 Jun 2026 63,580.0026 Jun 2026 59,794.6013−$600.36
short26 Jun 2026 59,794.6030 Jun 2026 60,260.204−$78.47
long30 Jun 2026 60,260.201 Jul 2026 58,624.701−$273.50
short1 Jul 2026 58,624.703 Jul 2026 61,560.002−$504.41
long3 Jul 2026 61,560.0031 Jul 2026 64,780.0028$526.69
short31 Jul 2026 64,780.009 Aug 2026 64,962.609−$28.39
long9 Aug 2026 64,962.6018 Aug 2026 64,532.109−$66.76
short18 Aug 2026 64,532.1019 Aug 2026 64,725.401−$30.18
long19 Aug 2026 64,725.4011 Oct 2026 82,988.4053$2,842.27

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
My five in one strategy for ETHUSD 700x v4 --smooth code this page—v5 strategy+1.0%870.7%
Bollinger Bands And Aroon Scalping (by Coinrule) by Coinrulesma highestbars lowestbarsv4 strategy−5.4%810.0%

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.

  • 2 strategy calls use the when = argument (line 122, 127). It is deprecated in v5 and removed in v6, where each call moves inside an if block.
  • No v6-only features. v6 is not needed to run this script.

Clean v5

VerifiedDownload the v5 script

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

  • Line 122: when = _buy → if block
  • Line 127: when = _sell → if block
⋯    /// LONG-    strategy.entry("long", strategy.long, when = _buy)+    if _buy+        strategy.entry("long", strategy.long)   // strategy.exit("short", when=_buy, stop=close, limit=close, comment = "EXIT-SHORT_FTX_XRP-PERP_scalper_1M_8eafb86c43a4915e")⋯    //strategy.entry('sell', strategy.short)-    strategy.entry("short", strategy.short, when = _sell)+    if _sell+        strategy.entry("short", strategy.short)    //strategy.exit("long", when=_sell, stop=close, limit=close, comment = "EXIT-LONG_FTX_XRP-PERP_scalper_1M_8eafb86c43a4915e")⋯

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: 87 before, 79 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.

⋯// © Gammapips-//@version=5+//@version=6strategy('My five in one strategy for ETHUSD 700x v4 //smooth code', overlay=true, default_qty_type = strategy.percent_of_equity)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 21 msWith a workaround 1,000 bars in 67 msNot measured
PineTSNot testedNot testedNot measured

The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.

“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.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © Gammapips//@version=5strategy('My five in one strategy for ETHUSD 700x v4 //smooth code', overlay=true, default_qty_type = strategy.percent_of_equity)// xrpusd BEST OF THE BEST IS LENGHT 10 20  4 HOURS 1 day pm 0.7 / 3.3.// xrpusd BEST OF THE BEST IS LENGHT 10 18  4 HOURS 1 WEEK pm 0.7 / 3.3// ETHUSD 27% dropdoen 500x   length 8 17 swap 8HOURS 1 week , pm 0.7 / 3.3  sortino 2.7 sharp  0.29//BNBUSD 49% dropdown 350x  length 6 33 swap 8 hours 1 week , pm 0.9 / 6  sortino 3.4 sharp  0.25//DOGEUSD 24% dropdown 2000x  length 5 34 swap 8 hours 1 week , pm 0.7 / 4  sortino 10.7 sharp  0.38//ADAUSD 30% dropdown 4000x  length 6 27 swap 8 hours 1 week , pm 0.7 / 4  sortino 4.2 sharp  0.32//NEMUSD 30% dropdown 60x  length 2 25 swap 4 hours 1 week , pm 0.8 / 2.3  sortino 1.6 sharp  0.45//ETHUSD 55% dropdown 900x  length 6 26 swap 4 hours 1 week , pm 0.7 / 3.4  sortino 2.6 sharp  0.34//ETHUSD 48% dropdown 700x  length 6 26 swap 8 hours 1 week , pm 0.7 / 3.4 sortino 2.33 sharp  0.33//ETH USD 45% dropdown 500x  length 6 26 swap 1 week 1 week , pm 0.7 / 3.4 sortino 2.4 sharp  0.32//LTCUSD length 10 35 swap 4 hours 1 week , pm 0.7 / 3.1// BTCUSD length 8 36 swap 4 hours 1 week , pm 0.6 / 3.1// xrpusd BEST OF THE BEST IS LENGHT 2 (or 11) 19  4 HOURS 1 WEEK pm 0.7 / 3.3// 1h trading ... length 5 .. 14 swap 15 min 1 hour//InputsresIn_0 = input.timeframe(title='Resolution for Funding Interval', defval="480") // 480 is 8 hours timeframeres = resIn_0 == '0' ? timeframe.period : resIn_0resIn_1 = input.timeframe(title='Resolution for TWAP Interval', defval='240')res_1 = resIn_1 == '0' ? timeframe.period : resIn_1source = input.source(close, title="Momentum Source")_length = input.int(6, title="Momentum Length")length = input.int(26, defval = 7, minval = 1, maxval = 1000, title="Aroon Length")fromyear = input.int(2018, defval = 2018, minval = 1900, maxval = 2100, title = "From Year")toyear = input.int(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")perp_ticker = input.symbol(title='Perp Ticker', defval='BITMEX:XBTUSD')spot_ticker = input.symbol(title='Spot Ticker', defval='BITMEX:XBT')top = input.float(0.7, step=0.1)bottom = input.float(3.4, step=0.1)// Inputsi_stratSelect = input.string(defval='macd', title='Select Strategy', options=['rsi', 'macd', 'bb', 'rsi + macd', 'tt','pm','aroon', 'aroon1 + pm'])//Momentummom = ta.mom(source, _length)//Buy/Sell Momentumsell = mom < 0buy = mom > 0// Takes an average of prices for each ticker, for use in TWAP calctypicalPrice_fut = (request.security(perp_ticker, res, open) + request.security(perp_ticker, res, high) + request.security(perp_ticker, res, low) + request.security(perp_ticker, res, close)) / 4typicalPrice_idx = (request.security(spot_ticker, res, open) + request.security(spot_ticker, res, high) + request.security(spot_ticker, res, low) + request.security(spot_ticker, res, close)) / 4weight = ta.barssince(ta.change(request.security(perp_ticker, res_1, time, lookahead=barmerge.lookahead_on)))// calculate basic funding rate ratioratio = typicalPrice_fut / typicalPrice_idx - 1// initialize priceprice = 0.0// calc TWAP and 8hr funding rate price := weight == 0 ? ratio : ratio + nz(price[1])twap = price / (weight + 1)funding_1hr = twap * (1.0 / 24.0) * 100.0funding_8hr = twap * (8.0 / 24.0) * 100.0count_up = 0                                   // Declare the global count variablecount_up := nz(count_up[1], 0)                   // Reassign the count variable to the previous value. If it was na then change it to 0Counter_up() =>    if funding_8hr > 0.0098        count_up + 1    else        0count_up := Counter_up()  count_down = 0                                   // Declare the global count variablecount_down := nz(count_down[1], 0)                   // Reassign the count variable to the previous value. If it was na then change it to 0Counter_down() =>    if funding_8hr < -0.0098        count_down + 1    else        0count_down := Counter_down()  // Modify the global variable in the global scope.nn=0funding_up = falseif count_up > nn    funding_up := true    funding_down = falseif count_down > nn    funding_down := true    miningRevenue = request.security('QUANDL:BCHAIN/MIREV', 'D', close[1], barmerge.gaps_off, barmerge.lookahead_on)ma365 = request.security('QUANDL:BCHAIN/MIREV', 'D', ta.sma(close, 365)[1], barmerge.gaps_off, barmerge.lookahead_on)puellMultiple = miningRevenue / ma365//Aroonupper = 200 * (ta.highestbars(high, length+1) + length)/lengthlower = 200 * (ta.lowestbars(low, length+1) + length)/length//////////plot(upper, color=#FF6A00)//////////plot(lower, color=#0094FF)i_stratSelect := 'macd'if  buy    i_stratSelect := 'aroon1 + pm'f_strategySelector(_strat) =>    if _strat == 'macd'        [macdLine, signalLine, histLine] = ta.macd(close, 12, 26, 9)        macdbuyCondition = histLine > 0 and ta.crossover(macdLine, signalLine)        macdsellCondition = histLine < 0 and ta.crossunder(macdLine, signalLine)        [macdbuyCondition, macdsellCondition]        else if _strat ==  'aroon1 + pm'            //Signals                    yas1 = puellMultiple < top         no1 = puellMultiple > bottom                up1 = upper > lower         dn1 = upper < lower        [up1 or yas1, dn1 or no1]                      else if _strat ==  'aroon'            //Signals        up = upper > lower         dn = upper < lower        [up, dn]            else        [na, na]      [_buy, _sell] = f_strategySelector(i_stratSelect)smonadnu = puellMultiple < top smonavrhu = puellMultiple > bottomif _buy and year >= fromyear and year <= toyear and (month > 1 or dayofmonth > 6 or true)   and strategy.equity > 0  and ( not funding_up or false ) and not smonavrhu    //strategy.entry('buy', strategy.long)    /// LONG    strategy.entry("long", strategy.long, when = _buy)   // strategy.exit("short", when=_buy, stop=close, limit=close, comment = "EXIT-SHORT_FTX_XRP-PERP_scalper_1M_8eafb86c43a4915e")   if _sell and year >= fromyear and year <= toyear  and strategy.equity > 0 and ( not funding_down  or false ) and not smonadnu    //strategy.entry('sell', strategy.short)    strategy.entry("short", strategy.short, when = _sell)    //strategy.exit("long", when=_sell, stop=close, limit=close, comment = "EXIT-LONG_FTX_XRP-PERP_scalper_1M_8eafb86c43a4915e")//if sell and year >= fromyear and year <= fromyear and strategy.equity > 0 and ( funding_up  or false ) and not smonadnu // and na    //strategy.close('buy', when = sell)    //if time > timestamp(toyear, tomonth, today, 23, 59)    //strategy.close_all()