Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

EMA SCALPEUR + RSi - SHORT

A Pine Script v5 strategy built on RSI (close, 5), EMA (close, 9) and Crossover (EMA3, EMA4). It has 2 order rules, 1 entry among them, and trades short only with the default settings. Exits wait for a signal; there is no stop loss. Each trade is one contract and pays no commission. 5 settings; defaults include EMA_L 9, EMA_L2 26 and EMA_S 100.

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 EMA SCALPEUR + RSi - SHORT repaint?
No
No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
How did EMA SCALPEUR + RSi - SHORT 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; it opened a short position that was still open on the last bar, so there is no result to report. On BTCUSDT 4h it did trade; that row of the markets table below has its figures. A backtest, not investment advice.
Does EMA SCALPEUR + RSi - SHORT 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: 0 before, 1 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 EMA SCALPEUR + RSi - SHORT use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does EMA SCALPEUR + RSi - SHORT run in Zeal Terminal?
Yes
It compiles in 16 ms and runs 1,000 bars in 29 ms, in the browser.

BTCUSDT · 1D · default settings

  • Plot
  • Plot
  • Plot
  • Plot
  • Plot
  • 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 (5)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$-6,086$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.
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
978.01%
−$9,780.15

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

  • Likely bug

    ta.ema(close, 9) ignores the settings line 13

    Line 13 hard-codes 9 where line 23 uses “EMA_L”. Changing those settings moves one band but not this one.

    ta.ema(close, 9)ta.ema(close, EMA_L)
  • Likely bug

    ta.ema(close, 26) ignores the settings line 14

    Line 14 hard-codes 26 where line 23 uses “EMA_L”. Changing those settings moves one band but not this one.

    ta.ema(close, 26)ta.ema(close, EMA_L)
  • Likely bug

    ta.ema(close, 100) ignores the settings line 15

    Line 15 hard-codes 100 where line 23 uses “EMA_L”. Changing those settings moves one band but not this one.

    ta.ema(close, 100)ta.ema(close, EMA_L)
  • Likely bug

    ta.ema(close, 55) ignores the settings line 16

    Line 16 hard-codes 55 where line 23 uses “EMA_L”. Changing those settings moves one band but not this one.

    ta.ema(close, 55)ta.ema(close, EMA_L)
  • 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 an argument v6 removed

    when = on line 32, 34. 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
EMA_L9int · min 1 · max 100 · step 1EMA1
EMA_L226int · min 1 · max 100 · step 1EMA2
EMA_S100int · min 1 · max 100 · step 1EMA3
EMA_S255int · min 1 · max 100 · step 1EMA4
RSI5int · min 1 · max 20 · step 1RSI

What it calculates

  • RSIclose, RSI (5)RSI · line 12
  • EMAclose, 9shortest · line 13
  • EMAclose, 26short · line 14
  • EMAclose, 100longer · line 15
  • EMAclose, 55longest · line 16
  • EMAclose, EMA_L (9)EMA1 · line 23
  • EMAclose, EMA_L2 (26)EMA2 · line 24
  • EMAclose, EMA_S (100)EMA3 · line 25
  • EMAclose, EMA_S2 (55)EMA4 · line 26
  • CrossoverEMA3, EMA4sellexit · line 30

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 dataRSI1RSIsetting · 5EMA_LEMA_Lsetting · 9EMA_L2EMA_L2setting · 26EMA_SEMA_Ssetting · 100EMA_S2EMA_S2setting · 55RSIRSI→ RSIshortestEMA→ shortestshortEMA→ shortlongerEMA→ longerlongestEMA→ longestEMA1EMA→ EMA1EMA2EMA→ EMA2EMA3EMA→ EMA3EMA4EMA→ EMA4sellexitCrossover→ sellexitsellsellconditionentry:shortOpen shortstrategy.entryclose:shortClose shortstrategy.closeplot:17plotplotplot:18plotplotplot:19plotplotplot:20plotplotplot:21plotplot

Order rules

OrderFires whenBy defaultLine
Open short shortsellta.crossunder(EMA1, EMA2) and RSI > 40On32
Close shortsellexitOn34

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%—978.0%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+443.6%+5.5%2100%—54.4%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−12.5%+9.8%10%0.00160.0%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h−57.2%+8.4%10%0.0090.4%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+7.4%+16.7%1100%—0.4%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h−0.7%+21.5%10%0.002.2%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−28.6%+148.3%10%0.0076.4%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h−17.4%+17.1%10%0.0023.9%8 May 2026 – 21 Oct 2026

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

Settings heatmap

