Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Baseline Cross Qualifier Volatility Strategy with HMA Trend Bias

A Pine Script v5 strategy built on SMA (close, 20) and ATR (14). It has 11 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 is one contract and pays no commission. 9 settings; defaults include Baseline Length 20, Post Baseline Cross Qualifier Bars Ago 3 and ATR Length 14.

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 Baseline Cross Qualifier Volatility Strategy with HMA Trend Bias repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 69 of 69 trades.
How did Baseline Cross Qualifier Volatility Strategy with HMA Trend Bias do on BTCUSDT 1D with default settings?
−1.38%
From 26 Jan 2024 to 21 Oct 2026, over 214 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does Baseline Cross Qualifier Volatility Strategy with HMA Trend Bias run in Pine Script v6?
No
The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L28:C20: 'bgcolor' has no 'transp' parameter in Pine Script v6. Use color.new(color, transparency) instead. The v6 version is shown for reference and is not offered as a download.
Does Baseline Cross Qualifier Volatility Strategy with HMA Trend Bias use a stop loss?
Yes
strategy.exit sets a stop on line 48, 49.
Does Baseline Cross Qualifier Volatility Strategy with HMA Trend Bias run in Zeal Terminal?
Yes
It compiles in 28 ms and runs 1,000 bars in 43 ms, in the browser.

BTCUSDT · 1D · default settings

  • Plot
  • 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 (9)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$986,246$2,025,273Equity from $1,000,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. Lines are what the script plots.
Net profit
−1.38%
−$13,752.10
Buy and hold
+102.5%
same period
Closed trades
214
36 won · 10 lost
Profitable
16.8%
of closed trades
Profit factor
0.63
gross profit ÷ gross loss
Max drawdown
1.84%
−$18,380.80

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.

  • Check

    1 setting does nothing

    “Volatility Multiplier” is declared but never read.

  • 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.

Settings

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

SettingDefaultType and rangeFeeds
Baseline Length20intbaseline
Post Baseline Cross Qualifier EnabledtrueboolpbcqValid
Post Baseline Cross Qualifier Bars Ago3intpbcqValid
ATR Length14intatr
Volatility Multiplier2.0floatunused
Volatility Range Multiplier1.0floatrangeHigh rangeLow
Volatility Qualifier Multiplier0.5floatqualifier
Take Profit Type1 Take Profitstring · options ["1 Take Profit", "2 Take Profits", "3 Take Profits"]exit TP/SL exit TP/SL exit TP1 exit TP2 exit TP1 exit TP2 exit TP1 exit TP2 exit TP3 line 47 line 50 line 55
HMA Length50intisLong isShort

What it calculates

  • SMAclose, Baseline Length (20)baseline · line 8
  • ATRATR Length (14)atr · line 23

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.

closecloseprice databaselineLengthBaseline Lengthsetting · 20high · low · closehigh · low · closeprice dataatrLengthATR Lengthsetting · 14rangeMultiplierVolatility Range Multip…setting · 1.0qualifierMultiplierVolatility Qualifier Mu…setting · 0.5hmaLengthHMA Lengthsetting · 50lowlowprice datapbcqBarsAgoPost Baseline Cross Qua…setting · 3takeProfitTypeTake Profit Typesetting · 1 Take ProfitbaselineSMA→ baselineatrATR→ atrrangeHigh, rangeLowrangeHigh · rangeLow2 valuesqualifierqualifiervaluelongConditionlongConditionconditionshortConditionshortConditionconditionisLong, isShortisLong · isShort2 conditionspbcqValidpbcqValidconditionrangeColor, colorDotColourrangeColor · colorDotentry:LongOpen Longstrategy.entryentry:ShortOpen Shortstrategy.entryexit:TP/SLexit TP/SLstrategy.exitexit:TP1exit TP1strategy.exitexit:TP2exit TP2strategy.exitexit:TP3exit TP3strategy.exitbgcolor:28bgcolorbgcolorplot:35plotplot

Order rules

OrderFires whenBy defaultLine
Open Long long(longCondition)On43
Open Short short(shortCondition)On45
Exit TP/SL stop and limit(takeProfitType == "1 Take Profit")On48
Exit TP/SL stop and limit(takeProfitType == "1 Take Profit")On49
Exit TP1 limit(takeProfitType == "2 Take Profits")On51
Exit TP2 limit(takeProfitType == "2 Take Profits")On52
Exit TP1 limit(takeProfitType == "2 Take Profits")On53
Exit TP2 limit(takeProfitType == "2 Take Profits")On54
Exit TP1 limit(takeProfitType == "3 Take Profits")On56
Exit TP2 limit(takeProfitType == "3 Take Profits")On57
Exit TP3 limit(takeProfitType == "3 Take Profits")On58

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.

