Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

ELIA MULTI INDICATORS STRATEGY

A Pine Script v4 strategy built on EMA (close, 80), MACD (close, 12) and RSI (close, 2). It has 4 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 25% of equity and pays no commission. 16 settings; defaults include start year 2021, end year 9999 and Trigger In Value 6.

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 ELIA MULTI INDICATORS STRATEGY repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 11 of 11 trades.
How did ELIA MULTI INDICATORS STRATEGY do on BTCUSDT 1D with default settings?
−2.47%
From 26 Jan 2024 to 21 Oct 2026, over 60 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Can ELIA MULTI INDICATORS STRATEGY be converted to Pine Script v5?
No
The automatic step from v4 to v5 gives a script that does not run in v5 (Pine Script v5 Error at @L41:C6: 'obv' was renamed to 'ta.obv' in Pine Script v5), so no v5 download is offered; the edits are shown below.
Does ELIA MULTI INDICATORS STRATEGY use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does ELIA MULTI INDICATORS STRATEGY run in Zeal Terminal?
Yes
It compiles in 22 ms and runs 1,000 bars in 63 ms, in the browser.

BTCUSDT · 1D · default settings

  • Plot
  • long
  • short
  • close long
  • closeshort
  • 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 (16)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOctPlot$975$2,025Equity from $1,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. Zeal Terminal's engine currently reads an order side written as long = strategy.long, long = strategy.short as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (lines 64, 70) so the engine trades the way the script says.
Net profit
−2.47%
−$24.67
Buy and hold
+102.5%
same period
Closed trades
60
19 won · 41 lost
Profitable
31.7%
of closed trades
Profit factor
0.92
gross profit ÷ gross loss
Max drawdown
14.92%
−$149.16

One run with the author's default settings, $1,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

    4 settings do nothing

    “Macd Fast Len”, “Macd Fast Len”, “Macd Signal Len”, “Stk D Len” are 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 long =, which v5 renamed line 64

    long = on line 64, 70. v5 writes it as direction = strategy.long or strategy.short.

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 ema → ta.ema, macd → ta.macd, rsi → ta.rsi, sma → ta.sma, stoch → ta.stoch, stdev → ta.stdev, mom → ta.mom.

v4 → v5

Differs

The v5 version does not run in Zeal Terminal's engine: Pine Script v5 Error at @L41:C6: 'obv' was renamed to 'ta.obv' in Pine Script v5.

  • Line 3: //@version=4 → //@version=5
  • Line 31: ema → ta.ema
  • Line 32: macd → ta.macd
  • Line 33: ema → ta.ema
  • Line 33: ema → ta.ema
  • Line 34: rsi → ta.rsi
7 more edits
  • Line 35: sma → ta.sma
  • Line 35: stoch → ta.stoch
  • Line 36: sma → ta.sma
  • Line 37: stdev → ta.stdev
  • Line 40: mom → ta.mom
  • Line 64: long = strategy.long → direction = strategy.long
  • Line 70: long = strategy.short → direction = strategy.short
⋯// © ally17-//@version=4+//@version=5strategy("ELIA MULTI STRATEGY",overlay=false,initial_capital=1000, default_qty_type=strategy.percent_of_equity, commission_type=strategy.commission.percent, commission_value=0.00, default_qty_value=25)⋯var donvar =0.0-ema = ema(close,emalen)+ema = ta.ema(close,emalen)-[macdLine, signalLine, histLine] = macd(close, 12, 26, 9) // MACD+[macdLine, signalLine, histLine] = ta.macd(close, 12, 26, 9) // MACD-occ = ema(close,occlen) - ema(open,occlen)+occ = ta.ema(close,occlen) - ta.ema(open,occlen)-rsi = rsi(close, rsilen) // RSI+rsi = ta.rsi(close, rsilen) // RSI-stoch = sma(stoch(close, high, low, stochklen), stochlen) // Stoch+stoch = ta.sma(ta.stoch(close, high, low, stochklen), stochlen) // Stoch-basis = sma(close, bblength)+basis = ta.sma(close, bblength)-dev = mult * stdev(close, bblength)+dev = mult * ta.stdev(close, bblength)upper = basis + devlower = basis - dev-moment = mom(close, momlen) // Momentum+moment = ta.mom(close, momlen) // MomentumObv = obv // OBV⋯    if longcondition-        strategy.entry("LONG", long=strategy.long)+        strategy.entry("LONG", direction = strategy.long)if closelong⋯    if shortcondition-        strategy.entry("SHORT", long=strategy.short)+        strategy.entry("SHORT", direction = strategy.short)if closeshort⋯

