Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

J2S Backtest- 123-Stormer Strategy

A Pine Script v5 strategy built on EMA (close, 8), Highest (high, 3) and Lowest (low, 3). It has 9 order rules and no entry of its own. Exits use a stop loss and a profit target. Each trade commits 10% of equity and pays no commission. 16 settings; defaults include Bar limit for trading entry 3, Bar limit for trading close 8 and Profit over risk 1.

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 J2S Backtest- 123-Stormer Strategy repaint?
Yes
At least one pattern in the source can repaint: higher-timeframe data.
How did J2S Backtest- 123-Stormer Strategy do on BTCUSDT 1D with default settings?
Not measured
It closed no trades there from 26 Jan 2024 to 21 Oct 2026 with the default settings, so there is no result to report. Its code limits trading to a date window, which can leave this period out. It closed no trades on the other markets either. A backtest, not investment advice.
Does J2S Backtest- 123-Stormer Strategy run in Pine Script v6?
Not tested
Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download.
Does J2S Backtest- 123-Stormer Strategy use a stop loss?
Yes
strategy.exit sets a stop on line 135, 159.
Does J2S Backtest- 123-Stormer Strategy run in Zeal Terminal?
Yes
It compiles in 48 ms and runs 1,000 bars in 131 ms, in the browser.

BTCUSDT · 1D · default settings

  • Fast EMA
  • Slow EMA
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
50,00075,000100,000125,000AprJulOct2025AprJulOct2026AprJulOct$1,000$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. 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 BINANCE:BTCUSDT 1W, which this page cannot load in your browser.
Net profit
0.00%
$0.00
Buy and hold
+102.5%
same period
Closed trades
0
0 won · 0 lost
Profitable
0.0%
of closed trades
Profit factor
—
gross profit ÷ gross loss
Max drawdown
0.00%
$0.00

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

    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
BACKTEST: STORMER STRATEGY (123)
Long entrytrueboolline 107 line 109
Short entrytrueboolline 113 line 115
BACKTEST: METHOD
Bar limit for trading entryGiven a signal, entry must be reached within how many bars?3int · min 1cancel longEntryID cancel shortEntryID line 142 line 166
Bar limit for trading closeOnce a position is opened, close when it reaches the number of bars in trading.8int · min 1close tradeEntryID line 177
Profit over riskMultiplication factor based on the risk assumed in trading. The value range from stop-loss to trade entry is used to determine the profit target. This value range is multiplied by the value entered in 'profit over risk' parameter.1float · min 1 · step 0.5takeProfitInLong takeProfitInShort
Only third candle inside bar is validAccording to Stomer, it would be the best signal for the strategytrueboolline 106 line 112
BACKTEST: EXPONENTIAL MOVING AVERAGES
Timeframe1WtimeframefastEMA currentFastEMA previousFastEMA slowEMA currentSlowEMA previousSlowEMA
SourceclosesourcefastEMA currentFastEMA previousFastEMA slowEMA currentSlowEMA previousSlowEMA
Fast EMA length 8intfastEMA currentFastEMA previousFastEMA
Usetrueboolline 54 line 56 line 61 line 63 Fast EMA line 80 line 82 line 90 line 92
Slow EMA length 80intslowEMA currentSlowEMA previousSlowEMA
Usetrueboolline 54 line 61 Slow EMA line 80 line 84 line 90 line 94
Offset9intFast EMA Slow EMA
BACKTEST: TIME PERIOD
Filter date range of backtesttrueboolinTradeWindow
Start dateuseStartDatetimeinTradeWindow
End dateuseEndDatetimeinTradeWindow

