Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

Flawless Victory Strategy - 15min BTC Machine Learning Strategy

A Pine Script v4 strategy built on RMA or Change (max(change(src), 0), len), Change (MFIsrc) and SMA (src1, length1). It has 8 order rules, 3 entries among them, and trades long only with the default settings. Exits use a stop loss and a profit target. Each trade commits 100% of equity and pays no commission. 7 settings; defaults include Stop Loss % 6.604, Take Profit % 2.328 and Stop Loss % 8.882.

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 Flawless Victory Strategy - 15min BTC Machine Learning Strategy 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 Flawless Victory Strategy - 15min BTC Machine Learning Strategy do on BTCUSDT 1D with default settings?
+21.26%
From 26 Jan 2024 to 21 Oct 2026, over 6 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Can Flawless Victory Strategy - 15min BTC Machine Learning 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 Flawless Victory Strategy - 15min BTC Machine Learning Strategy use a stop loss?
Yes
strategy.exit sets a stop on line 94, 101.
Does Flawless Victory Strategy - 15min BTC Machine Learning Strategy run in Zeal Terminal?
Yes
It compiles in 19 ms and runs 1,000 bars in 52 ms, in the browser.

BTCUSDT · 1D · default settings

  • RMA
  • RMA
  • Change
  • Change
  • SMA
  • Stdev
  • SMA
  • Stdev
  • 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 (7)
0.0050,000100,000AprJulOct2025AprJulOct2026AprJulOct$125,640$202,527Equity from $100,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. The script plots nothing itself; the lines and the lower pane are its own calculations, drawn for reference.
Net profit
+21.26%
$21,262.60
Buy and hold
+102.5%
same period
Closed trades
6
5 won · 1 lost
Profitable
83.3%
of closed trades
Profit factor
1.68
gross profit ÷ gross loss
Max drawdown
35.39%
−$48,937.90

One run with the author's default settings, $100,000 starting capital, commission as the script sets it. A long 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 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.

  • Note

    Uses an argument v6 removed

    when = on line 86, 87, 92, 93, 99, 100. 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 rma → ta.rma, max → math.max, change → ta.change, min → math.min, sum → math.sum, sma → ta.sma, stdev → ta.stdev.
  • 6 strategy calls use the when = argument (line 86, 87, 92, 93, 99, 100). It is deprecated in v5 and removed in v6, where each call moves inside an if block.

v4 → v5

Verified

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

  • Line 3: //@version=4 → //@version=5
  • Line 10: input(type = input.float) → input.float()
  • Line 11: input(type = input.float) → input.float()
  • Line 14: input(type = input.float) → input.float()
  • Line 15: input(type = input.float) → input.float()
  • Line 26: rma → ta.rma
13 more edits
  • Line 26: max → math.max
  • Line 26: change → ta.change
  • Line 27: rma → ta.rma
  • Line 27: min → math.min
  • Line 27: change → ta.change
  • Line 32: sum → math.sum
  • Line 32: change → ta.change
  • Line 33: sum → math.sum
  • Line 33: change → ta.change
  • Line 45: sma → ta.sma
  • Line 46: stdev → ta.stdev
  • Line 53: sma → ta.sma
  • Line 54: stdev → ta.stdev
