Pine Script v5 · Strategy
Soheil PKO's 5 min Hitman Scalp - 3MA + Laguerre RSI + ADX [Pt]
A Pine Script v5 strategy built on EMA (close, 16), SMA (close, 200) and Change (high). It has 7 order rules, 2 entries among them, and trades long and short with the default settings. Exits use a stop loss and a profit target. Each trade commits 100% of equity and pays no commission. 26 settings; defaults include Start Year 2011, Start Month 1 and Start Day 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 Soheil PKO's 5 min Hitman Scalp - 3MA + Laguerre RSI + ADX [Pt] repaint?
- No
- No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
- How did Soheil PKO's 5 min Hitman Scalp - 3MA + Laguerre RSI + ADX [Pt] 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. On ETHUSDT 1D it did trade; that row of the markets table below has its figures. A backtest, not investment advice.
- Does Soheil PKO's 5 min Hitman Scalp - 3MA + Laguerre RSI + ADX [Pt] 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: 8 before, 9 after on ETHUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download.
- Does Soheil PKO's 5 min Hitman Scalp - 3MA + Laguerre RSI + ADX [Pt] use a stop loss?
- Yes
- strategy.exit sets a stop on line 131, 132.
- Does Soheil PKO's 5 min Hitman Scalp - 3MA + Laguerre RSI + ADX [Pt] run in Zeal Terminal?
- Yes
- It compiles in 62 ms and runs 1,000 bars in 112 ms, in the browser.
BTCUSDT · 1D · default settings
- EMA 1
- EMA 2
- SMA 1
- Winning trade
- Losing trade
- Equity
- Buy and hold
- 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, $10,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.
-
Check
Every trade uses all the equity
default_qty_value is 100% of equity.
-
Note
1 setting has no label
In the settings dialog t1_session (line 15) shows an empty name. The labels on this page come from the variable names.
-
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.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| Backtesting window | |||
| Start Year | 2011 | int | timestart |
| Start Month | 1 | int · min 1 · max 12 | timestart |
| Start Day | 1 | int · min 1 · max 31 | timestart |
| Finish Year | 2050 | int | timefinish |
| Finish Month | 12 | int · min 1 · max 12 | timefinish |
| Finish Day | 31 | int · min 1 · max 31 | timefinish |
| Trading Session | |||
| Use Entry Session Window | false | bool | entry Long entry Short close_all line 124 line 127 line 138 |
| T1 session (no label in the script)Entry Signal only generated within this period. | 0930-1555:23456 | session | t1 |
| Trading Options | |||
| Margin Requirement / Leverage | 1 | float · step 0.1 | trade_amount |
| % of initial capital per trade | 100 | float | trade_amount |
| Reinvest profit | false | bool | line 26 |
| Reinvest percentage | 100 | float | trade_amount |
| All trades will close at the close of trading window | false | bool | close_all line 138 |
| Position must hit either SL/PT before entering new trade | false | bool | entry Long entry Short line 124 line 127 |
| Moving Average Ribbon | |||
| Fast EMA Length | 16 | int | ema1 |
| Slow EMA Length | 48 | int | ema2 |
| Slow SMA Length | 200 | int | sma1 |
| Laguerre RSI | |||
| Alpha | 0.2 | float · min 0 · max 1 · step 0.1 | gamma |
| Long entry above this threshold | 80 | int · min 1 · max 99 | bull_LaRSI |
| Short entry below this threshold | 20 | int · min 1 · max 99 | bear_LaRSI |
| ADX | |||
| ADX Smoothing | 14 | int | adx sig |
| DI Length | 14 | int | plus minus sig |
| Stop Loss / Profit Target | |||
| Use Fixed SL / PT | false | bool | Entry Price L PT S PT L SL S SL L_entry1 S_entry1 exit Exit Long exit Exit Short line 130 |
| Stop loss in ticks | 50 | float · step 1 | L_SL S_SL |
| Profit target in ticks | 100 | float · step 1 | L_PT S_PT |
| Limit same direction entry to 1 per triggerApplicable to using fixed SL/PT only. Reset on fast/slow EMA crossovers | false | bool | L_entry1 S_entry1 |
What it calculates
- EMAclose, Fast EMA Length (16)
ema1 · line 39 - EMAclose, Slow EMA Length (48)
ema2 · line 40 - SMAclose, Slow SMA Length (200)
sma1 · line 41 - Changehigh
up · line 71 - Changelow
down · line 72 - RMAta.tr, len
truerange · line 75 - RMAmath.abs(plus - minus) / (sum == 0 ? 1 : sum), ADX Smoothing (14)
adx · line 82 - Crossunderema1, ema2
L_exit1 · line 119 - Crossoverema1, ema2
S_exit1 · line 120
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.
The script has 83 named inputs, calculations, conditions and outputs, too many to draw legibly here; the tables above list them.
Order rules
| Order | Fires when | By default | Line |
|---|---|---|---|
| Open Long long | L_entry1 and (use_entry_sess ? window : true) and (close_b4_open ? strategy.position_size == 0 : true) | On | 125 |
| Open Short short | S_entry1 and (use_entry_sess ? window : true) and (close_b4_open ? strategy.position_size == 0 : true) | On | 128 |
| Exit Exit Long stop and limit | use_SLPT | Off “Use Fixed SL / PT” | 131 |
| Exit Exit Short stop and limit | use_SLPT | Off “Use Fixed SL / PT” | 132 |
| Close Long | L_exit1 | On | 135 |
| Close Short | S_exit1 | On | 137 |
| Close | use_entry_sess and not window and close_eod | On | 139 |
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 | 0.0% | +102.5% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | 0.0% | +5.5% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | +44.3% | +9.8% | 8 | 63% | 3.26 | 11.0% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | −3.7% | +8.4% | 8 | 25% | 0.74 | 8.7% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | −17.9% | +16.7% | 8 | 50% | 0.58 | 52.0% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | +19.0% | +21.5% | 6 | 50% | 2.47 | 12.9% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | +32.8% | +148.3% | 5 | 60% | 3.09 | 11.9% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | +2.2% | +17.1% | 7 | 57% | 1.65 | 4.1% | 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.
| Script | Shares | Type | Net | Trades | Max drawdown |
|---|---|---|---|---|---|
| Soheil PKO's 5 min Hitman Scalp - 3MA + Laguerre RSI + ADX [Pt] this page | — | v5 strategy | 0.0% | 0 | 0.0% |
| Optimized Keltner Channels SL-TP Strategy for BTC by chanu_lev10k | sma ema rma | v4 strategy | −19.4% | 36 | 70.0% |
| EMA-ADX-VOL-CRYPTO KILLER [15M] by Babehdyo | rma sma ema | v4 strategy | +4.5% | 22 | 5.3% |
| Contrarian Scalping Counter Trend Bb Envelope Adx and Stochastic by exlux99 | sma ema rma | v5 strategy | +1.9% | 15 | 3.2% |
| CCI + EMA with RSI Cross Strategy by rwestbrookjr | ema rma sma | v5 strategy | No trades on this market | ||
| Best TradingView Strategy - For NASDAQ and DOW30 and other Index by The_Bigger_Bull | sma rma ema | v5 strategy | +2.2% | 17 | 3.4% |
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.
- 4 settings use the untyped input() (line 6, 9, 68, 69). 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.
Same 8 trades and the same P&L on ETHUSDT 1D, 1,000 bars, in Zeal Terminal's engine.
- Line 6: input() → input.int()
- Line 9: input() → input.int()
- Line 68: input() → input.int()
- Line 69: input() → input.int()
⋯// ********************************** Trade Period / Strategy Setting **************************************-startY = input(title='Start Year', defval=2011, group = "Backtesting window")+startY = input.int(title='Start Year', defval=2011, group = "Backtesting window")startM = input.int(title='Start Month', defval=1, minval=1, maxval=12, group = "Backtesting window")startD = input.int(title='Start Day', defval=1, minval=1, maxval=31, group = "Backtesting window")-finishY = input(title='Finish Year', defval=2050, group = "Backtesting window")+finishY = input.int(title='Finish Year', defval=2050, group = "Backtesting window")finishM = input.int(title='Finish Month', defval=12, minval=1, maxval=12, group = "Backtesting window")⋯// --------------------------------------- ADX -------------------------adxlen = input(14, title="ADX Smoothing", group = group_adx)+adxlen = input.int(14, title="ADX Smoothing", group = group_adx)-dilen = input(14, title="DI Length", group = group_adx)+dilen = input.int(14, title="DI Length", group = group_adx)dirmov(len) =>⋯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: 8 before, 9 after on ETHUSDT 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.
⋯// © PtGambler-//@version=5+//@version=6strategy("3MA + Laguerre RSI + ADX [Pt]", shorttitle = "3MA+LaRSI+ADX[Pt]", overlay=true, initial_capital = 10000, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, calc_on_order_fills = false, max_bars_back = 500)⋯Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 62 ms | With a workaround 1,000 bars in 112 ms | Not measured |
| PineTS | Not tested | Not tested | Not measured |
The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.
“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/// © PtGambler//@version=5strategy("3MA + Laguerre RSI + ADX [Pt]", shorttitle = "3MA+LaRSI+ADX[Pt]", overlay=true, initial_capital = 10000, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, calc_on_order_fills = false, max_bars_back = 500)// ********************************** Trade Period / Strategy Setting **************************************startY = input(title='Start Year', defval=2011, group = "Backtesting window")startM = input.int(title='Start Month', defval=1, minval=1, maxval=12, group = "Backtesting window")startD = input.int(title='Start Day', defval=1, minval=1, maxval=31, group = "Backtesting window")finishY = input(title='Finish Year', defval=2050, group = "Backtesting window")finishM = input.int(title='Finish Month', defval=12, minval=1, maxval=12, group = "Backtesting window")finishD = input.int(title='Finish Day', defval=31, minval=1, maxval=31, group = "Backtesting window")timestart = timestamp(startY, startM, startD, 00, 00)timefinish = timestamp(finishY, finishM, finishD, 23, 59)use_entry_sess = input.bool(false, 'Use Entry Session Window', group = "Trading Session")t1_session = input.session("0930-1555:23456", "Entry Session", group="Trading Session", tooltip = "Entry Signal only generated within this period.") t1 = time(timeframe.period, t1_session)window = time >= timestart and time <= timefinish and t1 ? true : false margin_req = input.float(1, title="Margin Requirement / Leverage", step=0.1, group = "Trading Options")qty_per_trade = input.float(100, title = "% of initial capital per trade", group = "Trading Options")reinvest = input.bool(defval=false,title="Reinvest profit", group = "Trading Options")reinvest_percent = input.float(defval=100, title = "Reinvest percentage", group="Trading Options")close_eod = input.bool(false, "All trades will close at the close of trading window", group = "Trading Options")close_b4_open = input.bool(false, "Position must hit either SL/PT before entering new trade", group = "Trading Options")profit = strategy.netprofit float trade_amount = math.floor(strategy.initial_capital*margin_req / close) if strategy.netprofit > 0 and reinvest trade_amount := math.floor((strategy.initial_capital* (qty_per_trade/100)+(profit*reinvest_percent*0.01))*margin_req/ close) else trade_amount := math.floor(strategy.initial_capital* (qty_per_trade/100)*margin_req / close) // ******************************************************************************************group_ma = "Moving Average Ribbon"group_larsi = "Laguerre RSI"group_adx = "ADX"group_SL = "Stop Loss / Profit Target"// ----------------------------------------- MA Ribbon -------------------------------------ema1_len = input.int(16, "Fast EMA Length", group = group_ma)ema2_len = input.int(48, "Slow EMA Length ", group = group_ma)sma1_len = input.int(200, "Slow SMA Length", group = group_ma)ema1 = ta.ema(close, ema1_len)ema2 = ta.ema(close, ema2_len)sma1 = ta.sma(close, sma1_len)plot(ema1, "EMA 1", color.white, linewidth = 2)plot(ema2, "EMA 2", color.yellow, linewidth = 2)plot(sma1, "SMA 1", color.purple, linewidth = 2)ma_bull = ema1 > ema2 and ema2 > sma1 ma_bear = ema1 < ema2 and ema2 < sma1// ------------------------------------------ Laguerre RSI ---------------------------------------alpha = input.float(0.2, title='Alpha', minval=0, maxval=1, step=0.1, group = group_larsi)long_thres = input.int(80, 'Long entry above this threshold', minval = 1, maxval = 99, group = group_larsi)short_thres = input.int(20, 'Short entry below this threshold', minval = 1, maxval = 99, group = group_larsi)gamma = 1 - alphaL0 = 0.0L0 := (1 - gamma) * close + gamma * nz(L0[1])L1 = 0.0L1 := -gamma * L0 + nz(L0[1]) + gamma * nz(L1[1])L2 = 0.0L2 := -gamma * L1 + nz(L1[1]) + gamma * nz(L2[1])L3 = 0.0L3 := -gamma * L2 + nz(L2[1]) + gamma * nz(L3[1])cu = (L0 > L1 ? L0 - L1 : 0) + (L1 > L2 ? L1 - L2 : 0) + (L2 > L3 ? L2 - L3 : 0)cd = (L0 < L1 ? L1 - L0 : 0) + (L1 < L2 ? L2 - L1 : 0) + (L2 < L3 ? L3 - L2 : 0)temp = cu + cd == 0 ? -1 : cu + cdLaRSI = temp == -1 ? 0 : cu / tempLaRSI := LaRSI * 100bull_LaRSI = LaRSI > long_thresbear_LaRSI = LaRSI < short_thres// --------------------------------------- ADX ------------------------adxlen = input(14, title="ADX Smoothing", group = group_adx)dilen = input(14, title="DI Length", group = group_adx)dirmov(len) => up = ta.change(high) down = -ta.change(low) plusDM = na(up) ? na : (up > down and up > 0 ? up : 0) minusDM = na(down) ? na : (down > up and down > 0 ? down : 0) truerange = ta.rma(ta.tr, len) plus = fixnan(100 * ta.rma(plusDM, len) / truerange) minus = fixnan(100 * ta.rma(minusDM, len) / truerange) [plus, minus]adx(dilen, adxlen) => [plus, minus] = dirmov(dilen) sum = plus + minus adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)sig = adx(dilen, adxlen)active_adx = sig > 20 //and sig > sig[1]// ******************************* Profit Target / Stop Loss *********************************************use_SLPT = input.bool(false, 'Use Fixed SL / PT', group = group_SL)SL = input.float(50, 'Stop loss in ticks', step = 1, group = group_SL) * syminfo.mintickPT = input.float(100, "Profit target in ticks", step = 1, group = group_SL) * syminfo.minticklimit_entry = input.bool(false, "Limit same direction entry to 1 per trigger", group = group_SL, tooltip = 'Applicable to using fixed SL/PT only. Reset on fast/slow EMA crossovers')var L_PT = 0.0var S_PT = 0.0var L_SL = 0.0var S_SL = 0.0if strategy.position_size > 0 L_SL := L_SL[1] L_PT := L_PT[1]else if strategy.position_size < 0 S_SL := S_SL[1] S_PT := S_PT[1]else L_SL := close - SL L_PT := close + PT S_SL := close + SL S_PT := close - PTentry_line = plot(use_SLPT and strategy.position_size != 0 ? strategy.opentrades.entry_price(0) : na, "Entry Price", color.white, linewidth = 1, style = plot.style_linebr)L_PT_line = plot(use_SLPT and strategy.position_size > 0 ? L_PT : na, "L PT", color.green, linewidth = 2, style = plot.style_linebr)S_PT_line = plot(use_SLPT and strategy.position_size < 0 ? S_PT : na, "S PT", color.green, linewidth = 2, style = plot.style_linebr)L_SL_line = plot(use_SLPT and strategy.position_size > 0 ? L_SL : na, "L SL", color.red, linewidth = 2, style = plot.style_linebr)S_SL_line = plot(use_SLPT and strategy.position_size < 0 ? S_SL : na, "S SL", color.red, linewidth = 2, style = plot.style_linebr)fill(L_PT_line, entry_line, color = color.new(color.green,90))fill(S_PT_line, entry_line, color = color.new(color.green,90))fill(L_SL_line, entry_line, color = color.new(color.red,90))fill(S_SL_line, entry_line, color = color.new(color.red,90))// ---------------------------------- Strategy setup ------------------------------------------------------var L_entry_trigger = truevar S_entry_trigger = trueL_entry1 = ma_bull and bull_LaRSI and active_adx and (use_SLPT and limit_entry ? L_entry_trigger : true)S_entry1 = ma_bear and bear_LaRSI and active_adx and (use_SLPT and limit_entry ? S_entry_trigger : true)L_exit1 = ta.crossunder(ema1, ema2)S_exit1 = ta.crossover(ema1, ema2)// Trigger zonesbgcolor(ma_bull ? color.new(color.green ,90) : na)bgcolor(ma_bear ? color.new(color.red,90) : na)if L_entry1 and (use_entry_sess ? window : true) and (close_b4_open ? strategy.position_size == 0 : true) strategy.entry("Long", strategy.long, trade_amount) L_entry_trigger := falseif S_entry1 and (use_entry_sess ? window : true) and (close_b4_open ? strategy.position_size == 0 : true) strategy.entry("Short", strategy.short, trade_amount) S_entry_trigger := falseif use_SLPT strategy.exit("Exit Long", "Long", limit = L_PT, stop = L_SL, comment_profit = "Exit Long, PT hit", comment_loss = "Exit Long, SL hit") strategy.exit("Exit Short", "Short", limit = S_PT, stop = S_SL, comment_profit = "Exit Short, PT hit", comment_loss = "Exit Short, SL hit")else if L_exit1 strategy.close("Long", comment = "Exit Long") if S_exit1 strategy.close("Short", comment = "Exit Short")if use_entry_sess and not window and close_eod strategy.close_all(comment = "EOD close")//reset entry triggerif ta.crossunder(ema1, ema2) L_entry_trigger := trueif ta.crossover(ema1, ema2) S_entry_trigger := true