Clean v5

Not verified

The v5 script does not run in Zeal Terminal's engine (Pine Script v5 Error at @L41:C6: 'obv' was renamed to 'ta.obv' in Pine Script v5.), so this step could not be checked.

  • Line 6: input() → input.int()
  • Line 7: input() → input.int()
  • Line 8: input() → input.int()
  • Line 9: input() → input.int()
  • Line 10: input() → input.int()
  • Line 11: input() → input.int()
10 more edits
  • Line 12: input() → input.int()
  • Line 13: input() → input.int()
  • Line 14: input() → input.int()
  • Line 15: input() → input.int()
  • Line 16: input() → input.int()
  • Line 17: input() → input.int()
  • Line 18: input() → input.int()
  • Line 19: input() → input.int()
  • Line 20: input() → input.float()
  • Line 21: input() → input.int()
⋯//INPUT-start = timestamp(input(2021, "start year"), 1, 1, 00, 00)+start = timestamp(input.int(2021, "start year"), 1, 1, 00, 00)-end = timestamp(input(9999, "end year"), 1, 1, 00, 00)+end = timestamp(input.int(9999, "end year"), 1, 1, 00, 00)-triggerin=input(6, title="Trigger In Value", minval=1, maxval=15)+triggerin=input.int(6, title="Trigger In Value", minval=1, maxval=15)-triggerout=input(3, title="Trigger Out Value", minval=1, maxval=15)+triggerout=input.int(3, title="Trigger Out Value", minval=1, maxval=15)-emalen=input(80, title="Ema Len")+emalen=input.int(80, title="Ema Len")-macdfast=input(12, title="Macd Fast Len")+macdfast=input.int(12, title="Macd Fast Len")-macdslow=input(26, title="Macd Fast Len")+macdslow=input.int(26, title="Macd Fast Len")-macdsig=input(12, title="Macd Signal Len")+macdsig=input.int(12, title="Macd Signal Len")-occlen=input(15, title="Occ Len")+occlen=input.int(15, title="Occ Len")-rsilen=input(2, title="Rsi Len")+rsilen=input.int(2, title="Rsi Len")-stochklen=input(11, title="Stk K Len")+stochklen=input.int(11, title="Stk K Len")-stochdlen=input(3, title="Stk D Len")+stochdlen=input.int(3, title="Stk D Len")-stochlen=input(3, title="Stk Smooth Len")+stochlen=input.int(3, title="Stk Smooth Len")-bblength = input(10, minval=1, title="BB Len")+bblength = input.int(10, minval=1, title="BB Len")-mult = input(2.0, minval=0.001, maxval=50, title="BB Std Dev")+mult = input.float(2.0, minval=0.001, maxval=50, title="BB Std Dev")-momlen=input(10, title="Mom Len")+momlen=input.int(10, title="Mom Len")//CALCOLI⋯

Does it run in Pine Script v6?

Not tested

The v5 script does not run in Zeal Terminal's engine (Pine Script v5 Error at @L41:C6: 'obv' was renamed to 'ta.obv' in Pine Script v5.), so this step could not be checked. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © ally17-//@version=5+//@version=6strategy("ELIA MULTI STRATEGY",overlay=false,initial_capital=1000, default_qty_type=strategy.percent_of_equity, commission_type=strategy.commission.percent, commission_value=0.00, default_qty_value=25)⋯

Settings

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

SettingDefaultType and rangeFeeds
start year2021intline 62 line 68
end year9999intline 62 line 68
Trigger In Value6int · min 1 · max 15longcondition shortcondition trendcolor long short
Trigger Out Value3int · min 1 · max 15closelong closeshort trendcolor close long
Ema Len80intema
Macd Fast Len12intunused
Macd Fast Len26intunused
Macd Signal Len12intunused
Occ Len15intocc
Rsi Len2intrsi
Stk K Len11intstoch
Stk D Len3intunused
Stk Smooth Len3intstoch
BB Len10int · min 1basis dev
BB Std Dev2.0float · min 0.001 · max 50dev
Mom Len10intmoment