⋯// © Bunghole-//@version=4+//@version=5strategy(overlay=true, shorttitle="Flawless Victory Strategy", default_qty_type = strategy.percent_of_equity, initial_capital = 100000, default_qty_value = 100, pyramiding = 0, title="Flawless Victory Strategy", currency = 'USD')⋯v3 = input(false, title="Version 3 - Uses SL/TP")-v2stoploss_input = input(6.604, title='Stop Loss %', type=input.float, minval=0.01)/100+v2stoploss_input = input.float(6.604, title='Stop Loss %', minval=0.01)/100-v2takeprofit_input = input(2.328, title='Take Profit %', type=input.float, minval=0.01)/100+v2takeprofit_input = input.float(2.328, title='Take Profit %', minval=0.01)/100v2stoploss_level = strategy.position_avg_price * (1 - v2stoploss_input)v2takeprofit_level = strategy.position_avg_price * (1 + v2takeprofit_input)-v3stoploss_input = input(8.882, title='Stop Loss %', type=input.float, minval=0.01)/100+v3stoploss_input = input.float(8.882, title='Stop Loss %', minval=0.01)/100-v3takeprofit_input = input(2.317, title='Take Profit %', type=input.float, minval=0.01)/100+v3takeprofit_input = input.float(2.317, title='Take Profit %', minval=0.01)/100v3stoploss_level = strategy.position_avg_price * (1 - v3stoploss_input)⋯src = close-up = rma(max(change(src), 0), len)+up = ta.rma(math.max(ta.change(src), 0), len)-down = rma(-min(change(src), 0), len)+down = ta.rma(-math.min(ta.change(src), 0), len)rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - 100 / (1 + up / down)⋯MFIsrc = hlc3-MFIupper = sum(volume * (change(MFIsrc) <= 0 ? 0 : MFIsrc), MFIlength)+MFIupper = math.sum(volume * (ta.change(MFIsrc) <= 0 ? 0 : MFIsrc), MFIlength)-MFIlower = sum(volume * (change(MFIsrc) >= 0 ? 0 : MFIsrc), MFIlength)+MFIlower = math.sum(volume * (ta.change(MFIsrc) >= 0 ? 0 : MFIsrc), MFIlength)_rsi(MFIupper, MFIlower) =>⋯mult1 = 1.0-basis1 = sma(src1, length1)+basis1 = ta.sma(src1, length1)-dev1 = mult1 * stdev(src1, length1)+dev1 = mult1 * ta.stdev(src1, length1)upper1 = basis1 + dev1⋯mult2 = 1.0-basis2 = sma(src2, length2)+basis2 = ta.sma(src2, length2)-dev2 = mult2 * stdev(src2, length2)+dev2 = mult2 * ta.stdev(src2, length2)upper2 = basis2 + dev2⋯

Clean v5

VerifiedDownload the v5 script

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

  • Line 7: input() → input.bool()
  • Line 8: input() → input.bool()
  • Line 9: input() → input.bool()
  • Line 86: when = Buy_1 → if block
  • Line 87: when = Sell_1 → if block
  • Line 92: when = Buy_2 → if block
3 more edits
  • Line 93: when = Sell_2 → if block
  • Line 99: when = Buy_3 → if block
  • Line 100: when = Sell_3 → if block
⋯// Stoploss and Profits Inputs-v1 = input(true, title="Version 1 - Doesn't Use SL/TP")+v1 = input.bool(true, title="Version 1 - Doesn't Use SL/TP")-v2 = input(false, title="Version 2 - Uses SL/TP")+v2 = input.bool(false, title="Version 2 - Uses SL/TP")-v3 = input(false, title="Version 3 - Uses SL/TP")+v3 = input.bool(false, title="Version 3 - Uses SL/TP")v2stoploss_input = input.float(6.604, title='Stop Loss %', minval=0.01)/100⋯if v1 == true-    strategy.entry("Long", strategy.long, when = Buy_1, alert_message = "v1 - Buy Signal!")+    if Buy_1+        strategy.entry("Long", strategy.long, alert_message = "v1 - Buy Signal!")-    strategy.close("Long", when = Sell_1, alert_message = "v1 - Sell Signal!")+    if Sell_1+        strategy.close("Long", alert_message = "v1 - Sell Signal!")// v2 Signals⋯if v2 == true-    strategy.entry("Long", strategy.long, when = Buy_2, alert_message = "v2 - Buy Signal!")+    if Buy_2+        strategy.entry("Long", strategy.long, alert_message = "v2 - Buy Signal!")-    strategy.close("Long", when = Sell_2, alert_message = "v2 - Sell Signal!")+    if Sell_2+        strategy.close("Long", alert_message = "v2 - Sell Signal!")    strategy.exit("Stoploss/TP", "Long", stop = v2stoploss_level, limit = v2takeprofit_level)⋯if v3 == true-    strategy.entry("Long", strategy.long, when = Buy_3, alert_message = "v2 - Buy Signal!")+    if Buy_3+        strategy.entry("Long", strategy.long, alert_message = "v2 - Buy Signal!")-    strategy.close("Long", when = Sell_3, alert_message = "v2 - Sell Signal!")+    if Sell_3+        strategy.close("Long", alert_message = "v2 - Sell Signal!")    strategy.exit("Stoploss/TP", "Long", stop = v3stoploss_level, limit = v3takeprofit_level)

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