69/69trades 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−1.4%+102.5%21417%0.631.8%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−0.2%+5.5%20115%0.780.3%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−0.0%+9.8%20414%0.960.1%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+0.0%+8.4%16325%1.090.0%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+0.0%+16.7%19917%1.550.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+0.0%+21.5%19021%1.540.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−0.0%+148.3%21921%0.690.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+0.0%+17.1%23218%1.590.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 barsTradesWonP&L
Rising market8217%−$4,873.52
Sideways market11016%−$8,902.53
Falling market2218%$23.94

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

How bad could the drawdown be?

2.7%

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

0%3%
The first 150 of 214 trades
SideEntryExitBarsP&L
long1 Apr 2024 71,280.002 Apr 2024 64,988.601−$6,291.44
short3 Apr 2024 65,464.008 Apr 2024 71,013.305−$5,549.32
long11 Apr 2024 70,631.1012 Apr 2024 65,792.901−$4,838.21
short15 Apr 2024 65,661.9015 Apr 2024 65,079.100$582.72
long20 May 2024 66,274.0020 May 2024 66,274.000$0.00
long21 May 2024 71,446.6021 May 2024 71,446.600$0.00
long22 May 2024 70,148.3022 May 2024 70,148.300$0.00
long23 May 2024 69,166.6023 May 2024 69,166.600$0.00
long24 May 2024 67,969.7024 May 2024 67,969.700$0.00
long25 May 2024 68,550.0025 May 2024 68,550.000$0.00
long26 May 2024 69,290.6026 May 2024 69,290.600$0.00
long27 May 2024 68,507.7027 May 2024 68,507.700$0.00
long28 May 2024 69,436.4028 May 2024 69,436.400$0.00
long29 May 2024 68,398.4029 May 2024 68,798.600$400.17
short12 Jun 2024 67,314.2013 Jun 2024 66,741.001$573.24
short14 Jun 2024 66,773.0014 Jun 2024 66,649.200$123.80
long19 Jul 2024 63,987.9019 Jul 2024 63,987.900$0.00
long20 Jul 2024 66,660.0020 Jul 2024 66,660.000$0.00
long21 Jul 2024 67,140.0021 Jul 2024 67,140.000$0.00
long22 Jul 2024 68,165.4022 Jul 2024 68,165.400$0.00
long23 Jul 2024 67,532.0023 Jul 2024 67,532.000$0.00
long24 Jul 2024 65,936.0024 Jul 2024 65,936.000$0.00
long25 Jul 2024 65,376.0025 Jul 2024 65,376.000$0.00
long26 Jul 2024 65,799.9026 Jul 2024 65,799.900$0.00
long27 Jul 2024 67,908.0027 Jul 2024 67,908.000$0.00
long28 Jul 2024 67,896.5028 Jul 2024 67,896.500$0.00
long30 Jul 2024 66,784.7030 Jul 2024 66,872.000$87.36
long27 Aug 2024 62,834.0027 Aug 2024 62,906.600$72.57
long18 Sep 2024 60,314.0018 Sep 2024 60,314.000$0.00
long19 Sep 2024 61,760.0019 Sep 2024 61,760.000$0.00
long22 Sep 2024 63,349.0022 Sep 2024 63,349.000$0.00
long23 Sep 2024 63,578.8023 Sep 2024 63,578.800$0.00
long24 Sep 2024 63,340.0024 Sep 2024 63,340.000$0.00
long25 Sep 2024 64,262.7025 Sep 2024 64,262.700$0.00
long26 Sep 2024 63,152.0026 Sep 2024 63,152.000$0.00
long27 Sep 2024 65,174.0027 Sep 2024 65,174.000$0.00
long28 Sep 2024 65,769.9028 Sep 2024 65,769.900$0.00
long29 Sep 2024 65,858.0029 Sep 2024 65,858.000$0.00
long30 Sep 2024 65,602.0030 Sep 2024 65,602.000$0.00
short2 Oct 2024 60,804.902 Oct 2024 60,237.900$567.06
short3 Oct 2024 60,649.303 Oct 2024 60,348.900$300.39
short4 Oct 2024 60,752.709 Oct 2024 61,195.405−$442.67
long19 Oct 2024 68,428.0019 Oct 2024 68,428.000$0.00
long20 Oct 2024 68,378.0020 Oct 2024 68,378.000$0.00
long21 Oct 2024 69,032.0021 Oct 2024 69,032.000$0.00
long22 Oct 2024 67,377.5022 Oct 2024 67,377.500$0.00
long23 Oct 2024 67,426.0023 Oct 2024 67,426.000$0.00
long24 Oct 2024 66,668.6024 Oct 2024 66,768.400$99.71
long25 Oct 2024 68,198.3025 Oct 2024 68,198.300$0.00
long28 Oct 2024 68,021.7028 Oct 2024 68,021.700$0.00
long11 Nov 2024 80,370.0011 Nov 2024 80,370.000$0.00
long12 Nov 2024 88,648.0012 Nov 2024 88,648.000$0.00
long13 Nov 2024 87,952.0013 Nov 2024 87,952.000$0.00
long14 Nov 2024 90,375.2014 Nov 2024 90,375.200$0.00
long15 Nov 2024 87,325.6015 Nov 2024 87,325.600$0.00
long16 Nov 2024 91,032.1016 Nov 2024 91,032.100$0.00
long17 Nov 2024 90,588.0017 Nov 2024 90,588.000$0.00
long18 Nov 2024 89,856.0018 Nov 2024 89,856.000$0.00
long19 Nov 2024 90,464.1019 Nov 2024 90,464.100$0.00
long20 Nov 2024 92,310.8020 Nov 2024 92,310.800$0.00
long21 Nov 2024 94,286.6021 Nov 2024 94,286.600$0.00
long22 Nov 2024 98,317.1022 Nov 2024 98,317.100$0.00
long23 Nov 2024 98,892.0023 Nov 2024 98,892.000$0.00
long24 Nov 2024 97,672.4024 Nov 2024 97,672.400$0.00
long25 Nov 2024 97,900.1025 Nov 2024 97,900.100$0.00
long16 Dec 2024 104,464.0016 Dec 2024 104,464.000$0.00
long17 Dec 2024 106,059.0017 Dec 2024 106,059.000$0.00
long18 Dec 2024 106,134.0018 Dec 2024 106,134.000$0.00
short20 Dec 2024 97,461.9020 Dec 2024 95,344.800$2,117.02
short22 Dec 2024 97,292.0022 Dec 2024 95,395.300$1,896.75
short10 Jan 2025 92,552.5010 Jan 2025 92,404.600$147.92
long21 Jan 2025 102,260.0021 Jan 2025 102,447.000$187.13
long22 Jan 2025 106,144.0022 Jan 2025 106,144.000$0.00
long23 Jan 2025 103,707.0023 Jan 2025 103,707.000$0.00
long24 Jan 2025 103,910.0024 Jan 2025 103,910.000$0.00
long25 Jan 2025 104,871.0025 Jan 2025 104,871.000$0.00
long26 Jan 2025 104,747.0026 Jan 2025 104,747.000$0.00
long27 Jan 2025 102,620.0029 Jan 2025 104,735.002$2,114.80
long30 Jan 2025 103,733.0030 Jan 2025 105,237.000$1,503.62
short3 Feb 2025 97,700.603 Feb 2025 97,700.600$0.00
long28 Mar 2025 87,232.0031 Mar 2025 82,390.003−$4,842.01
short31 Mar 2025 82,390.002 Apr 2025 87,761.602−$5,371.57
long18 Apr 2025 84,947.9021 Apr 2025 86,092.703$1,144.79
long22 Apr 2025 87,516.2022 Apr 2025 87,516.200$0.00
long23 Apr 2025 93,443.0023 Apr 2025 93,443.000$0.00
long25 Apr 2025 93,980.5025 Apr 2025 93,980.500$0.00
long26 Apr 2025 94,638.7026 Apr 2025 94,638.700$0.00
long27 Apr 2025 94,628.0027 Apr 2025 94,628.000$0.00
long28 Apr 2025 93,749.3028 Apr 2025 93,749.300$0.00
long29 Apr 2025 95,011.2029 Apr 2025 95,011.200$0.00
long30 Apr 2025 94,256.8030 Apr 2025 94,256.800$0.00
long1 May 2025 94,172.001 May 2025 94,172.000$0.00
long2 May 2025 96,489.902 May 2025 96,489.900$0.00
long3 May 2025 96,887.103 May 2025 96,887.100$0.00
long4 May 2025 95,856.404 May 2025 95,856.400$0.00
long7 May 2025 96,834.007 May 2025 96,834.000$0.00
long8 May 2025 97,030.508 May 2025 97,030.500$0.00
long12 May 2025 104,118.0012 May 2025 104,118.000$0.00
long13 May 2025 102,791.0013 May 2025 102,791.000$0.00
long14 May 2025 104,104.0014 May 2025 104,104.000$0.00
long15 May 2025 103,508.0015 May 2025 103,508.000$0.00
long16 May 2025 103,764.0016 May 2025 103,764.000$0.00
long19 May 2025 106,454.0019 May 2025 106,454.000$0.00
long21 May 2025 106,850.0021 May 2025 106,850.000$0.00
long22 May 2025 109,644.0022 May 2025 109,644.000$0.00
short31 May 2025 103,985.0031 May 2025 103,255.000$730.97
short1 Jun 2025 104,592.005 Jun 2025 103,959.004$633.10
long30 Jun 2025 108,357.0030 Jun 2025 108,530.000$172.93
long1 Jul 2025 107,147.002 Jul 2025 108,158.001$1,011.90
long3 Jul 2025 108,850.003 Jul 2025 108,850.000$0.00
long4 Jul 2025 109,585.004 Jul 2025 109,585.000$0.00
long7 Jul 2025 109,204.007 Jul 2025 109,204.000$0.00
long8 Jul 2025 108,263.008 Jul 2025 108,928.000$665.12
long9 Jul 2025 108,923.009 Jul 2025 109,081.000$158.39
long10 Jul 2025 111,234.0010 Jul 2025 111,234.000$0.00
long14 Jul 2025 119,087.0014 Jul 2025 119,087.000$0.00
long15 Jul 2025 119,841.0015 Jul 2025 119,841.000$0.00
long16 Jul 2025 117,758.0016 Jul 2025 117,758.000$0.00
long17 Jul 2025 118,630.0017 Jul 2025 118,630.000$0.00
long18 Jul 2025 119,178.0018 Jul 2025 119,178.000$0.00
long19 Jul 2025 117,925.0019 Jul 2025 117,925.000$0.00
long20 Jul 2025 117,840.0020 Jul 2025 117,840.000$0.00
long23 Jul 2025 119,954.0023 Jul 2025 119,954.000$0.00
short20 Aug 2025 112,873.0020 Aug 2025 112,873.000$0.00
short21 Aug 2025 114,271.0021 Aug 2025 113,648.000$622.91
long15 Sep 2025 115,268.0015 Sep 2025 115,268.000$0.00
long16 Sep 2025 115,350.0016 Sep 2025 115,350.000$0.00
long17 Sep 2025 116,789.0017 Sep 2025 116,789.000$0.00
long18 Sep 2025 116,448.0018 Sep 2025 116,448.000$0.00
long19 Sep 2025 117,074.0019 Sep 2025 117,074.000$0.00
long20 Sep 2025 115,632.0020 Sep 2025 115,632.000$0.00
long21 Sep 2025 115,686.0023 Sep 2025 112,651.002−$3,034.64
short23 Sep 2025 112,651.0023 Sep 2025 111,725.000$926.04
short24 Sep 2025 111,999.0024 Sep 2025 111,770.000$229.13
long6 Oct 2025 123,482.006 Oct 2025 123,482.000$0.00
long7 Oct 2025 124,659.007 Oct 2025 124,659.000$0.00
long8 Oct 2025 121,333.008 Oct 2025 121,333.000$0.00
long9 Oct 2025 123,306.009 Oct 2025 123,306.000$0.00
long10 Oct 2025 121,662.0010 Oct 2025 121,662.000$0.00
short11 Oct 2025 112,774.0011 Oct 2025 112,451.000$323.50
short12 Oct 2025 110,644.0012 Oct 2025 110,644.000$0.00
short31 Oct 2025 108,323.003 Nov 2025 106,673.003$1,650.34
short5 Nov 2025 101,497.005 Nov 2025 101,497.000$0.00
short6 Nov 2025 103,885.006 Nov 2025 103,885.000$0.00
long4 Dec 2025 93,429.909 Dec 2025 93,029.005−$400.95
long7 Jan 2026 93,748.007 Jan 2026 93,748.000$0.00
long8 Jan 2026 91,364.209 Jan 2026 91,848.601$484.39
long14 Jan 2026 95,414.0014 Jan 2026 95,414.000$0.00
long18 Jan 2026 95,147.8018 Jan 2026 95,147.800$0.00
long19 Jan 2026 93,673.1020 Jan 2026 90,075.301−$3,597.85

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
Baseline Cross Qualifier Volatility Strategy with HMA Trend Bias this page—v5 strategy−1.4%2141.8%
I11L - Better Buy Low Volatility or High Volatility- by I11Latr smav5 strategy+19.2%8337.4%
Vortex Cross w-MA Confirmation by DraftVentureatr smav5 strategy+2.4%524.7%
Configurable Multi MA Crossover Voting System by levieuxsma atrv5 strategy+28.5%539.4%
Swing Trend Strategy by Inkedlausma atrv5 strategy+11.2%516.2%
SSL Backtester With ATR SL TP and Money Management by JBTrippinsma atrv4 strategy+8.5%553.9%

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.

  • No v6-only features. v6 is not needed to run this script.

