Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Profitable Contrarian scalping

A Pine Script v5 strategy built on VWMA or SMA (close,5, 5). 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 100% of equity and pays no commission. 3 settings; defaults include Length1 5, Length2 200 and Stop length 20.

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

BTCUSDT · 1D · default settings

  • 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 (3)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$517,698$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. Lines are what the script plots.
Net profit
−48.24%
−$482,374.00
Buy and hold
+102.5%
same period
Closed trades
7
4 won · 3 lost
Profitable
57.1%
of closed trades
Profit factor
0.27
gross profit ÷ gross loss
Max drawdown
60.24%
−$691,237.00

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

  • Check

    Every trade uses all the equity

    default_qty_value is 100% of equity.

  • 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
Length15intvwma1
Length2200intvwma2
Stop length20intvwma3

What it calculates

  • VWMA / SMAta.sma(close,5), Length1 (5)vwma1 · line 8
  • VWMA / SMAta.sma(close,5), Length2 (200)vwma2 · line 9
  • VWMA / SMAta.sma(close, 5), Stop length (20)vwma3 · line 10

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 datalength1Length1setting · 5length2Length2setting · 200length3Stop lengthsetting · 20vwma1VWMA / SMA→ vwma1vwma2VWMA / SMA→ vwma2vwma3VWMA / SMA→ vwma3entry:ShortOpen Shortstrategy.entryclose:ShortClose Shortstrategy.closeentry:LongOpen Longstrategy.entryclose:LongClose Longstrategy.closeplot:11plotplotplot:12plotplot

Order rules

OrderFires whenBy defaultLine
Open Short shortta.crossover(vwma1, vwma2)On14
Close Shortta.crossunder(vwma1, vwma3)On16
Open Long longta.crossunder(vwma1, vwma2)On18
Close Longta.crossover(vwma1, vwma3)On20

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.

1/1trades 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−48.2%+102.5%757%0.2760.2%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−17.3%+5.5%863%0.1726.2%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−60.3%+9.8%743%0.0667.6%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h−31.7%+8.4%425%0.0135.4%8 May 2026 – 21 Oct 2026
SOLUSDT 1D−47.4%+16.7%933%0.2857.2%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h−1.0%+21.5%683%0.9215.3%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+30.7%+148.3%1471%1.6431.1%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+2.6%+17.1%863%1.715.7%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 market0—$0.00
Sideways market650%−$509,913.00
Falling market1100%$27,539.50

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

How bad could the drawdown be?

57.3%

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

0%66%
All 7 trades
SideEntryExitBarsP&L
short30 Sep 2024 65,602.005 Oct 2024 62,086.005$53,596.10
long5 Oct 2024 62,086.0017 Oct 2024 67,620.0012$93,911.70
short17 Oct 2024 67,620.0025 Dec 2024 98,663.6069−$526,808.00
long13 Mar 2025 83,680.1026 Mar 2025 87,392.9013$27,539.50
short27 Apr 2025 94,628.004 Jun 2025 105,377.0038−$73,634.20
long5 Nov 2025 101,497.008 Dec 2025 90,395.3033−$62,851.10
short24 Aug 2026 77,734.0014 Sep 2026 76,842.0021$5,872.33

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
Profitable Contrarian scalping this page—v5 strategy−48.2%760.2%
Volume fight strategy by Shuttle_Clubvwma smav5 strategy+92.0%4524.6%
Volume Weighted Moving Average by Zeal Terminalvwma smav5 indicatorindicator
Wave Trend w- VWMA overlay by jadamcraigvwma smav4 strategyNo trades on this market
VWMA-SMA 3Commas Bot by CrackingCryptocurrencysma vwmav5 strategy−1,774,150,000.0%15750,545.9%
Smoothed Heikin Ashi Trend on Chart - TraderHalai BACKTEST by TraderHalaisma vwmav5 strategy+1.3%1135.6%

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.

  • 3 settings use the untyped input() (line 5, 6, 7). It still compiles in v6; input.int, input.float or input.source state the type.
  • No v6-only features. v6 is not needed to run this script.

Clean v5

VerifiedDownload the v5 script

Same 7 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 5: input() → input.int()
  • Line 6: input() → input.int()
  • Line 7: input() → input.int()
⋯strategy("Smooth VWMA scalping contrarian", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)-length1 = input(5, title = "Length1")+length1 = input.int(5, title = "Length1")-length2 = input(200, title = "Length2")+length2 = input.int(200, title = "Length2")-length3 = input(20, title = "Stop length")+length3 = input.int(20, title = "Stop length")vwma1 = ta.vwma(ta.sma(close,5), length1)⋯

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

⋯// © Jaerevan47-//@version=5+//@version=6strategy("Smooth VWMA scalping contrarian", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 22 msYes 1,000 bars in 25 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/// © Jaerevan47//@version=5strategy("Smooth VWMA scalping contrarian", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)length1 = input(5, title = "Length1")length2 = input(200, title = "Length2")length3 = input(20, title = "Stop length")vwma1 = ta.vwma(ta.sma(close,5), length1)vwma2 = ta.vwma(ta.sma(close,5), length2)vwma3 = ta.vwma(ta.sma(close, 5), length3)plot(vwma1)plot(vwma2, color = color.white)if ta.crossover(vwma1, vwma2)    strategy.entry("Short", strategy.short)if ta.crossunder(vwma1, vwma3)    strategy.close("Short")if ta.crossunder(vwma1, vwma2)    strategy.entry("Long", strategy.long)if ta.crossover(vwma1, vwma3)    strategy.close("Long")