⋯// © Bunghole-//@version=5+//@version=6strategy(overlay=true, shorttitle="Flawless Victory Strategy", default_qty_type = strategy.percent_of_equity, initial_capital = 100000, default_qty_value = 100, pyramiding = 0, title="Flawless Victory Strategy", currency = 'USD')⋯

Settings

Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.

SettingDefaultType and rangeFeeds
Version 1 - Doesn't Use SL/TPtrueboolentry Long close Long line 85
Version 2 - Uses SL/TPfalseboolentry Long close Long exit Stoploss/TP v2 Stoploss v2 Profit line 91
Version 3 - Uses SL/TPfalseboolentry Long close Long exit Stoploss/TP v3 Stoploss v3 Profit line 98
Stop Loss %6.604float · min 0.01v2stoploss_level v2 Stoploss
Take Profit %2.328float · min 0.01v2takeprofit_level v2 Profit
Stop Loss %8.882float · min 0.01v3stoploss_level v3 Stoploss
Take Profit %2.317float · min 0.01v3takeprofit_level v3 Profit

What it calculates

  • RMA / Change (rma, ta.rma in v5)max(change(src), 0), lenup · line 26
  • RMA / Change (rma, ta.rma in v5)-min(change(src), 0), lendown · line 27
  • Change (change, ta.change in v5)MFIsrcMFIupper · line 32
  • Change (change, ta.change in v5)MFIsrcMFIlower · line 33
  • SMA (sma, ta.sma in v5)src1, length1basis1 · line 45
  • Stdev (stdev, ta.stdev in v5)src1, length1dev1 · line 46
  • SMA (sma, ta.sma in v5)src2, length2basis2 · line 53
  • Stdev (stdev, ta.stdev in v5)src2, length2dev2 · line 54

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.

volumevolumeprice datav2stoploss_inputStop Loss %setting · 6.604v2takeprofit_inputTake Profit %setting · 2.328v3stoploss_inputStop Loss %setting · 8.882v3takeprofit_inputTake Profit %setting · 2.317closecloseprice datahlc3hlc3price dataupRMA / Change→ updownRMA / Change→ downMFIupperChange→ MFIupperMFIlowerChange→ MFIlowerbasis1SMA→ basis1dev1Stdev→ dev1basis2SMA→ basis2dev2Stdev→ dev2v2stoploss_levelv2stoploss_levelvaluev2takeprofit_levelv2takeprofit_levelvaluev3stoploss_levelv3stoploss_levelvaluev3takeprofit_levelv3takeprofit_levelvaluesrc, src1, src2src · src1 +13 valuesrsirsivalueMFIsrcMFIsrcvaluemfimfivalueupper1, lower1upper1 · lower12 valuesupper2, lower2upper2 · lower22 valuesBuy_1Buy_1conditionSell_1Sell_1conditionBuy_2Buy_2conditionSell_2Sell_2conditionBuy_3Buy_3conditionSell_3Sell_3conditionBBBuyTrigger1, BBSellTrigger1, BBBuyTrigger3, BBSellTrigger3BBBuyTrigger1 · BBSellT…4 conditionsrsiBuyGuard1, rsiSellGuard1, rsiBuyGuard2, rsiSellGuard2, rsiSellGuard3rsiBuyGuard1 · rsiSellG…5 conditionsBBBuyTrigger2, BBSellTrigger2BBBuyTrigger2 · BBSellT…2 conditionsmfiBuyGuard3, mfiSellGuard3mfiBuyGuard3 · mfiSellG…2 conditionsentry:LongOpen Longstrategy.entryclose:LongClose Longstrategy.closeexit:Stoploss/TPexit Stoploss/TPstrategy.exitplot:18v2 Stoplossplotplot:19v2 Profitplotplot:20v3 Stoplossplotplot:21v3 Profitplot

Order rules