Clean v5

Verified

Nothing to change.

Does it run in Pine Script v6?

No

The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L28:C20: 'bgcolor' has no 'transp' parameter in Pine Script v6. Use color.new(color, transparency) instead. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © sevencampbell-//@version=5+//@version=6strategy(title="Baseline Cross Qualifier Volatility Strategy with HMA Trend Bias", overlay=true)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 28 msYes 1,000 bars in 43 msNot measured
PineTSNot testedNot testedNot 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/// © sevencampbell//@version=5strategy(title="Baseline Cross Qualifier Volatility Strategy with HMA Trend Bias", overlay=true)// --- User Inputs ---// Baseline InputsbaselineLength = input.int(title="Baseline Length", defval=20)baseline = ta.sma(close, baselineLength)// PBCQ InputspbcqEnabled = input.bool(title="Post Baseline Cross Qualifier Enabled", defval=true)pbcqBarsAgo = input.int(title="Post Baseline Cross Qualifier Bars Ago", defval=3)// Volatility InputsatrLength = input.int(title="ATR Length", defval=14)multiplier = input.float(title="Volatility Multiplier", defval=2.0)rangeMultiplier = input.float(title="Volatility Range Multiplier", defval=1.0)qualifierMultiplier = input.float(title="Volatility Qualifier Multiplier", defval=0.5)// Take Profit InputstakeProfitType = input.string(title="Take Profit Type", options=["1 Take Profit", "2 Take Profits", "3 Take Profits"], defval="1 Take Profit")// HMA InputshmaLength = input.int(title="HMA Length", defval=50)// --- Calculations ---// ATRatr = ta.atr(atrLength)// Range CalculationrangeHigh = baseline + rangeMultiplier * atrrangeLow = baseline - rangeMultiplier * atrrangeColor = rangeLow <= close and close <= rangeHigh ? color.yellow : nabgcolor(rangeColor, transp=90)// Qualifier Calculationqualifier = qualifierMultiplier * atr// Dot CalculationisLong = close > baseline and (close - baseline) >= qualifier and close > ta.hma(close, hmaLength)isShort = close < baseline and (baseline - close) >= qualifier and close < ta.hma(close, hmaLength)colorDot = isLong ? color.green : isShort ? color.red : naplot(isLong or isShort ? baseline : na, color=colorDot, style=plot.style_circles, linewidth=3)// --- Strategy Logic ---// PBCQpbcqValid = not pbcqEnabled or low[pbcqBarsAgo] > baseline// Entry LogiclongCondition = isLong and pbcqValidshortCondition = isShort and pbcqValidif (longCondition)    strategy.entry("Long", strategy.long)if (shortCondition)    strategy.entry("Short", strategy.short)// Exit Logicif (takeProfitType == "1 Take Profit")    strategy.exit("TP/SL", "Long", limit=rangeHigh, stop=rangeLow)    strategy.exit("TP/SL", "Short", limit=rangeLow, stop=rangeHigh)else if (takeProfitType == "2 Take Profits")    strategy.exit("TP1", "Long", qty=strategy.position_size * 0.5, limit=rangeHigh / 2)    strategy.exit("TP2", "Long", qty=strategy.position_size * 0.5, limit=rangeHigh)    strategy.exit("TP1", "Short", qty=strategy.position_size * 0.5, limit=rangeLow / 2)    strategy.exit("TP2", "Short", qty=strategy.position_size * 0.5, limit=rangeLow)else if (takeProfitType == "3 Take Profits")    strategy.exit("TP1", "Long", qty=strategy.position_size * 0.5, limit=rangeHigh / 2)    strategy.exit("TP2", "Long", qty=strategy.position_size * 0.25, limit=rangeHigh * 0.75)    strategy.exit("TP3", "Long", qty=strategy.position_size * 0.25, limit=rangeHigh * 1.5)