Pine Script v4 · Strategy
JBravo Swing with GoGo Juice
A Pine Script v4 strategy built on SMA (close, 9), EMA (close, 20) and VWAP (hlc3). 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. 5 settings.
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 JBravo Swing with GoGo Juice repaint?
- No
- No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 29 of 29 trades.
- How did JBravo Swing with GoGo Juice do on BTCUSDT 1D with default settings?
- +68.74%
- From 26 Jan 2024 to 21 Oct 2026, over 93 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
- Can JBravo Swing with GoGo Juice 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.
- What alerts does JBravo Swing with GoGo Juice have?
- 2
- Buy Signal; Sell Signal.
- Does JBravo Swing with GoGo Juice use a stop loss?
- No
- Every exit waits for a signal; nothing limits a losing trade before it fires.
BTCUSDT · 1D · default settings
- SMA 9
- EMA 20
- VWAP
- SMA 180
- Winning trade
- Losing trade
- Equity
- Buy and hold
- Net profit
- +68.74%
- $68,743.50
- Buy and hold
- +102.5%
- same period
- Closed trades
- 93
- 28 won · 65 lost
- Profitable
- 30.1%
- of closed trades
- Profit factor
- 1.58
- gross profit ÷ gross loss
- Max drawdown
- 22.29%
- −$24,552.50
One run with the author's default settings, $100,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.
-
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 64, 65, 66, 67. The upgraded version below moves each call inside an if block.
-
Note
Uses iff(), which v5 removed line 28
iff() on line 28, 31, 39, 40, 44, 45. v5 writes it as the ternary c ? a : b.
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 sma → ta.sma, ema → ta.ema, vwap → ta.vwap, lowest → ta.lowest.
- 4 strategy calls use the when = argument (line 64, 65, 66, 67). It is deprecated in v5 and removed in v6, where each call moves inside an if block.
v4 → v5
VerifiedSame 93 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.
- Line 3: //@version=4 → //@version=5
- Line 7: input(type = input.bool) → input.bool()
- Line 8: input(type = input.bool) → input.bool()
- Line 9: input(type = input.bool) → input.bool()
- Line 11: input(type = input.bool) → input.bool()
- Line 12: sma → ta.sma
20 more edits
- Line 13: ema → ta.ema
- Line 14: sma → ta.sma
- Line 19: vwap → ta.vwap
- Line 24: sma → ta.sma
- Line 24: sma → ta.sma
- Line 28: iff(c, a, b) → (c ? a : b)
- Line 28: lowest → ta.lowest
- Line 28: lowest → ta.lowest
- Line 28: lowest → ta.lowest
- Line 28: lowest → ta.lowest
- Line 29: lowest → ta.lowest
- Line 31: iff(c, a, b) → (c ? a : b)
- Line 33: sma → ta.sma
- Line 33: sma → ta.sma
- Line 35: ema → ta.ema
- Line 35: sma → ta.sma
- Line 39: iff(c, a, b) → (c ? a : b)
- Line 40: iff(c, a, b) → (c ? a : b)
- Line 44: iff(c, a, b) → (c ? a : b)
- Line 45: iff(c, a, b) → (c ? a : b)
⋯// © bradvaughn-//@version=4+//@version=5strategy("JBravo Swing", overlay = false)⋯//Moving Averages-smaInput1 = input(title="Display SMA 9", type=input.bool, defval=true)+smaInput1 = input.bool(title="Display SMA 9", defval=true)-smaInput2 = input(title="Display EMA 20", type=input.bool, defval=true)+smaInput2 = input.bool(title="Display EMA 20", defval=true)-smaInput4 = input(title="Display SMA 180", type=input.bool, defval=true)+smaInput4 = input.bool(title="Display SMA 180", defval=true)colored_180 = input(false, title="Color-code 180 trend direction")-vwapInput = input(title="Display VWAP", type=input.bool, defval=true)+vwapInput = input.bool(title="Display VWAP", defval=true)-sma9 = sma(close, 9)+sma9 = ta.sma(close, 9)-ema20 = ema(close, 20)+ema20 = ta.ema(close, 20)-sma180 = sma(close, 180)+sma180 = ta.sma(close, 180)//Plot Moving Averages⋯// Plot VWAP-vwap1 = vwap(hlc3)+vwap1 = ta.vwap(hlc3)plot(vwapInput ? vwap1 : na, color = color.blue, title="VWAP")⋯//Color SMA 180 trend direction if selected-sma180_uptrend = sma(close, 180) > sma(close[2], 180)+sma180_uptrend = ta.sma(close, 180) > ta.sma(close[2], 180)colr = sma180_uptrend == true or colored_180 == false ? color.white : colored_180 == true ? color.gray : na⋯//Get value of lower end of candle-buyLow = iff(lowest(open, 1) < lowest(close, 1), lowest(open, 1), lowest(close, 1))+buyLow = (ta.lowest(open, 1) < ta.lowest(close, 1) ? ta.lowest(open, 1) : ta.lowest(close, 1))-sellLow = lowest(close, 1)+sellLow = ta.lowest(close, 1)// Find the lower MA for crossover sell condition-sellma = iff((sma9<ema20), sma9, ema20)+sellma = ((sma9<ema20) ? sma9 : ema20)//SMA 9 trend direction-sma9_uptrend = sma(close, 9) > sma(close[2], 9)+sma9_uptrend = ta.sma(close, 9) > ta.sma(close[2], 9)//EMA 20 trend direction-ema20_uptrend = ema(close, 20) > sma(close[2], 20)+ema20_uptrend = ta.ema(close, 20) > ta.sma(close[2], 20)//Buy or sell if conditions are met⋯// Sell when the candle low is below the lower of SMA9 and EMA20-Buy = iff(buy_in_progress == false and buyLow > sma9 == true, true, false)+Buy = (buy_in_progress == false and buyLow > sma9 == true ? true : false)-Sell = iff(buy_in_progress == true and sellLow < sellma == true, true, false)+Sell = (buy_in_progress == true and sellLow < sellma == true ? true : false)// Determine stong buy and strong sell conditions.⋯// If the moving averages are not up (ie. down) then this will qualify a sell as a strong sell-StrongBuy = iff (Buy and sma9_uptrend and sma180_uptrend and ema20_uptrend and (sma9 > ema20) and (ema20 > sma180), true, false)+StrongBuy = (Buy and sma9_uptrend and sma180_uptrend and ema20_uptrend and (sma9 > ema20) and (ema20 > sma180) ? true : false)-StrongSell = iff (Sell and not sma9_uptrend and not sma180_uptrend and not ema20_uptrend and (sma9 < ema20) and (ema20 < sma180), true, false)+StrongSell = (Sell and not sma9_uptrend and not sma180_uptrend and not ema20_uptrend and (sma9 < ema20) and (ema20 < sma180) ? true : false)//Update Trading status if bought or sold⋯Same 93 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.
- Line 10: input() → input.bool()
- Line 64: when = vwaplong and vwapInput → if block
- Line 65: when = vwapshort and vwapInput → if block
- Line 66: when = vwapshort and vwapInput → if block
- Line 67: when = vwaplong and vwapInput → if block
⋯smaInput4 = input.bool(title="Display SMA 180", defval=true)-colored_180 = input(false, title="Color-code 180 trend direction")+colored_180 = input.bool(false, title="Color-code 180 trend direction")vwapInput = input.bool(title="Display VWAP", defval=true)⋯plotshape(StrongSell,title="Strong Sell", color=color.red, style=shape.arrowdown,text="Strong Sell")-strategy.entry("GoGo Long", strategy.long, 1, when=vwaplong and vwapInput)+if vwaplong and vwapInput+ strategy.entry("GoGo Long", strategy.long, 1)-strategy.entry("GoGo Short", strategy.short, 1, when=vwapshort and vwapInput)+if vwapshort and vwapInput+ strategy.entry("GoGo Short", strategy.short, 1)-strategy.close("GoGo Long", when = vwapshort and vwapInput)+if vwapshort and vwapInput+ strategy.close("GoGo Long")-strategy.close("GoGo Short", when = vwaplong and vwapInput)+if vwaplong and vwapInput+ strategy.close("GoGo Short")alertcondition(Buy, title="Buy Signal", message="Buy")⋯Does it run in Pine Script v6?
Yes
Same 93 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. Both versions were run on Zeal Terminal's engine, and the results are identical. It differs from the v5 version by 1 edit.
⋯// © bradvaughn-//@version=5+//@version=6strategy("JBravo Swing", overlay = false)⋯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 |
|---|---|---|---|
| Display SMA 9 | true | bool | SMA 9 |
| Display EMA 20 | true | bool | EMA 20 |
| Display SMA 180 | true | bool | SMA 180 |
| Color-code 180 trend direction | false | bool | colr |
| Display VWAP | true | bool | VWAP entry GoGo Long entry GoGo Short close GoGo Long close GoGo Short |
What it calculates
- SMA (
sma,ta.smain v5)close, 9sma9 · line 12 - EMA (
ema,ta.emain v5)close, 20ema20 · line 13 - SMA (
sma,ta.smain v5)close, 180sma180 · line 14 - VWAP (
vwap,ta.vwapin v5)hlc3vwap1 · line 19 - Lowest (
lowest,ta.lowestin v5)close, 1sellLow · line 29
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 GoGo Long long | vwaplong and vwapInput | On | 64 |
| Open GoGo Short short | vwapshort and vwapInput | On | 65 |
| Close GoGo Long | vwapshort and vwapInput | On | 66 |
| Close GoGo Short | vwaplong and vwapInput | On | 67 |
Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.
Alerts
| Alert | Call | Message | Line |
|---|---|---|---|
| Buy Signal | alertcondition | Buy | 68 |
| Sell Signal | alertcondition | Sell | 69 |
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 | +68.7% | +102.5% | 93 | 30% | 1.58 | 22.3% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | −0.3% | +5.5% | 64 | 27% | 0.99 | 11.4% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | +5.0% | +9.8% | 89 | 40% | 1.94 | 1.2% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | +0.5% | +8.4% | 72 | 29% | 1.33 | 0.7% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | +0.2% | +16.7% | 97 | 34% | 1.50 | 0.1% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | +0.0% | +21.5% | 72 | 31% | 1.50 | 0.0% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | +0.1% | +148.3% | 109 | 28% | 1.10 | 0.4% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | +0.2% | +17.1% | 62 | 32% | 1.62 | 0.1% | 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 | 38 | 29% | $2,792.40 |
| Sideways market | 34 | 38% | $55,856.20 |
| Falling market | 21 | 19% | $10,094.90 |
Rising and falling mean the market moved more than 15% over the 90 bars before entry.
How bad could the drawdown be?
29.3%
The 95th percentile of the worst drawdown when the same 93 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 12.9% to 29.3%; the tick is what actually happened, 20.8%. Order luck alone moves it this much.
All 93 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| long | 15 Feb 2024 51,795.20 | 20 Mar 2024 61,937.40 | 34 | $10,142.20 |
| short | 20 Mar 2024 61,937.40 | 22 Mar 2024 65,501.30 | 2 | −$3,563.87 |
| long | 22 Mar 2024 65,501.30 | 23 Mar 2024 63,796.60 | 1 | −$1,704.64 |
| short | 23 Mar 2024 63,796.60 | 25 Mar 2024 67,210.00 | 2 | −$3,413.36 |
| long | 25 Mar 2024 67,210.00 | 3 Apr 2024 65,464.00 | 9 | −$1,746.01 |
| short | 3 Apr 2024 65,464.00 | 7 Apr 2024 68,896.00 | 4 | −$3,432.01 |
| long | 7 Apr 2024 68,896.00 | 13 Apr 2024 67,116.50 | 6 | −$1,779.48 |
| short | 13 Apr 2024 67,116.50 | 23 Apr 2024 66,819.30 | 10 | $297.20 |
| long | 23 Apr 2024 66,819.30 | 25 Apr 2024 64,289.60 | 2 | −$2,529.74 |
| short | 25 Apr 2024 64,289.60 | 5 May 2024 63,892.00 | 10 | $397.55 |
| long | 5 May 2024 63,892.00 | 8 May 2024 62,312.10 | 3 | −$1,579.96 |
| short | 8 May 2024 62,312.10 | 16 May 2024 66,206.50 | 8 | −$3,894.44 |
| long | 16 May 2024 66,206.50 | 12 Jun 2024 67,314.20 | 27 | $1,107.72 |
| short | 12 Jun 2024 67,314.20 | 15 Jul 2024 60,797.90 | 33 | $6,516.32 |
| long | 15 Jul 2024 60,797.90 | 2 Aug 2024 65,354.00 | 18 | $4,556.11 |
| short | 2 Aug 2024 65,354.00 | 22 Aug 2024 61,156.00 | 20 | $4,197.99 |
| long | 22 Aug 2024 61,156.00 | 28 Aug 2024 59,415.00 | 6 | −$1,741.03 |
| short | 28 Aug 2024 59,415.00 | 13 Sep 2024 58,132.30 | 16 | $1,282.69 |
| long | 13 Sep 2024 58,132.30 | 17 Sep 2024 58,214.00 | 4 | $81.68 |
| short | 17 Sep 2024 58,214.00 | 18 Sep 2024 60,314.00 | 1 | −$2,100.00 |
| long | 18 Sep 2024 60,314.00 | 2 Oct 2024 60,804.90 | 14 | $490.93 |
| short | 2 Oct 2024 60,804.90 | 7 Oct 2024 62,819.90 | 5 | −$2,014.99 |
| long | 7 Oct 2024 62,819.90 | 10 Oct 2024 60,636.00 | 3 | −$2,183.90 |
| short | 10 Oct 2024 60,636.00 | 12 Oct 2024 62,540.00 | 2 | −$1,903.98 |
| long | 12 Oct 2024 62,540.00 | 5 Nov 2024 67,850.00 | 24 | $5,310.02 |
| short | 5 Nov 2024 67,850.00 | 6 Nov 2024 69,372.00 | 1 | −$1,522.00 |
| long | 6 Nov 2024 69,372.00 | 20 Dec 2024 97,461.90 | 44 | $28,089.90 |
| short | 20 Dec 2024 97,461.90 | 26 Dec 2024 99,429.60 | 6 | −$1,967.75 |
| long | 26 Dec 2024 99,429.60 | 27 Dec 2024 95,791.60 | 1 | −$3,638.01 |
| short | 27 Dec 2024 95,791.60 | 3 Jan 2025 96,984.80 | 7 | −$1,193.19 |
| long | 3 Jan 2025 96,984.80 | 9 Jan 2025 95,060.60 | 6 | −$1,924.18 |
| short | 9 Jan 2025 95,060.60 | 15 Jan 2025 96,560.90 | 6 | −$1,500.24 |
| long | 15 Jan 2025 96,560.90 | 28 Jan 2025 102,083.00 | 13 | $5,521.98 |
| short | 28 Jan 2025 102,083.00 | 29 Jan 2025 101,336.00 | 1 | $747.31 |
| long | 29 Jan 2025 101,336.00 | 2 Feb 2025 100,636.00 | 4 | −$699.86 |
| short | 2 Feb 2025 100,636.00 | 21 Feb 2025 98,305.00 | 19 | $2,330.65 |
| long | 21 Feb 2025 98,305.00 | 22 Feb 2025 96,182.00 | 1 | −$2,123.02 |
| short | 22 Feb 2025 96,182.00 | 24 Mar 2025 86,082.50 | 30 | $10,099.50 |
| long | 24 Mar 2025 86,082.50 | 29 Mar 2025 84,424.40 | 5 | −$1,658.12 |
| short | 29 Mar 2025 84,424.40 | 13 Apr 2025 85,276.90 | 15 | −$852.53 |
| long | 13 Apr 2025 85,276.90 | 31 May 2025 103,985.00 | 48 | $18,708.60 |
| short | 31 May 2025 103,985.00 | 4 Jun 2025 105,377.00 | 4 | −$1,391.43 |
| long | 4 Jun 2025 105,377.00 | 5 Jun 2025 104,697.00 | 1 | −$680.04 |
| short | 5 Jun 2025 104,697.00 | 8 Jun 2025 105,552.00 | 3 | −$855.29 |
| long | 8 Jun 2025 105,552.00 | 14 Jun 2025 106,067.00 | 6 | $514.44 |
| short | 14 Jun 2025 106,067.00 | 17 Jun 2025 106,795.00 | 3 | −$727.94 |
| long | 17 Jun 2025 106,795.00 | 18 Jun 2025 104,551.00 | 1 | −$2,243.36 |
| short | 18 Jun 2025 104,551.00 | 25 Jun 2025 106,083.00 | 7 | −$1,531.83 |
| long | 25 Jun 2025 106,083.00 | 1 Aug 2025 115,764.00 | 37 | $9,681.07 |
| short | 1 Aug 2025 115,764.00 | 8 Aug 2025 117,472.00 | 7 | −$1,707.95 |
| long | 8 Aug 2025 117,472.00 | 17 Aug 2025 117,381.00 | 9 | −$91.36 |
| short | 17 Aug 2025 117,381.00 | 18 Aug 2025 117,405.00 | 1 | −$24.35 |
| long | 18 Aug 2025 117,405.00 | 19 Aug 2025 116,227.00 | 1 | −$1,177.96 |
| short | 19 Aug 2025 116,227.00 | 9 Sep 2025 112,065.00 | 21 | $4,161.82 |
| long | 9 Sep 2025 112,065.00 | 23 Sep 2025 112,651.00 | 14 | $585.76 |
| short | 23 Sep 2025 112,651.00 | 30 Sep 2025 114,312.00 | 7 | −$1,660.98 |
| long | 30 Sep 2025 114,312.00 | 11 Oct 2025 112,774.00 | 11 | −$1,537.48 |
| short | 11 Oct 2025 112,774.00 | 27 Oct 2025 114,559.00 | 16 | −$1,784.92 |
| long | 27 Oct 2025 114,559.00 | 30 Oct 2025 110,021.00 | 3 | −$4,538.11 |
| short | 30 Oct 2025 110,021.00 | 4 Dec 2025 93,429.90 | 35 | $16,591.40 |
| long | 4 Dec 2025 93,429.90 | 6 Dec 2025 89,330.00 | 2 | −$4,099.91 |
| short | 6 Dec 2025 89,330.00 | 10 Dec 2025 92,678.80 | 4 | −$3,348.77 |
| long | 10 Dec 2025 92,678.80 | 13 Dec 2025 90,268.40 | 3 | −$2,410.38 |
| short | 13 Dec 2025 90,268.40 | 2 Jan 2026 88,839.10 | 20 | $1,429.38 |
| long | 2 Jan 2026 88,839.10 | 21 Jan 2026 88,427.70 | 19 | −$411.39 |
| short | 21 Jan 2026 88,427.70 | 5 Mar 2026 72,666.80 | 43 | $15,760.90 |
| long | 5 Mar 2026 72,666.80 | 8 Mar 2026 67,262.90 | 3 | −$5,403.86 |
| short | 8 Mar 2026 67,262.90 | 11 Mar 2026 69,948.60 | 3 | −$2,685.73 |
| long | 11 Mar 2026 69,948.60 | 20 Mar 2026 69,930.00 | 9 | −$18.63 |
| short | 20 Mar 2026 69,930.00 | 25 Mar 2026 70,556.70 | 5 | −$626.73 |
| long | 25 Mar 2026 70,556.70 | 27 Mar 2026 68,820.30 | 2 | −$1,736.43 |
| short | 27 Mar 2026 68,820.30 | 7 Apr 2026 68,853.70 | 11 | −$33.35 |
| long | 7 Apr 2026 68,853.70 | 17 May 2026 78,148.10 | 40 | $9,294.39 |
| short | 17 May 2026 78,148.10 | 4 Jul 2026 62,583.30 | 48 | $15,564.80 |
| long | 4 Jul 2026 62,583.30 | 9 Jul 2026 62,290.00 | 5 | −$293.25 |
| short | 9 Jul 2026 62,290.00 | 10 Jul 2026 63,230.00 | 1 | −$940.00 |
| long | 10 Jul 2026 63,230.00 | 14 Jul 2026 62,334.50 | 4 | −$895.49 |
| short | 14 Jul 2026 62,334.50 | 15 Jul 2026 65,044.00 | 1 | −$2,709.47 |
| long | 15 Jul 2026 65,044.00 | 26 Jul 2026 64,375.00 | 11 | −$668.98 |
| short | 26 Jul 2026 64,375.00 | 27 Jul 2026 65,400.00 | 1 | −$1,024.99 |
| long | 27 Jul 2026 65,400.00 | 29 Jul 2026 63,915.00 | 2 | −$1,485.00 |
| short | 29 Jul 2026 63,915.00 | 31 Jul 2026 64,780.00 | 2 | −$865.03 |
| long | 31 Jul 2026 64,780.00 | 1 Aug 2026 62,887.90 | 1 | −$1,892.15 |
| short | 1 Aug 2026 62,887.90 | 5 Aug 2026 64,106.60 | 4 | −$1,218.67 |
| long | 5 Aug 2026 64,106.60 | 12 Aug 2026 63,600.00 | 7 | −$506.54 |
| short | 12 Aug 2026 63,600.00 | 18 Aug 2026 64,532.10 | 6 | −$932.10 |
| long | 18 Aug 2026 64,532.10 | 14 Sep 2026 76,842.00 | 27 | $12,309.90 |
| short | 14 Sep 2026 76,842.00 | 15 Sep 2026 78,189.20 | 1 | −$1,347.19 |
| long | 15 Sep 2026 78,189.20 | 16 Sep 2026 75,644.50 | 1 | −$2,544.72 |
| short | 16 Sep 2026 75,644.50 | 19 Sep 2026 80,883.90 | 3 | −$5,239.38 |
| long | 19 Sep 2026 80,883.90 | 9 Oct 2026 81,754.50 | 20 | $870.60 |
| short | 9 Oct 2026 81,754.50 | 12 Oct 2026 83,773.10 | 3 | −$2,018.66 |
| long | 12 Oct 2026 83,773.10 | 13 Oct 2026 81,850.00 | 1 | −$1,923.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 |
|---|---|---|---|---|---|
| JBravo Swing with GoGo Juice this page | — | v4 strategy | +68.7% | 93 | 22.3% |
| ZVWAP strategy by mohanee | sma ema vwap | v4 strategy | +614.4% | 13 | 748.5% |
| Ultimate Oscillator [Long] Strategy by mohanee | sma vwap ema | v4 strategy | No trades on this market | ||
| Morning Scalp Strategy by Trading_Bites | lowest ema vwap | v5 strategy | No trades on this market | ||
| VWAP and BB strategy [EEMANI] by mohanee | ema vwap sma | v4 strategy | No trades on this market | ||
| Buying Selling Volume Strategy by exlux99 | vwap ema sma | v5 strategy | No trades on this market | ||
Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 17 ms | Yes 1,000 bars in 57 ms | Not measured |
| PineTS | No v5 and v6 only | — | 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. 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/// © bradvaughn//@version=4strategy("JBravo Swing", overlay = false)var buy_in_progress = false//Moving AveragessmaInput1 = input(title="Display SMA 9", type=input.bool, defval=true)smaInput2 = input(title="Display EMA 20", type=input.bool, defval=true)smaInput4 = input(title="Display SMA 180", type=input.bool, defval=true)colored_180 = input(false, title="Color-code 180 trend direction")vwapInput = input(title="Display VWAP", type=input.bool, defval=true)sma9 = sma(close, 9)ema20 = ema(close, 20)sma180 = sma(close, 180)//Plot Moving Averagesplot(smaInput1 ? sma9 : na, color= color.red, title="SMA 9")plot(smaInput2 ? ema20 : na, color = color.yellow, title="EMA 20")// Plot VWAPvwap1 = vwap(hlc3)plot(vwapInput ? vwap1 : na, color = color.blue, title="VWAP")vwaplong = vwap1 > ema20vwapshort = vwap1 < ema20//Color SMA 180 trend direction if selectedsma180_uptrend = sma(close, 180) > sma(close[2], 180)colr = sma180_uptrend == true or colored_180 == false ? color.white : colored_180 == true ? color.gray : naplot(smaInput4 ? sma180 : na, color = colr, title="SMA 180")//Get value of lower end of candlebuyLow = iff(lowest(open, 1) < lowest(close, 1), lowest(open, 1), lowest(close, 1))sellLow = lowest(close, 1)// Find the lower MA for crossover sell conditionsellma = iff((sma9<ema20), sma9, ema20)//SMA 9 trend directionsma9_uptrend = sma(close, 9) > sma(close[2], 9)//EMA 20 trend directionema20_uptrend = ema(close, 20) > sma(close[2], 20)//Buy or sell if conditions are met// Buy when the candle low is above the SMA9// Sell when the candle low is below the lower of SMA9 and EMA20Buy = iff(buy_in_progress == false and buyLow > sma9 == true, true, false)Sell = iff(buy_in_progress == true and sellLow < sellma == true, true, false)// Determine stong buy and strong sell conditions.// If moving averages are all up, then this will qualify a buy as a strong buy.// If the moving averages are not up (ie. down) then this will qualify a sell as a strong sellStrongBuy = iff (Buy and sma9_uptrend and sma180_uptrend and ema20_uptrend and (sma9 > ema20) and (ema20 > sma180), true, false)StrongSell = iff (Sell and not sma9_uptrend and not sma180_uptrend and not ema20_uptrend and (sma9 < ema20) and (ema20 < sma180), true, false)//Update Trading status if bought or soldif Buy buy_in_progress := trueif Sell buy_in_progress := false // Clear Buy and Sell conditions if StrongBuy or StrongSell conditions exist. // This disables plotting Buy and Sell conditionsif StrongBuy Buy := falseif StrongSell Sell := false //Display BUY/SELL indicatorsplotshape(Buy,title="Buy", color=color.green, style=shape.arrowup,location=location.belowbar, text="Buy")plotshape(StrongBuy,title="Strong Buy", color=color.green, style=shape.arrowup,location=location.belowbar, text="Strong Buy")plotshape(Sell,title="Sell", color=color.red, style=shape.arrowdown,text="Sell")plotshape(StrongSell,title="Strong Sell", color=color.red, style=shape.arrowdown,text="Strong Sell")strategy.entry("GoGo Long", strategy.long, 1, when=vwaplong and vwapInput)strategy.entry("GoGo Short", strategy.short, 1, when=vwapshort and vwapInput)strategy.close("GoGo Long", when = vwapshort and vwapInput)strategy.close("GoGo Short", when = vwaplong and vwapInput)alertcondition(Buy, title="Buy Signal", message="Buy")alertcondition(Sell, title="Sell Signal", message="Sell")