What it calculates

  • EMA (ema, ta.ema in v5)close, Ema Len (80)ema · line 31
  • MACD (macd, ta.macd in v5)close, 12, 26, 9macdLine · line 32
  • MACD (macd, ta.macd in v5)close, 12, 26, 9signalLine · line 32
  • MACD (macd, ta.macd in v5)close, 12, 26, 9histLine · line 32
  • EMA (ema, ta.ema in v5)close, Occ Len (15)occ · line 33
  • RSI (rsi, ta.rsi in v5)close, Rsi Len (2)rsi · line 34
  • SMA / Stoch (sma, ta.sma in v5)stoch(close, high, low, stochklen), Stk Smooth Len (3)stoch · line 35
  • SMA (sma, ta.sma in v5)close, BB Len (10)basis · line 36
  • Stdev (stdev, ta.stdev in v5)close, BB Len (10)dev · line 37
  • MOM (mom, ta.mom in v5)close, Mom Len (10)moment · line 40

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 dataemalenEma Lensetting · 80openopenprice dataocclenOcc Lensetting · 15rsilenRsi Lensetting · 2lowlowprice datahighhighprice datastochklenStk K Lensetting · 11stochlenStk Smooth Lensetting · 3bblengthBB Lensetting · 10multBB Std Devsetting · 2.0momlenMom Lensetting · 10triggerinTrigger In Valuesetting · 6triggeroutTrigger Out Valuesetting · 3emaEMA→ emamacdLineMACD→ macdLinesignalLineMACD→ signalLinehistLineMACD→ histLineoccEMA→ occrsiRSI→ rsistochSMA / Stoch→ stochbasisSMA→ basisdevStdev→ devmomentMOM→ momenttriggertriggervalueemavaremavarvaluemacdvarmacdvarvalueoccvaroccvarvaluersivarrsivarvaluestochvarstochvarvaluebbvarbbvarvalueupper, lowerupper · lower2 valuesObvObvvaluelongconditionlongconditionconditioncloselongcloselongconditionshortconditionshortconditionconditioncloseshortcloseshortconditiontrendcolorColourtrendcolorentry:LONGOpen LONGstrategy.entryclose:LONGClose LONGstrategy.closeentry:SHORTOpen SHORTstrategy.entryclose:SHORTClose SHORTstrategy.closeplot:57plotplothline:58longhlinehline:59shorthlinehline:60close longhlinehline:61closeshorthline

Order rules

OrderFires whenBy defaultLine
Open LONG longlongconditionOn64
Close LONGcloselongOn66
Open SHORT shortshortconditionOn70
Close SHORTcloseshortOn72

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, and the live replay matched history.

11/11trades 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.
  • 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−2.5%+102.5%6032%0.9214.9%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+5.5%+5.5%5833%1.573.3%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−12.7%+9.8%6526%0.7325.6%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+7.5%+8.4%6030%1.603.1%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+9.8%+16.7%6234%1.2310.1%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+10.7%+21.5%6231%1.793.2%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−17.0%+148.3%6630%0.5519.1%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+2.0%+17.1%7333%1.164.1%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 market2133%$18.16
Sideways market3027%−$85.18
Falling market944%$42.35

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

How bad could the drawdown be?

19.0%

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

