Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

AryaN

A Pine Script v5 strategy built on Crossover or EMA (close, 5, close, 10) and Crossunder or EMA (close, 6, close, 11). 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. It has no settings.

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 AryaN repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 17 of 17 trades.
How did AryaN do on BTCUSDT 1D with default settings?
+2.85%
From 26 Jan 2024 to 21 Oct 2026, over 56 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does AryaN 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: 56 before, 42 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 AryaN use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does AryaN run in Zeal Terminal?
Yes
It compiles in 6 ms and runs 1,000 bars in 11 ms, in the browser.

BTCUSDT · 1D · default settings

  • Crossover
  • Crossunder
  • 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 (0)
0.0050,000100,000AprJulOct2025AprJulOct2026AprJulOct$1,025,500$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.
Net profit
+2.85%
$28,453.60
Buy and hold
+102.5%
same period
Closed trades
56
19 won · 37 lost
Profitable
33.9%
of closed trades
Profit factor
1.24
gross profit ÷ gross loss
Max drawdown
3.30%
−$33,165.30

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.

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

The script declares no settings.

What it calculates

  • Crossover / EMAta.ema(close, 5), ta.ema(close, 10)longCondition · line 5
  • Crossunder / EMAta.ema(close, 6), ta.ema(close, 11)shortCondition · line 8

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 datalongConditionCrossover / EMA→ longConditionshortConditionCrossunder / EMA→ shortConditionentry:BuyOpen Buystrategy.entryentry:SellOpen Sellstrategy.entry

Order rules

OrderFires whenBy defaultLine
Open Buy long(longCondition)On7
Open Sell short(shortCondition)On10

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.

17/17trades 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.8%+102.5%5634%1.243.3%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+1.2%+5.5%6930%1.301.5%8 May 2026 – 21 Oct 2026
ETHUSDT 1D+0.2%+9.8%6832%1.250.2%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h−0.1%+8.4%9320%0.780.1%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+0.0%+16.7%7135%1.050.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+0.0%+21.5%6935%1.530.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−0.0%+148.3%7134%0.970.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+0.0%+17.1%6932%1.320.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 barsTradesWonP&L
Rising market1729%−$36,453.90
Sideways market2352%$60,374.40
Falling market1613%$4,533.10

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

How bad could the drawdown be?

6.4%

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