Two settings that feed the entry signal, moved around their defaults. The best in-sample pair (EMA_L 5, EMA_L2 44) made +2,133.5% before 26 Dec 2025 and 0.0% after it, against 0.0% for the defaults. 59% of the 56 combinations made money in-sample and 0% out-of-sample.

Before 26 Dec 2025 · in-sample
EMA_L2 ↓ · EMA_L →5689111315
13+793%+171%+176%+1,142%−511%0%−2,002%
16+932%+1,213%−1,615%+1,717%+1,128%+40%0%
18+1,208%0%+1,107%+1,107%+40%0%0%
220%0%+1,128%+1,128%+1,117%+1,111%0%
260%+1,107%+1,128%0%0%0%0%
31−2,612%+1,107%0%0%0%+1,039%+1,026%
360%+1,128%+1,039%+1,026%+1,026%+1,579%+593%
44+2,134%+1,021%+558%+593%0%0%+1,309%
From 26 Dec 2025 · out-of-sample
EMA_L2 ↓ · EMA_L →5689111315
130%0%0%0%0%0%0%
160%0%0%0%0%0%0%
180%0%0%0%0%0%0%
220%0%0%0%0%0%0%
260%0%0%0%0%0%0%
310%0%0%0%0%0%0%
360%0%0%0%0%0%0%
440%0%0%0%0%0%0%

Net P&L of trades opened in each period, as a share of starting capital. marks the defaults and the best in-sample cell. Hover a cell for its trade count. 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
EMA SCALPEUR + RSi - SHORT this page—v5 strategy0.0%0978.0%
RSI Cross [xaurr] by livetrendrsi emav4 strategy+24.4%5335.3%
Bitpanda Coinrule Template by joshuajcoop01rsi emav5 strategy−2.8%44.6%
RSI with Slow and Fast MA Crossing Strategy (by Coinrule) by Coinrulersi emav5 strategy−2.8%44.6%
RSI of VWAP by mohaneersi emav4 strategyNo trades on this market
BTC Sentiment analysis RSI 2xEMA by exlux99rsi emav4 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.

  • 2 strategy calls use the when = argument (line 32, 34). 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 2 trades and the same P&L on BTCUSDT 4h, 1,000 bars, in Zeal Terminal's engine.

  • Line 32: when = sell → if block
  • Line 34: when = sellexit → if block
⋯/////strategy-strategy.entry ("short", strategy.short, when = sell, comment = "ENTER-SHORT")+if sell+    strategy.entry ("short", strategy.short, comment = "ENTER-SHORT")///// market exit-strategy.close ("short",  when = sellexit, comment = "EXIT-SHORT")+if sellexit+    strategy.close ("short", comment = "EXIT-SHORT")

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: 0 before, 1 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.

⋯// © YukalMoon-//@version=5+//@version=6strategy(title="EMA SCALPEUR", overlay=true, initial_capital = 1000)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 16 msYes 1,000 bars in 29 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/// © YukalMoon//@version=5strategy(title="EMA SCALPEUR", overlay=true, initial_capital = 1000)//// input controlsEMA_L = input.int (title = "EMA_L", defval = 9, minval = 1, maxval = 100, step =1)EMA_L2 = input.int (title = "EMA_L2", defval = 26, minval = 1, maxval = 100, step =1)EMA_S = input.int (title = "EMA_S", defval = 100, minval = 1, maxval = 100, step =1)EMA_S2 = input.int (title = "EMA_S2", defval = 55, minval = 1, maxval = 100, step =1)RSI1 = input.int (title = "RSI", defval = 5, minval = 1, maxval = 20 , step = 1)/// mise en place de emaRSI = ta.rsi(close, RSI1)shortest = ta.ema(close, 9)short = ta.ema(close, 26)longer = ta.ema(close, 100)longest = ta.ema(close, 55)plot(shortest, color = color.red)plot(short, color = color.orange)plot(longer, color = color.aqua)plot(longest, color = color.yellow)plot(close)//// trading indicatorsEMA1 = ta.ema (close,EMA_L)EMA2 = ta.ema (close,EMA_L2)EMA3 = ta.ema (close, EMA_S)EMA4 = ta.ema (close, EMA_S2)//buy = ta.crossover(EMA1, EMA2) and RSI > 60 and RSI <70sell = ta.crossunder(EMA1, EMA2) and RSI > 40//buyexit = ta.crossunder(EMA3, EMA4)sellexit = ta.crossover(EMA3, EMA4)/////strategystrategy.entry ("short", strategy.short, when = sell, comment = "ENTER-SHORT")///// market exitstrategy.close ("short",  when = sellexit, comment = "EXIT-SHORT")