Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

Aroon Strategy long only

A Pine Script v4 strategy built on Highestbars (high, length+1), Lowestbars (low, length+1) and Linreg (close, 20). It has 2 order rules, 1 entry among them, and trades long only with the default settings. Exits wait for a signal; there is no stop loss. Each trade commits 100% of equity and pays 0.1% commission. 9 settings; defaults include From Day 1, From Month 1 and From Year 2010.

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 Aroon Strategy long only repaint?
No
No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
How did Aroon Strategy long only 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.
Can Aroon Strategy long only be converted to Pine Script v5?
Not tested
The steps are shown below, but neither version placed a trade on any market tested, so there was nothing to compare and no download is offered.
Does Aroon Strategy long only use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Aroon Strategy long only run in Zeal Terminal?
Yes
It compiles in 12 ms and runs 1,000 bars in 29 ms, in the browser.

BTCUSDT · 1D · default settings

  • Highestbars
  • Lowestbars
  • Linreg
  • 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 (9)
0.0050,000100,000AprJulOct2025AprJulOct2026AprJulOct$100$203Equity from $100
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. Zeal Terminal's engine currently reads an order side written as 1 as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (line 28) so the engine trades the way the script says.
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, $100 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 stop loss

    Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.

  • Check

    Every trade uses all the equity

    default_qty_value is 100% of equity.

  • Note

    Uses an argument v6 removed

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

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 highestbars → ta.highestbars, lowestbars → ta.lowestbars, linreg → ta.linreg, crossover → ta.crossover, crossunder → ta.crossunder.
  • 2 strategy calls use the when = argument (line 28, 29). It is deprecated in v5 and removed in v6, where each call moves inside an if block.

v4 → v5

Not verified

Neither version placed a trade on any of the 8 markets, so there was nothing to compare.

  • Line 3: //@version=4 → //@version=5
  • Line 19: highestbars → ta.highestbars
  • Line 20: lowestbars → ta.lowestbars
  • Line 21: input(type = input.integer) → input.int()
  • Line 24: linreg → ta.linreg
  • Line 25: crossover → ta.crossover
  • Line 26: crossunder → ta.crossunder
  • Line 28: strategy.entry(…, 1) → strategy.entry(…, strategy.long)
⋯// © exlux99-//@version=4+//@version=5strategy(title = "Aroon Strategy long only", overlay = true,  pyramiding=1,initial_capital = 100, default_qty_type= strategy.percent_of_equity, default_qty_value = 100, calc_on_order_fills=false, slippage=0,commission_type=strategy.commission.percent,commission_value=0.1)⋯length = input(15, minval=1, title="Aroon Legnth")-upper = 100 * (highestbars(high, length+1) + length)/length+upper = 100 * (ta.highestbars(high, length+1) + length)/length-lower = 100 * (lowestbars(low, length+1) + length)/length+lower = 100 * (ta.lowestbars(low, length+1) + length)/length-lengthx = input(title="Length LSMA", type=input.integer, defval=20)+lengthx = input.int(title="Length LSMA", defval=20)offset = 0//input(title="Offset", type=input.integer, defval=0)src = input(close, title="Source")-lsma = linreg(src, lengthx, offset)+lsma = ta.linreg(src, lengthx, offset)-long = crossover(upper,lower) and close > lsma+long = ta.crossover(upper,lower) and close > lsma-longexit = crossunder(upper,lower) and close < lsma+longexit = ta.crossunder(upper,lower) and close < lsmaif(time_cond)-    strategy.entry("long",1,when=long)+    strategy.entry("long",strategy.long,when=long)    strategy.close("long",when=longexit)

Clean v5

Not verified

Neither version placed a trade on any of the 8 markets, so there was nothing to compare.

  • Line 6: input() → input.int()
  • Line 7: input() → input.int()
  • Line 8: input() → input.int()
  • Line 11: input() → input.int()
  • Line 12: input() → input.int()
  • Line 13: input() → input.int()
4 more edits
  • Line 18: input() → input.int()
  • Line 23: input() → input.source()
  • Line 28: when = long → if block
  • Line 29: when = longexit → if block
⋯//Time-fromDay = input(defval = 1, title = "From Day", minval = 1, maxval = 31)+fromDay = input.int(defval = 1, title = "From Day", minval = 1, maxval = 31)-fromMonth = input(defval = 1, title = "From Month", minval = 1, maxval = 12)+fromMonth = input.int(defval = 1, title = "From Month", minval = 1, maxval = 12)-fromYear = input(defval = 2010, title = "From Year", minval = 1970)+fromYear = input.int(defval = 2010, title = "From Year", minval = 1970) //monday and session // To Date Inputs-toDay = input(defval = 31, title = "To Day", minval = 1, maxval = 31)+toDay = input.int(defval = 31, title = "To Day", minval = 1, maxval = 31)-toMonth = input(defval = 12, title = "To Month", minval = 1, maxval = 12)+toMonth = input.int(defval = 12, title = "To Month", minval = 1, maxval = 12)-toYear = input(defval = 2021, title = "To Year", minval = 1970)+toYear = input.int(defval = 2021, title = "To Year", minval = 1970)startDate = timestamp(fromYear, fromMonth, fromDay, 00, 00)⋯//INPUTS-length = input(15, minval=1, title="Aroon Legnth")+length = input.int(15, minval=1, title="Aroon Legnth")upper = 100 * (ta.highestbars(high, length+1) + length)/length⋯offset = 0//input(title="Offset", type=input.integer, defval=0)-src = input(close, title="Source")+src = input.source(close, title="Source")lsma = ta.linreg(src, lengthx, offset)⋯if(time_cond)-    strategy.entry("long",strategy.long,when=long)+    if long+        strategy.entry("long",strategy.long)-    strategy.close("long",when=longexit)+    if longexit+        strategy.close("long")

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.