0%22%
All 60 trades
SideEntryExitBarsP&L
short27 Jan 2024 41,823.5023 Feb 2024 51,288.4027−$56.58
short27 Feb 2024 54,476.501 Mar 2024 61,131.003−$28.81
short17 Mar 2024 65,300.6018 Mar 2024 68,393.501−$10.83
short22 Mar 2024 65,501.3025 Mar 2024 67,210.003−$5.89
short29 Mar 2024 70,780.605 Apr 2024 68,487.807$7.27
short6 Apr 2024 67,820.607 Apr 2024 68,896.001−$3.59
short13 Apr 2024 67,116.5018 Apr 2024 61,277.405$19.61
short3 May 2024 59,060.604 May 2024 62,882.001−$14.90
long6 May 2024 64,012.008 May 2024 62,312.102−$6.02
long10 May 2024 63,074.0011 May 2024 60,800.001−$8.11
short12 May 2024 60,826.0013 May 2024 61,484.001−$2.41
long14 May 2024 62,940.1015 May 2024 61,577.501−$4.82
long17 May 2024 65,235.201 Jun 2024 67,540.0015$7.82
long6 Jun 2024 71,108.009 Jun 2024 69,310.503−$5.64
short19 Jun 2024 65,175.3013 Jul 2024 57,889.1024$24.79
long18 Jul 2024 64,088.001 Aug 2024 64,628.0014$1.92
short7 Aug 2024 56,022.0014 Aug 2024 60,587.207−$18.62
short15 Aug 2024 58,683.4020 Aug 2024 59,438.505−$2.88
long27 Aug 2024 62,834.0028 Aug 2024 59,415.001−$12.14
short3 Sep 2024 59,132.1013 Sep 2024 58,132.3010$3.72
short17 Sep 2024 58,214.0018 Sep 2024 60,314.001−$7.97
long24 Sep 2024 63,340.002 Oct 2024 60,804.908−$8.76
short10 Oct 2024 60,636.0012 Oct 2024 62,540.002−$6.81
long22 Oct 2024 67,377.5027 Oct 2024 67,092.805−$0.91
long1 Nov 2024 70,292.004 Nov 2024 68,776.003−$4.63
long8 Nov 2024 75,857.9030 Nov 2024 97,460.0022$60.86
long6 Jan 2025 98,363.608 Jan 2025 96,954.602−$3.28
long16 Jan 2025 100,497.0029 Jan 2025 101,336.0013$1.90
short19 Feb 2025 95,671.7020 Feb 2025 96,644.401−$2.32
long21 Feb 2025 98,305.0022 Feb 2025 96,182.001−$4.92
short2 Mar 2025 86,064.506 Mar 2025 90,606.004−$11.97
short9 Mar 2025 86,222.5016 Mar 2025 84,338.407$4.89
short8 Apr 2025 79,163.2010 Apr 2025 82,615.202−$9.81
short11 Apr 2025 79,607.3012 Apr 2025 83,423.801−$10.67
long28 Apr 2025 93,749.3018 May 2025 103,127.0020$21.99
long24 May 2025 107,318.0025 May 2025 107,762.001$0.93
long12 Jun 2025 108,645.0013 Jun 2025 105,672.001−$6.17
long27 Jun 2025 106,947.0022 Jul 2025 117,380.0025$21.86
long23 Jul 2025 119,954.0025 Jul 2025 118,341.002−$3.09
long12 Aug 2025 118,686.0016 Aug 2025 117,342.004−$2.59
short27 Aug 2025 111,763.0029 Aug 2025 112,567.002−$1.64
short30 Aug 2025 108,377.008 Sep 2025 111,137.009−$5.80
long9 Sep 2025 112,065.0023 Sep 2025 112,651.0014$1.18
short27 Sep 2025 109,643.0030 Sep 2025 114,312.003−$9.65
long8 Oct 2025 121,333.0011 Oct 2025 112,774.003−$15.81
short15 Oct 2025 113,028.0027 Oct 2025 114,559.0012−$2.98
long28 Oct 2025 114,108.0029 Oct 2025 112,898.001−$2.33
short4 Nov 2025 106,583.0029 Nov 2025 90,890.7025$32.22
short18 Dec 2025 86,243.2021 Dec 2025 88,360.903−$5.57
long16 Jan 2026 95,604.8020 Jan 2026 92,631.004−$7.01
short22 Jan 2026 89,454.7017 Feb 2026 68,892.4026$51.43
short27 Mar 2026 68,820.307 Apr 2026 68,853.7011−$0.11
long14 Apr 2026 74,418.0030 Apr 2026 75,780.0016$4.33
long8 May 2026 80,006.0013 May 2026 80,504.505$1.48
short27 May 2026 75,930.0015 Jun 2026 65,746.4019$31.93
short28 Jun 2026 60,029.0030 Jun 2026 60,260.202−$0.95
short28 Jul 2026 63,755.907 Aug 2026 64,323.6010−$2.19
short12 Aug 2026 63,600.0019 Aug 2026 64,725.407−$4.34
long23 Aug 2026 77,074.903 Sep 2026 77,340.0011$0.84
long24 Sep 2026 84,397.6030 Sep 2026 83,663.706−$2.13

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
ELIA MULTI INDICATORS STRATEGY this page—v4 strategy−2.5%6014.9%
Take Profit On Trend (by BHD_Trade_Bot) by BHD_Trade_Botema rsi stdev smav4 strategy+54.8%913.1%
5 Minute Scalping Strategy by Coachman0912sma ema stdev rsiv5 strategyNo trades on this market
Bollinger Band + RSI + ADX + MACD + Heikinashi by TradeUsingPivotssma stdev rsi emav4 strategyNo trades on this market
AVWAP Strategy by asfbherorsi stoch sma stdevv5 strategydoes not run in Zeal Terminal
Webhook Starter Kit [HullBuster] by tradingtudiema stoch sma stdevv4 strategydoes not run in Zeal Terminal

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 22 msWith a workaround 1,000 bars in 63 msNot measured
PineTSNo v5 and v6 only—Not measured

