Pine Script v5 · Strategy
Daily_Mid Term_Consulting BOLT
A Pine Script v5 strategy built on SMA (close, 1) and RSI (close, 9). 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 is one contract and pays no commission. 12 settings; defaults include longitud_sma 58, Length1 18 and Length2 18.
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 Daily_Mid Term_Consulting BOLT repaint?
- No
- No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 2 of 2 trades.
- How did Daily_Mid Term_Consulting BOLT do on BTCUSDT 1D with default settings?
- −1.88%
- From 26 Jan 2024 to 21 Oct 2026, over 8 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
- Does Daily_Mid Term_Consulting BOLT 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, 48 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 Daily_Mid Term_Consulting BOLT use a stop loss?
- No
- Every exit waits for a signal; nothing limits a losing trade before it fires.
- Does Daily_Mid Term_Consulting BOLT run in Zeal Terminal?
- Yes
- It compiles in 29 ms and runs 1,000 bars in 67 ms, in the browser.
BTCUSDT · 1D · default settings
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- HLine
- HLine
- Plot
- Winning trade
- Net profit
- −1.88%
- −$18,818.70
- Buy and hold
- +102.5%
- same period
- Closed trades
- 8
- 1 won · 7 lost
- Profitable
- 12.5%
- of closed trades
- Profit factor
- 0.39
- gross profit ÷ gross loss
- Max drawdown
- 3.81%
- −$38,086.10
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.
-
Likely bug
ta.sma(close, 1) ignores the settings line 7
Line 7 hard-codes 1 where line 20 uses “Length1”. Changing those settings moves one band but not this one.
ta.sma(close, 1)ta.sma(close, Length1) -
Likely bug
ta.sma(low, 1) ignores the settings line 8
Line 8 hard-codes 1 where line 20 uses “Length1”. Changing those settings moves one band but not this one.
ta.sma(low, 1)ta.sma(low, Length1) -
Likely bug
ta.sma(porcentaje, 333) ignores the settings line 48
Line 48 hard-codes 333 where line 20 uses “Length1”. Changing those settings moves one band but not this one.
ta.sma(porcentaje, 333)ta.sma(porcentaje, Length1) -
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
11 settings have no label
In the settings dialog Length1 (line 9), Length2 (line 10), Length3 (line 11), Length4 (line 12), Length5 (line 13), Length6 (line 14), Length7 (line 15), Length8 (line 16), Length9 (line 17), Length10 (line 18), Length11 (line 19) show 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.
-
Note
Uses an argument v6 removed
when = on line 52, 53, 57, 58. 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.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| longitud_sma | 58 | int | ma |
| Length1 (no label in the script) | 18 | int | ma1 |
| Length2 (no label in the script) | 18 | int | ma2 |
| Length3 (no label in the script) | 26 | int | ma3 |
| Length4 (no label in the script) | 36 | int | ma4 |
| Length5 (no label in the script) | 78 | int | ma5 |
| Length6 (no label in the script) | 1 | int | ma6 |
| Length7 (no label in the script) | 1500 | int | ma7 |
| Length8 (no label in the script) | 58 | int | ma8 |
| Length9 (no label in the script) | 3000 | int | ma9 |
| Length10 (no label in the script) | 2 | int | ma10 |
| Length11 (no label in the script) | 14 | int | ma11 |
What it calculates
- SMAclose, 1
px · line 7 - SMAlow, 1
px2 · line 8 - SMAlow, Length1 (18)
ma1 · line 20 - SMAhigh, Length2 (18)
ma2 · line 21 - SMAclose, Length3 (26)
ma3 · line 22 - SMAclose, Length4 (36)
ma4 · line 23 - SMAclose, Length5 (78)
ma5 · line 24 - SMAclose, Length6 (1)
ma6 · line 25 - SMAclose, Length7 (1500)
ma7 · line 26 - SMAclose, Length8 (58)
ma8 · line 27 - SMAclose, Length9 (3000)
ma9 · line 28 - SMAclose, Length10 (2)
ma10 · line 29 - SMAclose, Length11 (14)
ma11 · line 30 - RSIclose, 9
rsi · line 43 - SMAclose, longitud_sma (58)
ma · line 45 - SMAporcentaje, 333
ma_dista · line 48
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 66 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 BUY long | longma1[1] < ma1 and ma2[1] < ma2 and macd > 0 and px > ma3 and efi_indicador < 9 and px > ma7 and macd[1] < macd | On | 52 |
| Close BUY | clongefi_indicador > 22000 and px < ma8 | On | 53 |
| Open SELL short | shortma1[1] > ma1 and ma2[1] > ma2 and macd < 0 and px < ma3 and efi_indicador > 9 and macd[1] > macd | On | 57 |
| Close SELL | cshortefi_indicador < 14000 and px > ma8 and ma11 > desv | On | 58 |
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.
- 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 | −1.9% | +102.5% | 8 | 13% | 0.39 | 3.8% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | +0.8% | +5.5% | 9 | 33% | 2.40 | 0.4% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | +0.2% | +9.8% | 6 | 67% | 4.37 | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | +0.0% | +8.4% | 8 | 25% | 1.76 | 0.0% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | −0.0% | +16.7% | 10 | 30% | 0.46 | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | +0.0% | +21.5% | 6 | 50% | 7.39 | 0.0% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | −0.0% | +148.3% | 8 | 13% | 0.07 | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | −0.0% | +17.1% | 8 | 25% | 0.26 | 0.0% | 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 (longitud_sma 29, Length1 9) made −1.3% before 26 Dec 2025 and −0.7% after it, worse than the defaults' −0.2% after. Tuning on the past did not carry forward. 0% of the 64 combinations made money in-sample and 0% out-of-sample.
| Length1 ↓ · longitud_sma → | 29 | 35 | 41 | 49 | 58 | 70 | 81 | 99 |
|---|---|---|---|---|---|---|---|---|
| 9 | −1% | −1% | −1% | −1% | −1% | −1% | −1% | −1% |
| 11 | −2% | −2% | −2% | −2% | −2% | −2% | −2% | −2% |
| 13 | −2% | −2% | −2% | −2% | −2% | −2% | −2% | −2% |
| 15 | −2% | −2% | −2% | −2% | −2% | −2% | −2% | −2% |
| 18 | −2% | −2% | −2% | −2% | −2% | −2% | −2% | −2% |
| 22 | −2% | −2% | −2% | −2% | −2% | −2% | −2% | −2% |
| 25 | −2% | −2% | −2% | −2% | −2% | −2% | −2% | −2% |
| 31 | −2% | −2% | −2% | −2% | −2% | −2% | −2% | −2% |
| Length1 ↓ · longitud_sma → | 29 | 35 | 41 | 49 | 58 | 70 | 81 | 99 |
|---|---|---|---|---|---|---|---|---|
| 9 | −1% | −1% | −1% | −1% | −1% | −1% | −1% | −1% |
| 11 | −0% | −0% | −0% | −0% | −0% | −0% | −0% | −0% |
| 13 | −1% | −1% | −1% | −1% | −1% | −1% | −1% | −1% |
| 15 | −0% | −0% | −0% | −0% | −0% | −0% | −0% | −0% |
| 18 | −0% | −0% | −0% | −0% | −0% | −0% | −0% | −0% |
| 22 | −0% | −0% | −0% | −0% | −0% | −0% | −0% | −0% |
| 25 | −0% | −0% | −0% | −0% | −0% | −0% | −0% | −0% |
| 31 | −0% | −0% | −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.
The trades
By market direction
| At entry, last 90 bars | Trades | Won | P&L |
|---|---|---|---|
| Rising market | 1 | 0% | −$5,406.52 |
| Sideways market | 5 | 20% | −$2,507.17 |
| Falling market | 2 | 0% | −$10,905.00 |
Rising and falling mean the market moved more than 15% over the 90 bars before entry.
How bad could the drawdown be?
3.1%
The 95th percentile of the worst drawdown when the same 8 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 1.9% to 3.1%; the tick is what actually happened, 2.8%. Order luck alone moves it this much.
All 8 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| short | 11 May 2024 60,800.00 | 16 May 2024 66,206.50 | 5 | −$5,406.52 |
| short | 8 Jul 2024 55,857.80 | 17 Jul 2024 65,044.00 | 9 | −$9,186.19 |
| short | 6 Aug 2024 54,018.80 | 24 Aug 2024 64,037.20 | 18 | −$10,018.40 |
| short | 29 Aug 2024 59,034.90 | 19 Sep 2024 61,760.00 | 21 | −$2,725.08 |
| short | 27 Feb 2025 84,250.10 | 20 Apr 2025 85,077.00 | 52 | −$826.91 |
| short | 8 Nov 2025 103,339.00 | 5 Jan 2026 91,529.70 | 58 | $11,809.30 |
| short | 5 Feb 2026 73,165.80 | 17 Mar 2026 74,884.70 | 40 | −$1,718.83 |
| short | 18 Jun 2026 64,509.40 | 21 Jul 2026 65,255.50 | 33 | −$746.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 |
|---|---|---|---|---|---|
| Daily_Mid Term_Consulting BOLT this page | — | v5 strategy | −1.9% | 8 | 3.8% |
| SRJ RSI Outperformer Strategy by Sapt_Jash | rsi sma | v5 strategy | +0.6% | 8 | 2.4% |
| RSI SMA Crossover Strategy by reees | rsi sma | v5 strategy | +39.8% | 42 | 30.8% |
| Short In Downtrend Below MA100 (Coinrule) by Coinrule | sma rsi | v4 strategy | −34.5% | 99 | 45.4% |
| Simple RSI and SMA Long and Short (by Coinrule) by Coinrule | rsi sma | v5 strategy | −3.0% | 2 | 17.7% |
| Maximized Moving Average Crossing (by Coinrule) by Coinrule | sma rsi | v4 strategy | −6.6% | 9 | 13.3% |
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 strategy calls use the when = argument (line 52, 53, 57, 58). It is deprecated in v5 and removed in v6, where each call moves inside an if block.
- 1 setting uses the untyped input() (line 6). 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 BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.
- Line 6: input() → input.int()
- Line 52: when = long → if block
- Line 53: when = clong → if block
- Line 57: when = short → if block
- Line 58: when = cshort → if block
⋯//calculo longuitud-longuitud = input(58, title= "longitud_sma")+longuitud = input.int(58, title= "longitud_sma")px = ta.sma(close, 1)⋯clong = efi_indicador > 22000 and px < ma8-strategy.entry("BUY", strategy.long, when = long)+if long+ strategy.entry("BUY", strategy.long)-strategy.close("BUY", when = clong)+if clong+ strategy.close("BUY")//condición de entrada y salida short⋯cshort = efi_indicador < 14000 and px > ma8 and ma11 > desv-strategy.entry("SELL", strategy.short, when = short)+if short+ strategy.entry("SELL", strategy.short)-strategy.close("SELL", when = cshort)+if cshort+ strategy.close("SELL")//SL Y TP⋯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, 48 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.
⋯// © murdocksilva-//@version=5+//@version=6strategy("Daily_Mid Term_Consulting BOLT")⋯Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 29 ms | Yes 1,000 bars in 67 ms | Not measured |
| PineTS | Not tested | Not tested | Not 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/// © murdocksilva//@version=5strategy("Daily_Mid Term_Consulting BOLT")//calculo longuitudlonguitud = input(58, title= "longitud_sma")px = ta.sma(close, 1)px2 = ta.sma(low, 1)Length1 = input.int(18)Length2 = input.int(18)Length3 = input.int(26)Length4 = input.int(36)Length5 = input.int(78)Length6 = input.int(1)Length7 = input.int(1500)Length8 = input.int(58)Length9 = input.int(3000)Length10 = input.int(2)Length11 = input.int(14)ma1 = ta.sma(low, Length1)ma2 = ta.sma(high, Length2)ma3 = ta.sma(close, Length3)ma4 = ta.sma(close, Length4)ma5 = ta.sma(close, Length5)ma6 = ta.sma(close, Length6)ma7 = ta.sma(close, Length7)ma8 = ta.sma(close, Length8)ma9 = ta.sma(close, Length9)ma10 = ta.sma(close, Length10)ma11 = ta.sma(close, Length11)// calculo EFIefi = (close[1]-close) * volume / 1000efi_indicador = (efi[1] + efi) / 2//Variable RSI - calculo desv estandarb = (px-ma10)*(px-ma10)b2 = (px[1]-ma10[1])*(px[1]-ma10[1])c = b + b2c2 = c / 2desv = math.sqrt(c2)/10//calculo MACDmacd = ma4 - ma5//calculo RSIrsi = ta.rsi(close, 9)// calculo Divergenciama = ta.sma(close, longuitud)dist = close - maporcentaje = dist * 100 / closema_dista = ta.sma(porcentaje, 333)//condición de entrada y salida longlong = ma1[1] < ma1 and ma2[1] < ma2 and macd > 0 and px > ma3 and efi_indicador < 9 and px > ma7 and macd[1] < macdclong = efi_indicador > 22000 and px < ma8strategy.entry("BUY", strategy.long, when = long)strategy.close("BUY", when = clong)//condición de entrada y salida shortshort = ma1[1] > ma1 and ma2[1] > ma2 and macd < 0 and px < ma3 and efi_indicador > 9 and macd[1] > macd cshort = efi_indicador < 14000 and px > ma8 and ma11 > desvstrategy.entry("SELL", strategy.short, when = short)strategy.close("SELL", when = cshort)//SL Y TP//strategy.exit("long exit", "Daily_Mid Term_Consulting BOLT", profit = close * 40 / syminfo.mintick, loss = close * 0.02 / syminfo.mintick)//strategy.exit("shot exit", "Daily_Mid Term_Consulting BOLT", profit = close * 40 / syminfo.mintick, loss = close * 0.02 / syminfo.mintick)// GRAFICA smasplot(ma1, color=color.new(color.orange, 0))plot(ma2, color=color.new(color.orange, 0))plot(ma3, color=color.new(color.orange, 0))plot(ma4, color=color.new(color.orange, 0))plot(ma5, color=color.new(color.orange, 0))plot(ma6, color=color.new(color.green, 0))plot(ma7, color=color.new(color.orange, 0))plot(ma8, color=color.new(color.orange, 0))plot(ma9, color=color.new(color.orange, 0))//GRAFICA MACDplot(macd, color=color.new(color.red, 0), style = plot.style_columns)//GRAFICA DIVERGENCIAplot(porcentaje, style = plot.style_columns)//GRAFICA MA DIVERGENCIAplot(ma_dista, color=color.new(color.white, 0))//GRAFICA MA DIVERGENCIAplot(desv, color=color.new(color.blue, 0))//GRAFICA EFIplot(efi_indicador, color=color.new(color.yellow, 0))// GRAFICA RSIl1 = hline(70, color=color.new(color.green, 0))l2 = hline(30, color=color.new(color.green, 0))plot(rsi, color=color.new(color.white, 0))//prueba 1 stop loss and take profit//sl = 0.05//tp = 0.1 //calculo de precio para sl y tp//longstop=strategy.position_avg_price*(1-sl)//longprofit=strategy.position_avg_price*(1+tp)//shortstop=strategy.position_avg_price*(1+sl)//shortprofit=strategy.position_avg_price*(1-tp)//if (long) // strategy.exit("BUY", strategy.long)//sl and tp long|short//if strategy.entry("BUY", strategy.long)//if strategy.position_avg_price > 0//strategy.exit("BUY", limit = longprofit, stop = longstop)//if strategy.position_avg_price < 0//strategy.exit("SELL", limit = shortprofit, stop=shortstop)