OrderFires whenBy defaultLine
Open Long longBuy_1BBBuyTrigger1 and rsiBuyGuard1On86
Close LongSell_1BBSellTrigger1 and rsiSellGuard1On87
Open Long longBuy_2BBBuyTrigger2 and rsiBuyGuard2On92
Close LongSell_2BBSellTrigger2 and rsiSellGuard2On93
Exit Stoploss/TP stop and limitv2 == trueOn94
Open Long longBuy_3BBBuyTrigger3 and mfiBuyGuard3On99
Close LongSell_3BBSellTrigger3 and rsiSellGuard3 and mfiSellGuard3On100
Exit Stoploss/TP stop and limitv3 == trueOn101

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.

2/2trades 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+21.3%+102.5%683%1.6835.4%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−4.9%+5.5%757%0.7326.4%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−54.6%+9.8%650%0.3476.1%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+4.1%+8.4%771%1.1734.8%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+39.3%+16.7%1080%1.1868.1%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h−1.2%+21.5%560%0.9534.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+50.8%+148.3%786%1.8346.1%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+7.5%+17.1%786%1.5720.8%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 market5100%$52,368.10
Sideways market0—$0.00
Falling market10%−$31,105.40

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

How bad could the drawdown be?

22.5%

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

0%26%
All 6 trades
SideEntryExitBarsP&L
long20 Mar 2024 61,937.4021 Oct 2024 69,032.00215$11,454.50
long23 Dec 2024 95,186.303 May 2025 96,887.10131$1,991.54
long6 Jun 2025 101,509.0011 Jul 2025 116,010.0035$16,206.70
long1 Aug 2025 115,764.006 Oct 2025 123,482.0066$8,644.23
long22 Jan 2026 89,454.7020 Aug 2026 69,334.80210−$31,105.40
long11 Sep 2026 76,568.7022 Sep 2026 86,620.0011$14,071.20

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
Flawless Victory Strategy - 15min BTC Machine Learning Strategy this page—v4 strategy+21.3%635.4%
Contrarian Scalping Counter Trend Bb Envelope Adx and Stochastic by exlux99sma stdev rmav5 strategy+1.9%153.2%
Forex Scalping 1min Bollinger Bands, RSI and ADX Trading System by exlux99sma stdev rmav4 strategy−0.0%30.0%
Best TradingView Strategy - For NASDAQ and DOW30 and other Index by The_Bigger_Bullsma stdev rmav5 strategy+2.2%173.4%
ADX_TSI_Bol Band Trend Chaser by gary_tradessma stdev rmav4 strategyNo trades on this market
Double Bollinger Binary Options by Trade_by_DBsma stdevv5 strategyNo trades on this market

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 19 msYes 1,000 bars in 52 msNot measured
PineTSNo 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/// © Bunghole//@version=4strategy(overlay=true, shorttitle="Flawless Victory Strategy", default_qty_type = strategy.percent_of_equity, initial_capital = 100000, default_qty_value = 100, pyramiding = 0, title="Flawless Victory Strategy", currency = 'USD')////////// ** Inputs ** //////////// Stoploss and Profits Inputsv1 = input(true, title="Version 1 - Doesn't Use SL/TP")v2 = input(false, title="Version 2 - Uses SL/TP")v3 = input(false, title="Version 3 - Uses SL/TP")v2stoploss_input = input(6.604, title='Stop Loss %', type=input.float, minval=0.01)/100v2takeprofit_input = input(2.328, title='Take Profit %', type=input.float, minval=0.01)/100v2stoploss_level = strategy.position_avg_price * (1 - v2stoploss_input)v2takeprofit_level = strategy.position_avg_price * (1 + v2takeprofit_input)v3stoploss_input = input(8.882, title='Stop Loss %', type=input.float, minval=0.01)/100v3takeprofit_input = input(2.317, title='Take Profit %', type=input.float, minval=0.01)/100v3stoploss_level = strategy.position_avg_price * (1 - v3stoploss_input)v3takeprofit_level = strategy.position_avg_price * (1 + v3takeprofit_input)plot(v2 and v2stoploss_input and v2stoploss_level ? v2stoploss_level: na, color=color.red, style=plot.style_linebr, linewidth=2, title="v2 Stoploss")plot(v2 and v2takeprofit_input ? v2takeprofit_level: na, color=color.green, style=plot.style_linebr, linewidth=2, title="v2 Profit")plot(v3 and v3stoploss_input and v3stoploss_level ? v3stoploss_level: na, color=color.red, style=plot.style_linebr, linewidth=2, title="v3 Stoploss")plot(v3 and v3takeprofit_input ? v3takeprofit_level: na, color=color.green, style=plot.style_linebr, linewidth=2, title="v3 Profit")////////// ** Indicators ** //////////// RSIlen = 14src = closeup = rma(max(change(src), 0), len)down = rma(-min(change(src), 0), len)rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - 100 / (1 + up / down)// MFIMFIlength = 14MFIsrc = hlc3MFIupper = sum(volume * (change(MFIsrc) <= 0 ? 0 : MFIsrc), MFIlength)MFIlower = sum(volume * (change(MFIsrc) >= 0 ? 0 : MFIsrc), MFIlength)_rsi(MFIupper, MFIlower) =>    if MFIlower == 0        100    if MFIupper == 0        0    100.0 - (100.0 / (1.0 + MFIupper / MFIlower))mfi = _rsi(MFIupper, MFIlower)// v1 Bollinger Bandslength1 = 20src1 = closemult1 = 1.0basis1 = sma(src1, length1)dev1 = mult1 * stdev(src1, length1)upper1 = basis1 + dev1lower1 = basis1 - dev1// v2 Bollinger Bandslength2 = 17src2 = closemult2 = 1.0basis2 = sma(src2, length2)dev2 = mult2 * stdev(src2, length2)upper2 = basis2 + dev2lower2 = basis2 - dev2////////// ** Triggers and Guards ** //////////// v1 Strategy ParametersRSILowerLevel1 = 42RSIUpperLevel1 = 70BBBuyTrigger1 = src1 < lower1BBSellTrigger1 = src1 > upper1rsiBuyGuard1 = rsi > RSILowerLevel1rsiSellGuard1 = rsi > RSIUpperLevel1// v2 Strategy ParametersRSILowerLevel2 = 42RSIUpperLevel2 = 76BBBuyTrigger2 = src2 < lower2BBSellTrigger2 = src2 > upper2rsiBuyGuard2 = rsi > RSILowerLevel2rsiSellGuard2 = rsi > RSIUpperLevel2// v3 Strategy ParametersMFILowerLevel3 = 60RSIUpperLevel3 = 65MFIUpperLevel3 = 64BBBuyTrigger3 = src1 < lower1BBSellTrigger3 = src1 > upper1mfiBuyGuard3 = mfi < MFILowerLevel3rsiSellGuard3 = rsi > RSIUpperLevel3mfiSellGuard3 = mfi > MFIUpperLevel3 //////////** Strategy Signals ** //////////// v1 SignalsBuy_1 = BBBuyTrigger1 and rsiBuyGuard1Sell_1 = BBSellTrigger1 and rsiSellGuard1if v1 == true    strategy.entry("Long", strategy.long, when = Buy_1, alert_message = "v1 - Buy Signal!")    strategy.close("Long", when = Sell_1, alert_message = "v1 - Sell Signal!")// v2 SignalsBuy_2 = BBBuyTrigger2 and rsiBuyGuard2Sell_2 = BBSellTrigger2 and rsiSellGuard2if v2 == true    strategy.entry("Long", strategy.long, when = Buy_2, alert_message = "v2 - Buy Signal!")    strategy.close("Long", when = Sell_2, alert_message = "v2 - Sell Signal!")    strategy.exit("Stoploss/TP", "Long", stop = v2stoploss_level, limit = v2takeprofit_level)// v3 SignalsBuy_3 = BBBuyTrigger3 and mfiBuyGuard3Sell_3 = BBSellTrigger3 and rsiSellGuard3 and mfiSellGuard3if v3 == true    strategy.entry("Long", strategy.long, when = Buy_3, alert_message = "v2 - Buy Signal!")    strategy.close("Long", when = Sell_3, alert_message = "v2 - Sell Signal!")    strategy.exit("Stoploss/TP", "Long", stop = v3stoploss_level, limit = v3takeprofit_level)