Zeal Terminal's engine currently reads an order side written as long = strategy.long, long = strategy.short as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (lines 64, 70) so the engine trades the way the script says.

“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/// © ally17//@version=4strategy("ELIA MULTI STRATEGY",overlay=false,initial_capital=1000, default_qty_type=strategy.percent_of_equity, commission_type=strategy.commission.percent, commission_value=0.00, default_qty_value=25)//INPUTstart = timestamp(input(2021, "start year"), 1, 1, 00, 00)end = timestamp(input(9999, "end year"), 1, 1, 00, 00)triggerin=input(6, title="Trigger In Value", minval=1, maxval=15)triggerout=input(3, title="Trigger Out Value", minval=1, maxval=15)emalen=input(80, title="Ema Len")macdfast=input(12, title="Macd Fast Len")macdslow=input(26, title="Macd Fast Len")macdsig=input(12, title="Macd Signal Len")occlen=input(15, title="Occ Len")rsilen=input(2, title="Rsi Len")stochklen=input(11, title="Stk K Len")stochdlen=input(3, title="Stk D Len")stochlen=input(3, title="Stk Smooth Len")bblength = input(10, minval=1, title="BB Len")mult = input(2.0, minval=0.001, maxval=50, title="BB Std Dev")momlen=input(10, title="Mom Len")//CALCOLIvar trigger = 0.0var emavar = 0.0var macdvar = 0.0var occvar = 0.0var rsivar = 0.0var stochvar = 0.0var bbvar = 0.0var donvar =0.0ema = ema(close,emalen)[macdLine, signalLine, histLine] = macd(close, 12, 26, 9) // MACDocc = ema(close,occlen) - ema(open,occlen)rsi = rsi(close, rsilen) // RSIstoch = sma(stoch(close, high, low, stochklen), stochlen) // Stochbasis = sma(close, bblength)dev = mult * stdev(close, bblength)upper = basis + devlower = basis - devmoment = mom(close, momlen) // MomentumObv = obv // OBV//PLOT//STRATEGIAemavar := (close>ema)? 3 : -3macdvar := (macdLine>signalLine)? 3 : -3occvar := (occ>0)? 3 : -3rsivar := (rsi<20)? 2 : (rsi>50 and rsi<80)? 1 : (rsi>80)? -2 : (rsi<50 and rsi>20)? -1 : 0stochvar := (stoch<20)? 2 : (stoch>80)? -2 : 0bbvar :=  (close<lower)? 2 : (close>upper)? -2 : 0trigger := emavar+macdvar+occvar+rsivar+stochvar+bbvarlongcondition = trigger >= triggerincloselong = trigger < triggeroutshortcondition = trigger <= -triggerincloseshort = trigger > -triggerouttrendcolor = longcondition ? color.green : shortcondition? color.red : (trigger>triggerout and trigger<triggerin)? #A2E1BF : (trigger<-triggerout and trigger>-triggerin)? #E19997 : na//bgcolor(trendcolor, transp=80)plot(trigger, color=color.white)hline(triggerin, title="long", color=color.green, linestyle=hline.style_dashed)hline(0-triggerin, title="short", color=color.red, linestyle=hline.style_dashed)hline(triggerout, title="close long",color=color.blue, linestyle=hline.style_dashed)hline(0-triggerout, title="closeshort",color=color.blue, linestyle=hline.style_dashed)if time > start and time < end    if longcondition        strategy.entry("LONG", long=strategy.long)if closelong    strategy.close("LONG", comment="CLOSE LONG")    if time > start and time < end    if shortcondition        strategy.entry("SHORT", long=strategy.short)if closeshort    strategy.close("SHORT", comment="CLOSE SHORT")//plotshape(longcondition, color=color.green, text="L", size=size.small, style=shape.triangledown)//plotshape(shortcondition, color=color.red, "S"(trigger), size=size.small, style=shape.triangledown)//plotshape(closelong, color=color.purple, text="LC", size=size.small, style=shape.triangledown)//plotshape(closeshort, color=color.purple, text="SC", size=size.small, style=shape.triangledown)