0%7%
All 56 trades
SideEntryExitBarsP&L
short20 Mar 2024 61,937.4026 Mar 2024 69,880.006−$7,942.59
long26 Mar 2024 69,880.004 Apr 2024 65,963.309−$3,916.73
short4 Apr 2024 65,963.308 Apr 2024 69,360.404−$3,397.11
long8 Apr 2024 69,360.4014 Apr 2024 63,924.506−$5,435.86
short14 Apr 2024 63,924.5024 Apr 2024 66,414.0010−$2,489.48
long24 Apr 2024 66,414.0012 Jun 2024 67,314.2049$900.23
short12 Jun 2024 67,314.2015 Jul 2024 60,797.9033$6,516.32
long15 Jul 2024 60,797.903 Aug 2024 61,498.3019$700.43
short3 Aug 2024 61,498.3022 Aug 2024 61,156.0019$342.31
long22 Aug 2024 61,156.0029 Aug 2024 59,034.907−$2,121.13
short29 Aug 2024 59,034.9013 Sep 2024 58,132.3015$902.59
long13 Sep 2024 58,132.303 Oct 2024 60,649.3020$2,516.96
short3 Oct 2024 60,649.3013 Oct 2024 63,206.2010−$2,556.96
long13 Oct 2024 63,206.2021 Dec 2024 97,805.4069$34,599.20
short21 Dec 2024 97,805.404 Jan 2025 98,174.2014−$368.73
long4 Jan 2025 98,174.2010 Jan 2025 92,552.506−$5,621.68
short10 Jan 2025 92,552.5016 Jan 2025 100,497.006−$7,944.86
long16 Jan 2025 100,497.002 Feb 2025 100,636.0017$138.31
short2 Feb 2025 100,636.0021 Feb 2025 98,305.0019$2,330.65
long21 Feb 2025 98,305.0030 Mar 2025 82,648.5037−$15,656.50
short30 Mar 2025 82,648.5013 Apr 2025 85,276.9014−$2,628.38
long13 Apr 2025 85,276.9031 May 2025 103,985.0048$18,708.60
short31 May 2025 103,985.0010 Jun 2025 110,263.0010−$6,277.55
long10 Jun 2025 110,263.0015 Jun 2025 105,415.005−$4,848.39
short15 Jun 2025 105,415.0026 Jun 2025 107,341.0011−$1,925.96
long26 Jun 2025 107,341.001 Aug 2025 115,764.0036$8,423.48
short1 Aug 2025 115,764.009 Aug 2025 116,675.008−$910.67
long9 Aug 2025 116,675.0019 Aug 2025 116,227.0010−$447.69
short19 Aug 2025 116,227.009 Sep 2025 112,065.0021$4,161.82
long9 Sep 2025 112,065.0023 Sep 2025 112,651.0014$585.76
short23 Sep 2025 112,651.001 Oct 2025 114,049.008−$1,397.95
long1 Oct 2025 114,049.0012 Oct 2025 110,644.0011−$3,404.54
short12 Oct 2025 110,644.0027 Oct 2025 114,559.0015−$3,915.01
long27 Oct 2025 114,559.0031 Oct 2025 108,323.004−$6,236.54
short31 Oct 2025 108,323.004 Dec 2025 93,429.9034$14,892.90
long4 Dec 2025 93,429.907 Dec 2025 89,236.803−$4,193.15
short7 Dec 2025 89,236.809 Dec 2025 90,634.402−$1,397.55
long9 Dec 2025 90,634.4015 Dec 2025 88,172.206−$2,462.19
short15 Dec 2025 88,172.2031 Dec 2025 88,485.5016−$313.34
long31 Dec 2025 88,485.5021 Jan 2026 88,427.7021−$57.84
short21 Jan 2026 88,427.703 Mar 2026 68,830.1041$19,597.60
long3 Mar 2026 68,830.109 Mar 2026 65,971.206−$2,858.86
short9 Mar 2026 65,971.2011 Mar 2026 69,948.602−$3,977.44
long11 Mar 2026 69,948.6022 Mar 2026 68,918.1011−$1,030.52
short22 Mar 2026 68,918.1026 Mar 2026 71,336.504−$2,418.41
long26 Mar 2026 71,336.5027 Mar 2026 68,820.301−$2,516.22
short27 Mar 2026 68,820.307 Apr 2026 68,853.7011−$33.35
long7 Apr 2026 68,853.7017 May 2026 78,148.1040$9,294.39
short17 May 2026 78,148.1016 Jun 2026 66,328.7030$11,819.30
long16 Jun 2026 66,328.7028 Jul 2026 63,755.9042−$2,572.88
short28 Jul 2026 63,755.906 Aug 2026 64,665.209−$909.38
long6 Aug 2026 64,665.2012 Aug 2026 63,600.006−$1,065.23
short12 Aug 2026 63,600.0019 Aug 2026 64,725.407−$1,125.41
long19 Aug 2026 64,725.4011 Sep 2026 76,568.7023$11,843.30
short11 Sep 2026 76,568.7019 Sep 2026 80,883.908−$4,315.13
long19 Sep 2026 80,883.909 Oct 2026 81,754.5020$870.60

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
AryaN this page—v5 strategy+2.8%563.3%
EMA Slope AyE by fajardoarelysemav4 strategyNo trades on this market
ROoT by realisticDove62527emav5 strategy−4.7%2259.4%
sachin5986 by mohitesachin78emav4 strategy+32.1%3517.6%
sonu1997 by Sonu1997emav4 strategy+960.7%21,103.8%
Moving Average Crossover by Muh4mm4demav4 strategy+19,990.1%301,274.2%

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?

No

The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 56 before, 42 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.

⋯// © sandipkindo-//@version=5+//@version=6strategy("My strategyP", overlay=true, margin_long=100, margin_short=100)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 6 msYes 1,000 bars in 11 msNot measured
PineTSNot testedNot testedNot 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.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © sandipkindo//@version=5strategy("My strategyP", overlay=true, margin_long=100, margin_short=100)longCondition = ta.crossover(ta.ema(close, 5), ta.ema(close, 10))if (longCondition)    strategy.entry("Buy", strategy.long)shortCondition = ta.crossunder(ta.ema(close, 6), ta.ema(close, 11))if (shortCondition)    strategy.entry("Sell" , strategy.short)