What it calculates

  • EMASource (close), Fast EMA length (8)fastEMA · line 44
  • EMASource (close), Fast EMA length (8)currentFastEMA · line 45
  • EMAsourceInput[1], Fast EMA length (8)previousFastEMA · line 46
  • EMASource (close), Slow EMA length (80)slowEMA · line 47
  • EMASource (close), Slow EMA length (80)currentSlowEMA · line 48
  • EMAsourceInput[1], Slow EMA length (80)previousSlowEMA · line 49
  • Highesthigh, 3highestPrice · line 121
  • Lowestlow, 3lowestPrice · line 122

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 dataemaTimeframeInputTimeframesetting · 1WfastEMALengthInputFast EMA length …setting · 8slowEMALengthInputSlow EMA length …setting · 80highhighprice datalowlowprice dataprofitOverRiskInputProfit over risksetting · 1timetimeprice databacktestStartDateInputStart datesetting · useStartDatebacktestEndDateInputEnd datesetting · useEndDatebarLimitForEntryInputBar limit for trading e…setting · 3barLimitForCloseInputBar limit for trading c…setting · 8fastEMAEMA→ fastEMAcurrentFastEMAEMA→ currentFastEMApreviousFastEMAEMA→ previousFastEMAslowEMAEMA→ slowEMAcurrentSlowEMAEMA→ currentSlowEMApreviousSlowEMAEMA→ previousSlowEMAhighestPriceHighest→ highestPricelowestPriceLowest→ lowestPricefastEMAColor, slowEMAColorfastEMAColor · slowEMAC…2 valuespriceRangepriceRangevaluelongtEntryID, longExitID, myLongOrder, shortExitID, myShortOrder, tradeEntryIDlongtEntryID · longExit…6 valuesstopLossInLongstopLossInLongvaluetakeProfitInLongtakeProfitInLongvaluelongEntryIDlongEntryIDvalueshortEntryIDshortEntryIDvaluestopLossInShortstopLossInShortvaluetakeProfitInShorttakeProfitInShortvaluesplitPositionsplitPositionvalueentryBarentryBarvaluecloseIDcloseIDvaluelongEntryHasBeenMetlongEntryHasBeenMetconditionshortEntryHasBeenMetshortEntryHasBeenMetconditioninTradeWindowinTradeWindowconditioncandleColorDown, candleColorUp, insideBarColorDown, insideBarColorUp, downTrendColor, sidewaysTrendColor, upTrendColor, buySignalColor, sellSignalColorColourcandleColorDown · candleColor…order:longtEntryIDorder longtEntryIDstrategy.orderexit:longExitIDexit longExitIDstrategy.exitcancel:longEntryIDcancel longEntryIDstrategy.cancelorder:shortEntryIDorder shortEntryIDstrategy.orderexit:shortExitIDexit shortExitIDstrategy.exitcancel:shortEntryIDcancel shortEntryIDstrategy.cancelclose:tradeEntryIDClose tradeEntryIDstrategy.closecancel_all:cancel_all strategy.cancel_allclose_all:close_all strategy.close_allbarcolor:42barcolorbarcolorplot:71Fast EMAplotplot:72Slow EMAplotplotshape:185123 Buyplotshapeplotshape:186123 Sellplotshape

Order rules

OrderFires whenBy defaultLine
order longtEntryID longlongEntryHasBeenMetOn134
Exit longExitID stop and limitlongEntryHasBeenMetOn135
cancel longEntryIDbar_index - myLongOrder == barLimitForEntryInputOn144
order shortEntryID shortshortEntryHasBeenMetOn158
Exit shortExitID stop and limitshortEntryHasBeenMetOn159
cancel shortEntryIDbar_index - myShortOrder == barLimitForEntryInputOn168
Close tradeEntryIDbar_index - entryBar == barLimitForCloseInputOn179
cancel_all isBacktestDateRangeOver()On182
Close isBacktestDateRangeOver()On183

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.

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.
  • CheckHigher-timeframe data6 request.security call(s) use lookahead_on (line 44, 45, 46, 47, 48, 49). 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

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

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

Higher-timeframe data for request.security(): BINANCE:BTCUSDT 1W (Binance BTCUSDT 1w), fetched from Binance's public market data for each market.

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

Similar scripts

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

ScriptSharesTypeNetTradesMax drawdown
J2S Backtest- 123-Stormer Strategy this page—v5 strategy0.0%00.0%
CC Trend strategy 2- Downtrend Short by CheatCode1ema highest lowestv5 strategyNo trades on this market
TrianglePoint strategy by mohaneehighest lowest emav4 strategy+45.4%11101.9%
Lagged Donchian Channel + EMA by Mysteriownema highest lowestv4 strategy−12.3%412.3%
Backtest Custom HiLo Strategy by luyikaibrema highest lowestv4 strategyNo trades on this market
CM_SlingShotSystem+_CassicEMA+Willams21EMA13 htc1977 edition by Arivadisema highest lowestv5 strategyNo trades on this market

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.

  • No v6-only features. v6 is not needed to run this script.

Clean v5

Verified

Nothing to change.

Does it run in Pine Script v6?