⋯// © exlux99-//@version=5+//@version=6strategy(title = "Aroon Strategy long only", overlay = true,  pyramiding=1,initial_capital = 100, default_qty_type= strategy.percent_of_equity, default_qty_value = 100, calc_on_order_fills=false, slippage=0,commission_type=strategy.commission.percent,commission_value=0.1)⋯

Settings

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

SettingDefaultType and rangeFeeds
From Day1int · min 1 · max 31startDate
From Month1int · min 1 · max 12startDate
From Year2010int · min 1970startDate
To Day31int · min 1 · max 31finishDate
To Month12int · min 1 · max 12finishDate
To Year2021int · min 1970finishDate
Aroon Legnth15int · min 1upper lower
Length LSMA20int (written input.integer)lsma
Sourceclosesourcelsma

What it calculates

  • Highestbars (highestbars, ta.highestbars in v5)high, length+1upper · line 19
  • Lowestbars (lowestbars, ta.lowestbars in v5)low, length+1lower · line 20
  • Linreg (linreg, ta.linreg in v5)Source (close), Length LSMA (20), offsetlsma · line 24

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.

highhighprice datalengthAroon Legnthsetting · 15lowlowprice dataclosecloseprice datalengthxLength LSMAsetting · 20fromYearFrom Yearsetting · 2010fromMonthFrom Monthsetting · 1fromDayFrom Daysetting · 1toYearTo Yearsetting · 2021toMonthTo Monthsetting · 12toDayTo Daysetting · 31timetimeprice dataupperHighestbars→ upperlowerLowestbars→ lowerlsmaLinreg→ lsmastartDatestartDatevaluefinishDatefinishDatevaluetime_condtime_condconditionlonglongconditionlongexitlongexitconditionentry:longOpen longstrategy.entryclose:longClose longstrategy.close

Order rules

OrderFires whenBy defaultLine
Open long longlongcrossover(upper,lower) and close > lsmaOn28
Close longlongexitcrossunder(upper,lower) and close < lsmaOn29

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

Does it repaint?

No

No repainting patterns in the source.

Not measuredNo trades to compareThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, but neither the live nor the historical run produced any trades in them, so the replay says nothing either way.
  • ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • ClearIntrabar recalculationNo varip, calc_on_every_tick or realtime-only state. Orders are decided once per closed bar.
  • ClearOrder timingOrders fill at the next bar's open, after the signal bar has closed.

The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.

Other markets

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

MarketNetBuy and holdTradesWonProfit factorMax drawdownPeriod
BTCUSDT 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

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
Aroon Strategy long only this page—v4 strategy0.0%00.0%
Aroon by Zeal Terminalhighestbars lowestbarsv5 indicatorindicator
Bollinger Bands And Aroon Scalping (by Coinrule) by Coinrulehighestbars lowestbarsv4 strategy−5.4%810.0%
Aroon Oscillator Strategy by mohaneehighestbars lowestbarsv4 strategyNo trades on this market
EMA_HMA_RSI_Strategy by mohaneehighestbars lowestbarsv4 strategyNo trades on this market
FFT Strategy Bi-Directional Stop-Profit-Trailing + VMA + Aroon by Gentleman-Goathighestbars lowestbarsv5 strategydoes not run in Zeal Terminal

Where it runs

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

Zeal Terminal's engine currently reads an order side written as 1 as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (line 28) 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/// © exlux99//@version=4strategy(title = "Aroon Strategy long only", overlay = true,  pyramiding=1,initial_capital = 100, default_qty_type= strategy.percent_of_equity, default_qty_value = 100, calc_on_order_fills=false, slippage=0,commission_type=strategy.commission.percent,commission_value=0.1)//TimefromDay = input(defval = 1, title = "From Day", minval = 1, maxval = 31)fromMonth = input(defval = 1, title = "From Month", minval = 1, maxval = 12)fromYear = input(defval = 2010, title = "From Year", minval = 1970) //monday and session // To Date InputstoDay = input(defval = 31, title = "To Day", minval = 1, maxval = 31)toMonth = input(defval = 12, title = "To Month", minval = 1, maxval = 12)toYear = input(defval = 2021, title = "To Year", minval = 1970)startDate = timestamp(fromYear, fromMonth, fromDay, 00, 00)finishDate = timestamp(toYear, toMonth, toDay, 00, 00)time_cond = time >= startDate and time <= finishDate//INPUTSlength = input(15, minval=1, title="Aroon Legnth")upper = 100 * (highestbars(high, length+1) + length)/lengthlower = 100 * (lowestbars(low, length+1) + length)/lengthlengthx = input(title="Length LSMA", type=input.integer, defval=20)offset = 0//input(title="Offset", type=input.integer, defval=0)src = input(close, title="Source")lsma = linreg(src, lengthx, offset)long = crossover(upper,lower) and close > lsmalongexit = crossunder(upper,lower) and close < lsmaif(time_cond)    strategy.entry("long",1,when=long)    strategy.close("long",when=longexit)