Pine Script v4 · Strategy
Aggresive Scalper-Swing Crypto Strategy
A Pine Script v4 strategy built on Lowest (low, 60), Highest (high, 60) and ATR (1). It has 3 order rules, 1 entry among them, and trades long only with the default settings. Exits use a stop loss and a profit target. Each trade is one contract and pays no commission. 4 settings; defaults include Number of candles 60, Length VORTEX 14 and TP Long 0.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 Aggresive Scalper-Swing Crypto Strategy repaint?
- No
- No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
- How did Aggresive Scalper-Swing Crypto Strategy do on BTCUSDT 1D with default settings?
- −7.36%
- From 26 Jan 2024 to 21 Oct 2026, over 3 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
- Can Aggresive Scalper-Swing Crypto Strategy be converted to Pine Script v5?
- Yes
- The upgrade takes 1 step, from v4; each was run before and after on the same candles with identical results, and the v5 script can be downloaded below.
- Does Aggresive Scalper-Swing Crypto Strategy use a stop loss?
- Yes
- strategy.exit sets a stop on line 23.
- Does Aggresive Scalper-Swing Crypto Strategy run in Zeal Terminal?
- Yes
- It compiles in 10 ms and runs 1,000 bars in 31 ms, in the browser.
BTCUSDT · 1D · default settings
- Lowest
- Highest
- ATR
- Winning trade
- Losing trade
- Equity
- Buy and hold
- Net profit
- −7.36%
- −$7,360.05
- Buy and hold
- +102.5%
- same period
- Closed trades
- 3
- 1 won · 2 lost
- Profitable
- 33.3%
- of closed trades
- Profit factor
- 0.56
- gross profit ÷ gross loss
- Max drawdown
- 16.03%
- −$17,525.70
One run with the author's default settings, $100,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.
-
Note
Uses an argument v6 removed
when = on line 22, 24. 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 lowest → ta.lowest, highest → ta.highest, sum → math.sum, abs → math.abs, atr → ta.atr, crossover → ta.crossover, crossunder → ta.crossunder.
- 2 strategy calls use the when = argument (line 22, 24). It is deprecated in v5 and removed in v6, where each call moves inside an if block.
v4 → v5
VerifiedSame 3 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.
- Line 3: //@version=4 → //@version=5
- Line 6: lowest → ta.lowest
- Line 7: highest → ta.highest
- Line 13: sum → math.sum
- Line 13: abs → math.abs
- Line 14: sum → math.sum
8 more edits
- Line 14: abs → math.abs
- Line 15: sum → math.sum
- Line 15: atr → ta.atr
- Line 18: crossover → ta.crossover
- Line 18: crossover → ta.crossover
- Line 19: crossunder → ta.crossunder
- Line 19: crossunder → ta.crossunder
- Line 22: strategy.entry(…, 1) → strategy.entry(…, strategy.long)
⋯// © exlux99-//@version=4+//@version=5strategy(title="Crypto Price Scalper", shorttitle="Scalper Crypto", overlay=true)inputcc = input(60, title="Number of candles")-low9=lowest(low,inputcc)+low9=ta.lowest(low,inputcc)-high9=highest(high,inputcc)+high9=ta.highest(high,inputcc)plotlow = ((close - low9) / low9) * 100⋯period_ = input(14, title="Length VORTEX", minval=2)-VMP = sum( abs( high - low[1]), period_ )+VMP = math.sum( math.abs( high - low[1]), period_ )-VMM = sum( abs( low - high[1]), period_ )+VMM = math.sum( math.abs( low - high[1]), period_ )-STR = sum( atr(1), period_ )+STR = math.sum( ta.atr(1), period_ )VIP = VMP / STRVIM = VMM / STR-long= crossover(plotg,center) and close > high[2] and crossover(VIP,VIM)+long= ta.crossover(plotg,center) and close > high[2] and ta.crossover(VIP,VIM)-short= crossunder(plotg,center) and crossunder(VIP,VIM)+short= ta.crossunder(plotg,center) and ta.crossunder(VIP,VIM)tplong=input(0.1, title="TP Long", step=0.01)sllong=input(0.1, title="SL Long", step=0.01)-strategy.entry("long",1,when=long)+strategy.entry("long",strategy.long,when=long)strategy.exit("closelong", "long" , profit = close * tplong / syminfo.mintick, loss = close * sllong / syminfo.mintick, alert_message = "closelong")⋯Same 3 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.
- Line 5: input() → input.int()
- Line 12: input() → input.int()
- Line 20: input() → input.float()
- Line 21: input() → input.float()
- Line 22: when = long → if block
- Line 24: when = short → if block
⋯strategy(title="Crypto Price Scalper", shorttitle="Scalper Crypto", overlay=true)-inputcc = input(60, title="Number of candles")+inputcc = input.int(60, title="Number of candles")low9=ta.lowest(low,inputcc)⋯center=0.0-period_ = input(14, title="Length VORTEX", minval=2)+period_ = input.int(14, title="Length VORTEX", minval=2)VMP = math.sum( math.abs( high - low[1]), period_ )⋯short= ta.crossunder(plotg,center) and ta.crossunder(VIP,VIM)-tplong=input(0.1, title="TP Long", step=0.01)+tplong=input.float(0.1, title="TP Long", step=0.01)-sllong=input(0.1, title="SL Long", step=0.01)+sllong=input.float(0.1, title="SL Long", step=0.01)-strategy.entry("long",strategy.long,when=long)+if long+ strategy.entry("long",strategy.long)strategy.exit("closelong", "long" , profit = close * tplong / syminfo.mintick, loss = close * sllong / syminfo.mintick, alert_message = "closelong")-strategy.close("long",when=short)+if short+ strategy.close("long")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: 3 before, 2 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.
⋯// © exlux99-//@version=5+//@version=6strategy(title="Crypto Price Scalper", shorttitle="Scalper Crypto", overlay=true)⋯Settings
Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| Number of candles | 60 | int | low9 high9 |
| Length VORTEX | 14 | int · min 2 | VMP VMM STR |
| TP Long | 0.1 | float · step 0.01 | exit closelong |
| SL Long | 0.1 | float · step 0.01 | exit closelong |
What it calculates
- Lowest (
lowest,ta.lowestin v5)low, Number of candles (60)low9 · line 6 - Highest (
highest,ta.highestin v5)high, Number of candles (60)high9 · line 7 - ATR (
atr,ta.atrin v5)1STR · line 15
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.
Order rules
| Order | Fires when | By default | Line |
|---|---|---|---|
| Open long long | longcrossover(plotg,center) and close > high[2] and crossover(VIP,VIM) | On | 22 |
| Exit closelong stop and limit | every bar | On | 23 |
| Close long | shortcrossunder(plotg,center) and crossunder(VIP,VIM) | On | 24 |
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.
- 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.
| Market | Net | Buy and hold | Trades | Won | Profit factor | Max drawdown | Period |
|---|---|---|---|---|---|---|---|
| BTCUSDT 1D | −7.4% | +102.5% | 3 | 33% | 0.56 | 16.0% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | +9.4% | +5.5% | 3 | 67% | 24.16 | 6.0% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | −0.1% | +9.8% | 3 | 33% | 0.72 | 0.4% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | −0.1% | +8.4% | 2 | 0% | 0.00 | 0.1% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | +0.0% | +16.7% | 5 | 80% | 2.01 | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | +0.0% | +21.5% | 4 | 50% | 1.41 | 0.0% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | 0.0% | +148.3% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | +0.1% | +17.1% | 4 | 50% | 7.08 | 0.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 bars | Trades | Won | P&L |
|---|---|---|---|
| Rising market | 0 | — | $0.00 |
| Sideways market | 3 | 33% | −$7,360.05 |
| Falling market | 0 | — | $0.00 |
Rising and falling mean the market moved more than 15% over the 90 bars before entry.
How bad could the drawdown be?
15.3%
The 95th percentile of the worst drawdown when the same 3 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 11.1% to 15.3%; the tick is what actually happened, 15.3%. Order luck alone moves it this much.
All 3 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| long | 13 Apr 2025 85,276.90 | 23 Apr 2025 94,621.20 | 10 | $9,344.30 |
| long | 2 Oct 2025 118,595.00 | 10 Oct 2025 106,429.00 | 8 | −$12,166.20 |
| long | 27 Oct 2025 114,559.00 | 30 Oct 2025 110,021.00 | 3 | −$4,538.11 |
Similar scripts
Indicators and strategies built from the same calculations, run on BTCUSDT 1D with their own defaults so they can be compared directly.
| Script | Shares | Type | Net | Trades | Max drawdown |
|---|---|---|---|---|---|
| Aggresive Scalper-Swing Crypto Strategy this page | — | v4 strategy | −7.4% | 3 | 16.0% |
| Donchian Channels Strategy by KrisWaters by kriswaters | highest lowest atr | v4 strategy | +55.8% | 21 | 23.3% |
| Chandelier Exit - Strategy by melihtuna | atr highest lowest | v4 strategy | −34.8% | 11 | 43.2% |
| ETF trader by FX_minds | atr lowest highest | v4 strategy | +78.3% | 17 | 32.7% |
| Chandelier Exit by Zeal Terminal | atr highest lowest | v5 indicator | indicator | ||
| DC Breakout Strategy - This is simplicity at its finest. by Robrecht99 | highest lowest atr | v5 strategy | +10.8% | 57 | 8.3% |
Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 10 ms | With a workaround 1,000 bars in 31 ms | Not measured |
| PineTS | No 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 22) 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="Crypto Price Scalper", shorttitle="Scalper Crypto", overlay=true)inputcc = input(60, title="Number of candles")low9=lowest(low,inputcc)high9=highest(high,inputcc)plotlow = ((close - low9) / low9) * 100plothigh = ((close - high9) / high9) * 100plotg = (plotlow +plothigh)/2center=0.0period_ = input(14, title="Length VORTEX", minval=2)VMP = sum( abs( high - low[1]), period_ )VMM = sum( abs( low - high[1]), period_ )STR = sum( atr(1), period_ )VIP = VMP / STRVIM = VMM / STRlong= crossover(plotg,center) and close > high[2] and crossover(VIP,VIM)short= crossunder(plotg,center) and crossunder(VIP,VIM)tplong=input(0.1, title="TP Long", step=0.01)sllong=input(0.1, title="SL Long", step=0.01)strategy.entry("long",1,when=long)strategy.exit("closelong", "long" , profit = close * tplong / syminfo.mintick, loss = close * sllong / syminfo.mintick, alert_message = "closelong")strategy.close("long",when=short)