Not tested

Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © julianossilva-//@version=5+//@version=6strategy(title="J2S Backtest: 123-Stormer Strategy", shorttitle="J2S Backtest: 123-Stormer Strategy", overlay=true, initial_capital=1000, default_qty_value=10, default_qty_type=strategy.percent_of_equity, pyramiding=0)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 48 msWith a workaround 1,000 bars in 131 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/// © julianossilva//@version=5strategy(title="J2S Backtest: 123-Stormer Strategy", shorttitle="J2S Backtest: 123-Stormer Strategy", overlay=true, initial_capital=1000, default_qty_value=10, default_qty_type=strategy.percent_of_equity, pyramiding=0)// Initial Backtest Date RangeuseStartDate = timestamp("01 Jan 2020 21:00:00")useEndDate   = timestamp("01 Jan 2023 21:00:00")// User InputsSIGNAL_CONFIG          = "BACKTEST: STORMER STRATEGY (123)"longEntryInput         = input.bool(defval=true,         group=SIGNAL_CONFIG, title="Long entry")shortEntryInput        = input.bool(defval=true,         group=SIGNAL_CONFIG, title="Short entry")METHOD_CONFIG          = "BACKTEST: METHOD"barLimitForEntryInput  = input.int(defval=3,             group=METHOD_CONFIG, title="Bar limit for trading entry", tooltip="Given a signal, entry must be reached within how many bars?", minval=1)barLimitForCloseInput  = input.int(defval=8,             group=METHOD_CONFIG, title="Bar limit for trading close", tooltip="Once a position is opened, close when it reaches the number of bars in trading.", minval=1)profitOverRiskInput    = input.float(defval=1,           group=METHOD_CONFIG, title="Profit over risk", tooltip="Multiplication factor based on the risk assumed in trading. The value range from stop-loss to trade entry is used to determine the profit target. This value range is multiplied by the value entered in 'profit over risk' parameter.", minval=1, step=0.5)insideBarStrategyInput = input.bool(defval=true,         group=METHOD_CONFIG, title="Only third candle inside bar is valid", tooltip="According to Stomer, it would be the best signal for the strategy")EMA_CONFIG             = "BACKTEST: EXPONENTIAL MOVING AVERAGES"emaTimeframeInput      = input.timeframe("1W",           group=EMA_CONFIG,    title="Timeframe")sourceInput            = input.source(defval=close,      group=EMA_CONFIG,    title="Source")fastEMALengthInput     = input.int(defval=8,             group=EMA_CONFIG,    inline="03", title="Fast EMA length           ")useFastEMAInput        = input.bool(defval=true,         group=EMA_CONFIG,    inline="03", title="Use")slowEMALengthInput     = input.int(defval=80,            group=EMA_CONFIG,    inline="04", title="Slow EMA length           ")useSlowEMAInput        = input.bool(defval=true,         group=EMA_CONFIG,    inline="04", title="Use")emaOffsetInput         = input.int(defval=9,             group=EMA_CONFIG,    title="Offset")PERIOD_CONFIG          = "BACKTEST: TIME PERIOD"useDateFilterInput     = input.bool(defval=true,         group=PERIOD_CONFIG, title="Filter date range of backtest")backtestStartDateInput = input.time(defval=useStartDate, group=PERIOD_CONFIG, title="Start date")backtestEndDateInput   = input.time(defval=useEndDate,   group=PERIOD_CONFIG, title="End date")// ColorscandleColorDown    = color.rgb(239, 83, 80, 80)candleColorUp      = color.rgb(38, 166, 154, 70)insideBarColorDown = color.rgb(239, 83, 80, 40)insideBarColorUp   = color.rgb(38, 166, 154, 20)downTrendColor     = color.rgb(239, 83, 80, 80)sidewaysTrendColor = color.rgb(252, 232, 131, 80)upTrendColor       = color.rgb(38, 166, 154, 80)buySignalColor     = color.limesellSignalColor    = color.orange// CandlesisCandleUp()   => close > openisCandleDown() => close <= openbarcolor(isCandleUp() ? candleColorUp : isCandleDown() ? candleColorDown : na)// Exponential Moving AveragesfastEMA         = request.security(syminfo.tickerid, emaTimeframeInput, ta.ema(sourceInput,    fastEMALengthInput), barmerge.gaps_on,  barmerge.lookahead_on)currentFastEMA  = request.security(syminfo.tickerid, emaTimeframeInput, ta.ema(sourceInput,    fastEMALengthInput), barmerge.gaps_off, barmerge.lookahead_on)previousFastEMA = request.security(syminfo.tickerid, emaTimeframeInput, ta.ema(sourceInput[1], fastEMALengthInput), barmerge.gaps_off, barmerge.lookahead_on)slowEMA         = request.security(syminfo.tickerid, emaTimeframeInput, ta.ema(sourceInput,    slowEMALengthInput), barmerge.gaps_on,  barmerge.lookahead_on)currentSlowEMA  = request.security(syminfo.tickerid, emaTimeframeInput, ta.ema(sourceInput,    slowEMALengthInput), barmerge.gaps_off, barmerge.lookahead_on)previousSlowEMA = request.security(syminfo.tickerid, emaTimeframeInput, ta.ema(sourceInput[1], slowEMALengthInput), barmerge.gaps_off, barmerge.lookahead_on)// Trend Rules for Exponential Moving AveragesisSlowEMAUp()   => currentSlowEMA > previousSlowEMAisSlowEMADown() => currentSlowEMA < previousSlowEMAisFastEMAUp()   =>    if useFastEMAInput and useSlowEMAInput        currentFastEMA > previousFastEMA and isSlowEMAUp()    else if useFastEMAInput        currentFastEMA > previousFastEMA    else        falseisFastEMADown() =>     if useFastEMAInput and useSlowEMAInput        currentFastEMA < previousFastEMA and isSlowEMADown()    else if useFastEMAInput        currentFastEMA < previousFastEMA    else        false// Exponential Moving Average ColorsfastEMAColor = isFastEMAUp() ? upTrendColor : isFastEMADown() ? downTrendColor : sidewaysTrendColorslowEMAColor = isSlowEMAUp() ? upTrendColor : isSlowEMADown() ? downTrendColor : sidewaysTrendColor// Display Exponential Moving Averagesplot(useFastEMAInput ? fastEMA : na, offset=emaOffsetInput, color=fastEMAColor, title="Fast EMA", style=plot.style_line, linewidth=4)plot(useSlowEMAInput ? slowEMA : na, offset=emaOffsetInput, color=slowEMAColor, title="Slow EMA", style=plot.style_line, linewidth=7)// Price TrendpricesAboveFastEMA() => low[2] > currentFastEMA and low[1] > currentFastEMA and low > currentFastEMApricesAboveSlowEMA() => low[2] > currentSlowEMA and low[1] > currentSlowEMA and low > currentSlowEMApricesBelowFastEMA() => high[2] < currentFastEMA and high[1] < currentFastEMA and high < currentFastEMApricesBelowSlowEMA() => high[2] < currentSlowEMA and high[1] < currentSlowEMA and high < currentSlowEMA// Market in Bullish TrendisBullishTrend() =>    if useFastEMAInput and useSlowEMAInput        pricesAboveFastEMA() and pricesAboveSlowEMA()    else if useFastEMAInput        pricesAboveFastEMA()    else if useSlowEMAInput        pricesAboveSlowEMA()    else        na// Market in Bearish TrendisBearishTrend() =>    if useFastEMAInput and useSlowEMAInput        pricesBelowFastEMA() and pricesBelowSlowEMA()    else if useFastEMAInput        pricesBelowFastEMA()    else if useSlowEMAInput        pricesBelowSlowEMA()    else        na// Stormer Strategy (123)isFirstCandleUp()   => high[2] > high[1] and low[2] > low[1]isFirstCandleDown() => high[2] < high[1] and low[2] < low[1]isThirdCandleUp()   => low > low[1]isThirdCandleDown() => high < high[1]isThirdCandleInsideBar() => high < high[1] and low > low[1]// Buy SignalisStormer123Buy() =>    if insideBarStrategyInput        longEntryInput and isFirstCandleUp() and isThirdCandleInsideBar() and isBullishTrend()    else        longEntryInput and isFirstCandleUp() and isThirdCandleUp() and isBullishTrend()// Sell SignalisStormer123Sell() =>    if insideBarStrategyInput        shortEntryInput and isFirstCandleDown() and isThirdCandleInsideBar() and isBearishTrend()    else        shortEntryInput and isFirstCandleDown() and isThirdCandleDown() and isBearishTrend()// Backtest Time PeriodinTradeWindow = not useDateFilterInput or (time >= backtestStartDateInput and time < backtestEndDateInput)isInTradeWindow() => inTradeWindowisBacktestDateRangeOver() => not inTradeWindow and inTradeWindow[1]// Backtest Price ParametershighestPrice = ta.highest(high, 3)lowestPrice  = ta.lowest(low,3)priceRange   = highestPrice - lowestPrice// Stormer Strategy (123): LONGvar myLongOrders = array.new_int(0)longtEntryID        = "Long Entry:\n" + str.tostring(bar_index)longExitID          = "Long Exit:\n" + str.tostring(bar_index)stopLossInLong      = lowestPrice + 1 * syminfo.minticktakeProfitInLong    = high + priceRange * profitOverRiskInputlongEntryHasBeenMet = isInTradeWindow() and isBullishTrend() and isStormer123Buy()// Scheduling LONG entryif longEntryHasBeenMet    array.push(myLongOrders, bar_index)    strategy.order(longtEntryID, strategy.long, stop=high)    strategy.exit(longExitID, longtEntryID, stop=stopLossInLong, limit=takeProfitInLong)// In pine script, any order scheduled but not yet filled can be canceled.// Once a order is filled, the trade is only finished with use of close or exit functions.// As scheduled orders are not stored in the strategy.opentrades array, manual control is required.int myLongOrderIndex = 0while myLongOrderIndex < array.size(myLongOrders) and array.size(myLongOrders) > 0     myLongOrder = array.get(myLongOrders, myLongOrderIndex)    if bar_index - myLongOrder == barLimitForEntryInput        longEntryID = "Long Entry:\n" + str.tostring(myLongOrder)        strategy.cancel(longEntryID)        array.remove(myLongOrders, myLongOrderIndex)        continue    myLongOrderIndex += 1// Stormer Strategy (123): SHORTvar myShortOrders    = array.new_int(0)shortEntryID         = "Short Entry:\n" + str.tostring(bar_index)shortExitID          = "Short Exit:\n" + str.tostring(bar_index)stopLossInShort      = highestPrice + 1 * syminfo.minticktakeProfitInShort    = low - priceRange * profitOverRiskInputshortEntryHasBeenMet = isInTradeWindow() and isBearishTrend() and isStormer123Sell()// Scheduling SHORT entryif shortEntryHasBeenMet    array.push(myShortOrders, bar_index)    strategy.order(shortEntryID, strategy.short, stop=low)    strategy.exit(shortExitID, shortEntryID, stop=stopLossInShort, limit=takeProfitInShort)// In pine script, any order scheduled but not yet filled can be canceled.// Once a order is filled, the trade is only finished with use of close or exit functions.// As scheduled orders are not stored in the strategy.opentrades array, manual control is required.int myShortOrderIndex = 0while myShortOrderIndex < array.size(myShortOrders) and array.size(myShortOrders) > 0     myShortOrder = array.get(myShortOrders, myShortOrderIndex)    if bar_index - myShortOrder == barLimitForEntryInput        shortEntryID := "Short Entry:\n" + str.tostring(myShortOrder)        strategy.cancel(shortEntryID)        array.remove(myShortOrders, myShortOrderIndex)        continue    myShortOrderIndex += 1// Trading must be stopped when candlestick limit reached in a tradingfor tradeNumber = 0 to strategy.opentrades - 1    tradeEntryID  = strategy.opentrades.entry_id(tradeNumber)    splitPosition = str.pos(tradeEntryID, ":")    entryBar      = str.tonumber(str.substring(tradeEntryID, splitPosition + 1))    if bar_index - entryBar == barLimitForCloseInput        closeID = "Close Position:\n" + str.tostring(entryBar)        strategy.close(id=tradeEntryID, comment=closeID, immediately=true)// Close all positions at the end of the backtest periodif isBacktestDateRangeOver()    strategy.cancel_all()    strategy.close_all(comment="Date Range Exit")// Display Signalsplotshape(series=longEntryHasBeenMet,  title="123 Buy",  style=shape.triangleup,   location=location.abovebar, color=buySignalColor,  text="Buy",  textcolor=buySignalColor)plotshape(series=shortEntryHasBeenMet, title="123 Sell", style=shape.triangledown, location=location.belowbar, color=sellSignalColor, text="Sell", textcolor=sellSignalColor)