Pine Script v5 · Strategy
Rocket Grid Algorithm - The Quant Science
A Pine Script v5 strategy built on SMA (close, 10), Valuewhen (trigger_entry, close) and Crossunder (close, destroyall). It has 21 order rules, 20 entries among them, and trades long and short with the default settings. Exits wait for a signal; there is no stop loss. Each trade commits 1% of equity and pays 0.07% commission. 14 settings; defaults include Start Date 1, Start Month 1 and Start Year 2018.
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 Rocket Grid Algorithm - The Quant Science repaint?
- No
- No repainting patterns were found in the source. The live replay was not measured: the script acts only when barstate.isconfirmed is true, which Zeal Terminal's engine never reports during a live replay (it does not run a bar's closing update in live mode), so the replay cannot test this script.
- How did Rocket Grid Algorithm - The Quant Science 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. It closed no trades on the other markets either. A backtest, not investment advice.
- Does Rocket Grid Algorithm - The Quant Science run in Pine Script v6?
- No
- The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L190:C11: cannot use 'float' as a condition — Pine Script v6 does not cast 'int' or 'float' to 'bool' implicitly. Wrap it in bool(). The v6 version is shown for reference and is not offered as a download.
- Does Rocket Grid Algorithm - The Quant Science use a stop loss?
- No
- Every exit waits for a signal; nothing limits a losing trade before it fires.
- Does Rocket Grid Algorithm - The Quant Science run in Zeal Terminal?
- Yes
- It compiles in 100 ms and runs 1,000 bars in 293 ms, in the browser.
BTCUSDT · 1D · default settings
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- Plot
- 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 stop loss
Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.
-
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.
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 |
|---|---|---|---|
| Strategy Side | |||
| Long Strategy | | false | bool | line 189 |
| Short Selling Strategy | false | bool | line 210 |
| DATE PERIOD CONFIGURATION | |||
| Start Date | 1 | int · min 1 · max 31 | inDateRange |
| Start Month | 1 | int · min 1 · max 12 | inDateRange |
| Start Year | 2018 | int · min 1800 · max 2100 | inDateRange |
| End Date | 31 | int · min 1 · max 31 | inDateRange |
| End Month | 12 | int · min 1 · max 12 | inDateRange |
| End Year | 2023 | int · min 1800 · max 2100 | inDateRange |
| Lenght Configuration | |||
| Lenght: | 10 | int · min 0 | sma |
| STRATEGY CONFIGURATION | |||
| Enable StrategyCreate grid backtesting. | false | bool | line 89 line 158 |
| Percentage grid: | 0.50 | float · min 0 · step 0.10 | total_percentage_side |
| Lower destroyer: | 2.00 | float · min 0 · step 0.10 | destroyall |
| Upper destroyer: | 2.00 | float · min 0 · step 0.10 | takeprofitlevel |
| Trigger definition | |||
| Select strategy: | SMA Based Crossunder | string · options [ 'SMA Based Crossunder', 'SMA Based Crossover' ] | trigger_entry |
What it calculates
- SMAclose, Lenght: (10)
sma · line 35 - Valuewhentrigger_entry, close, 0
p_trigger_event · line 61 - Crossunderclose, destroyall
des_function · line 135 - Crossoverclose, takeprofitlevel
des_function2 · line 137
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 114 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 O #1 long | new_ten_grid_1 | On | 191 |
| Open O #2 long | new_ten_grid_2 | On | 193 |
| Open O #3 long | new_ten_grid_3 | On | 195 |
| Open O #4 long | new_ten_grid_4 | On | 197 |
| Open O #5 long | new_ten_grid_5 | On | 199 |
| Open O #6 long | new_ten_grid_6 | On | 201 |
| Open O #7 long | new_ten_grid_7 | On | 203 |
| Open O #8 long | new_ten_grid_8 | On | 205 |
| Open O #9 long | new_ten_grid_9 | On | 207 |
| Open O #10 long | new_ten_grid_10 | On | 209 |
| Open O #1 short | new_ten_grid_1 | On | 212 |
| Open O #2 short | new_ten_grid_2 | On | 214 |
| Open O #3 short | new_ten_grid_3 | On | 216 |
| Open O #4 short | new_ten_grid_4 | On | 218 |
| Open O #5 short | new_ten_grid_5 | On | 220 |
| Open O #6 short | new_ten_grid_6 | On | 222 |
| Open O #7 short | new_ten_grid_7 | On | 224 |
| Open O #8 short | new_ten_grid_8 | On | 226 |
| Open O #9 short | new_ten_grid_9 | On | 228 |
| Open O #10 short | new_ten_grid_10 | On | 230 |
| Close >>>> Destroyed Grid <<<< | des_function or des_function2 or close <= destroyall or close >= takeprofitlevel | On | 232 |
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 timingprocess_orders_on_close = true: orders fill at the signal bar's close.
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 | 0.0% | +9.8% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | 0.0% | +8.4% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | 0.0% | +16.7% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | 0.0% | +21.5% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | 0.0% | +148.3% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | 0.0% | +17.1% | 0 | 0% | — | 0.0% | 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 |
|---|---|---|---|---|---|
| Rocket Grid Algorithm - The Quant Science this page | — | v5 strategy | 0.0% | 0 | 0.0% |
| Buying Dip Strategy With Take Profit And Stop Loss [racer8] by racer8 | sma valuewhen | v4 strategy | −22.3% | 34 | 34.7% |
| [fpemehd] Strategy Template by DuDu95 | sma valuewhen | v5 strategy | +10.5% | 41 | 14.8% |
| Trend Bounce [racer8] by racer8 | sma valuewhen | v4 strategy | +2.4% | 22 | 32.2% |
| Alert(), alertcondition() or strategy alerts- by Peter_O | sma valuewhen | v4 strategy | +7,640,000.0% | 191 | 919.9% |
| Quantitative Trend Strategy- Uptrend long by CheatCode1 | sma valuewhen | v5 strategy | +5.9% | 28 | 32.8% |
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
VerifiedNothing 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 @L190:C11: cannot use 'float' as a condition — Pine Script v6 does not cast 'int' or 'float' to 'bool' implicitly. Wrap it in bool(). The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.
⋯ -//@version=5+//@version=6strategy(⋯Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 100 ms | With a workaround 1,000 bars in 293 ms | Not measured |
| PineTS | Not tested | Not tested | Not measured |
Zeal Terminal's engine currently reads an order side written as direction = strategy.long, direction = strategy.short as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (lines 191, 193, 195, 197, 199, 201 and more) so the engine trades the way the script says.
“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/// © thequantscience// ██████╗ ██████╗ ██████╗██╗ ██╗███████╗████████╗ ██████╗ ██████╗ ██╗██████╗ █████╗ ██╗ ██████╗ ██████╗ ██████╗ ██╗████████╗██╗ ██╗███╗ ███╗// ██╔══██╗██╔═══██╗██╔════╝██║ ██╔╝██╔════╝╚══██╔══╝ ██╔════╝ ██╔══██╗██║██╔══██╗ ██╔══██╗██║ ██╔════╝ ██╔═══██╗██╔══██╗██║╚══██╔══╝██║ ██║████╗ ████║// ██████╔╝██║ ██║██║ █████╔╝ █████╗ ██║ ██║ ███╗██████╔╝██║██║ ██║ ███████║██║ ██║ ███╗██║ ██║██████╔╝██║ ██║ ███████║██╔████╔██║// ██╔══██╗██║ ██║██║ ██╔═██╗ ██╔══╝ ██║ ██║ ██║██╔══██╗██║██║ ██║ ██╔══██║██║ ██║ ██║██║ ██║██╔══██╗██║ ██║ ██╔══██║██║╚██╔╝██║// ██║ ██║╚██████╔╝╚██████╗██║ ██╗███████╗ ██║ ╚██████╔╝██║ ██║██║██████╔╝ ██║ ██║███████╗╚██████╔╝╚██████╔╝██║ ██║██║ ██║ ██║ ██║██║ ╚═╝ ██║// ╚═╝ ╚═╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ //@version=5strategy( title = 'Rocket Grid Algorithm - The Quant Science', overlay = true, initial_capital = 10000, commission_type = strategy.commission.percent, commission_value = 0.07, pyramiding = 10, default_qty_type = strategy.percent_of_equity, process_orders_on_close=true )// #########################################################################################################long = input.bool(defval = false, title = "Long Strategy |", inline = "Strategy", group = "Strategy Side")short = input.bool(defval = false, title = "Short Selling Strategy ", inline = "Strategy", group = "Strategy Side")// #########################################################################################################startDate = input.int(title="Start Date", defval=1, minval=1, maxval=31, group = "DATE PERIOD CONFIGURATION")startMonth = input.int(title="Start Month", defval=1, minval=1, maxval=12, group = "DATE PERIOD CONFIGURATION")startYear = input.int(title="Start Year", defval=2018, minval=1800, maxval=2100, group = "DATE PERIOD CONFIGURATION")endDate = input.int(title="End Date", defval=31, minval=1, maxval=31, group = "DATE PERIOD CONFIGURATION")endMonth = input.int(title="End Month", defval=12, minval=1, maxval=12, group = "DATE PERIOD CONFIGURATION")endYear = input.int(title="End Year", defval=2023, minval=1800, maxval=2100, group = "DATE PERIOD CONFIGURATION")inDateRange = (time >= timestamp(syminfo.timezone, startYear, startMonth, startDate, 0, 0)) and (time < timestamp(syminfo.timezone, endYear, endMonth, endDate, 0, 0))// #########################################################################################################lenght_data = input.int(defval = 10, title = "Lenght: ", minval = 0, group = "Lenght Configuration")// #########################################################################################################sma = ta.sma(close, lenght_data)// #########################################################################################################ten_grid = input.bool(defval = false, title = "Enable Strategy", tooltip = "Create grid backtesting.", group = "STRATEGY CONFIGURATION")percentagegrid = input.float(defval = 0.50, minval = 0, step = 0.10, title = "Percentage grid: ", group = "STRATEGY CONFIGURATION")stop_loss = input.float(defval = 2.00, minval = 0, step = 0.10, title = "Lower destroyer: ", group = "STRATEGY CONFIGURATION")take_profit = input.float(defval = 2.00, minval = 0, step = 0.10, title = "Upper destroyer: ", group = "STRATEGY CONFIGURATION")// #########################################################################################################var float high_start = 0 var float high_end = 0trigger_event_sma1 = ta.crossunder(close, sma) and barstate.isconfirmedtrigger_event_sma2 = ta.crossover(close, sma) and barstate.isconfirmedTriggerGrid(type) => switch type 'SMA Based Crossunder' => trigger_event_sma1==true 'SMA Based Crossover' => trigger_event_sma2==truetype_input = input.string( 'SMA Based Crossunder', title = "Select strategy: ", options = [ 'SMA Based Crossunder', 'SMA Based Crossover' ], group = "Trigger definition" )trigger_entry = TriggerGrid(type_input) and strategy.opentrades==0 p_trigger_event = ta.valuewhen(trigger_entry, close, 0)total_percentage_side = 10 * percentagegridif trigger_entry==true high_start := p_trigger_event + ((p_trigger_event * total_percentage_side)/100) high_end := p_trigger_event - ((p_trigger_event * total_percentage_side)/100)grid_range = high_start - high_endvar float grid_1 = 0var float grid_2 = 0var float grid_3 = 0var float grid_4 = 0var float grid_5 = 0var float grid_6 = 0var float grid_7 = 0var float grid_8 = 0var float grid_9 = 0var float grid_10 = 0var float grid_11 = 0var float grid_12 = 0var float grid_13 = 0var float grid_14 = 0var float grid_15 = 0var float grid_16 = 0var float grid_17 = 0var float grid_18 = 0var float grid_19 = 0var float grid_20 = 0var float factor = 0 var float p = 0if ten_grid == true and trigger_entry==true factor := grid_range / 20 p := p_trigger_event // UP GRID grid_1 := (p + (factor * 1)) grid_2 := (p + (factor * 2)) grid_3 := (p + (factor * 3)) grid_4 := (p + (factor * 4)) grid_5 := (p + (factor * 5)) grid_6 := (p + (factor * 6)) grid_7 := (p + (factor * 7)) grid_8 := (p + (factor * 8)) grid_9 := (p + (factor * 9)) grid_10 := (p + (factor * 10)) // DOWN GRID grid_11 := (p - (factor * 1)) grid_12 := (p - (factor * 2)) grid_13 := (p - (factor * 3)) grid_14 := (p - (factor * 4)) grid_15 := (p - (factor * 5)) grid_16 := (p - (factor * 6)) grid_17 := (p - (factor * 7)) grid_18 := (p - (factor * 8)) grid_19 := (p - (factor * 9)) grid_20 := (p - (factor * 10))var float new_ten_grid_1 = 0 var float new_ten_grid_2 = 0 var float new_ten_grid_3 = 0 var float new_ten_grid_4 = 0 var float new_ten_grid_5 = 0 var float new_ten_grid_6 = 0 var float new_ten_grid_7 = 0 var float new_ten_grid_8 = 0 var float new_ten_grid_9 = 0 var float new_ten_grid_10 = 0var float new_ten_grid_11 = 0 var float new_ten_grid_12 = 0 var float new_ten_grid_13 = 0 var float new_ten_grid_14 = 0 var float new_ten_grid_15 = 0 var float new_ten_grid_16 = 0 var float new_ten_grid_17 = 0 var float new_ten_grid_18 = 0 var float new_ten_grid_19 = 0 var float new_ten_grid_20 = 0 destroyall = new_ten_grid_20 - (new_ten_grid_20 * stop_loss / 100)des_function = ta.crossunder(close, destroyall)takeprofitlevel = new_ten_grid_10 + (new_ten_grid_10 * take_profit / 100)des_function2 = ta.crossover(close, takeprofitlevel)var float lots_up1 = 0var float lots_up2 = 0var float lots_up3 = 0var float lots_up4 = 0var float lots_up5 = 0var float lots_up6 = 0var float lots_up7 = 0var float lots_up8 = 0var float lots_up9 = 0var float lots_up10 = 0var float lots_down1 = 0var float lots_down2 = 0var float lots_down3 = 0var float lots_down4 = 0var float lots_down5 = 0var float lots_down6 = 0var float lots_down7 = 0var float lots_down8 = 0var float lots_down9 = 0var float lots_down10 = 0if trigger_entry==true and ten_grid==true and inDateRange and strategy.opentrades==0 new_ten_grid_1 := grid_1 new_ten_grid_2 := grid_2 new_ten_grid_3 := grid_3 new_ten_grid_4 := grid_4 new_ten_grid_5 := grid_5 new_ten_grid_6 := grid_6 new_ten_grid_7 := grid_7 new_ten_grid_8 := grid_8 new_ten_grid_9 := grid_9 new_ten_grid_10 := grid_10 new_ten_grid_11 := grid_11 new_ten_grid_12 := grid_12 new_ten_grid_13 := grid_13 new_ten_grid_14 := grid_14 new_ten_grid_15 := grid_15 new_ten_grid_16 := grid_16 new_ten_grid_17 := grid_17 new_ten_grid_18 := grid_18 new_ten_grid_19 := grid_19 new_ten_grid_20 := grid_20 lots_up1 := (((strategy.equity / close) * 10) /100) lots_up2 := (((strategy.equity / close) * 9) /100) lots_up3 := (((strategy.equity / close) * 8) /100) lots_up4 := (((strategy.equity / close) * 7) /100) lots_up5 := (((strategy.equity / close) * 6) /100) lots_up6 := (((strategy.equity / close) * 5) /100) lots_up7 := (((strategy.equity / close) * 4) /100) lots_up8 := (((strategy.equity / close) * 3) /100) lots_up9 := (((strategy.equity / close) * 2) /100) lots_up10 := (((strategy.equity / close) * 1) /100) if long == true if new_ten_grid_1 strategy.entry(id = "O #1", direction = strategy.long, qty = lots_up1, stop = new_ten_grid_1) if new_ten_grid_2 strategy.entry(id = "O #2", direction = strategy.long, qty = lots_up2, stop = new_ten_grid_2) if new_ten_grid_3 strategy.entry(id = "O #3", direction = strategy.long, qty = lots_up3, stop = new_ten_grid_3) if new_ten_grid_4 strategy.entry(id = "O #4", direction = strategy.long, qty = lots_up4, stop = new_ten_grid_4) if new_ten_grid_5 strategy.entry(id = "O #5", direction = strategy.long, qty = lots_up5, stop = new_ten_grid_5) if new_ten_grid_6 strategy.entry(id = "O #6", direction = strategy.long, qty = lots_up6, stop = new_ten_grid_6) if new_ten_grid_7 strategy.entry(id = "O #7", direction = strategy.long, qty = lots_up7, stop = new_ten_grid_7) if new_ten_grid_8 strategy.entry(id = "O #8", direction = strategy.long, qty = lots_up8, stop = new_ten_grid_8) if new_ten_grid_9 strategy.entry(id = "O #9", direction = strategy.long, qty = lots_up9, stop = new_ten_grid_9) if new_ten_grid_10 strategy.entry(id = "O #10", direction = strategy.long, qty = lots_up10, stop = new_ten_grid_10) if short == true if new_ten_grid_1 strategy.entry(id = "O #1", direction = strategy.short, qty = lots_up1, limit = new_ten_grid_1) if new_ten_grid_2 strategy.entry(id = "O #2", direction = strategy.short, qty = lots_up2, limit = new_ten_grid_2) if new_ten_grid_3 strategy.entry(id = "O #3", direction = strategy.short, qty = lots_up3, limit = new_ten_grid_3) if new_ten_grid_4 strategy.entry(id = "O #4", direction = strategy.short, qty = lots_up4, limit = new_ten_grid_4) if new_ten_grid_5 strategy.entry(id = "O #5", direction = strategy.short, qty = lots_up5, limit = new_ten_grid_5) if new_ten_grid_6 strategy.entry(id = "O #6", direction = strategy.short, qty = lots_up6, limit = new_ten_grid_6) if new_ten_grid_7 strategy.entry(id = "O #7", direction = strategy.short, qty = lots_up7, limit = new_ten_grid_7) if new_ten_grid_8 strategy.entry(id = "O #8", direction = strategy.short, qty = lots_up8, limit = new_ten_grid_8) if new_ten_grid_9 strategy.entry(id = "O #9", direction = strategy.short, qty = lots_up9, limit = new_ten_grid_9) if new_ten_grid_10 strategy.entry(id = "O #10", direction = strategy.short, qty = lots_up10, limit = new_ten_grid_10)if des_function or des_function2 or close <= destroyall or close >= takeprofitlevel strategy.close_all(">>>> Destroyed Grid <<<<")// #########################################################################################################fill(plot(grid_1, color = color.new(color.rgb(0, 255, 132), 95)), plot(grid_2, color = color.new(color.rgb(0, 255, 132), 95)), color = color.new(#00ff08, 80))fill(plot(grid_2, color = color.new(color.rgb(0, 255, 132), 95)), plot(grid_3, color = color.new(color.rgb(0, 255, 132), 95)), color = color.new(#00ff08, 85))fill(plot(grid_3, color = color.new(color.rgb(0, 255, 132), 95)), plot(grid_4, color = color.new(color.rgb(0, 255, 132), 95)), color = color.new(#00ff08, 85))fill(plot(grid_4, color = color.new(color.rgb(0, 255, 132), 95)), plot(grid_5, color = color.new(color.rgb(0, 255, 132), 95)), color = color.new(#00ff08, 90))fill(plot(grid_1, color = color.new(color.rgb(0, 255, 132), 95)), plot(grid_6, color = color.new(color.rgb(0, 255, 132), 95)), color = color.new(#00ff08, 80))fill(plot(grid_6, color = color.new(color.rgb(0, 255, 132), 95)), plot(grid_7, color = color.new(color.rgb(0, 255, 132), 95)), color = color.new(#00ff08, 80))fill(plot(grid_7, color = color.new(color.rgb(0, 255, 132), 95)), plot(grid_8, color = color.new(color.rgb(0, 255, 132), 95)), color = color.new(#00ff08, 85))fill(plot(grid_8, color = color.new(color.rgb(0, 255, 132), 95)), plot(grid_9, color = color.new(color.rgb(0, 255, 132), 95)), color = color.new(#00ff08, 85))fill(plot(grid_9, color = color.new(color.rgb(0, 255, 132), 95)), plot(grid_10, color = color.new(color.rgb(0, 255, 132), 95)), color = color.new(#00ff08, 90))fill(plot(grid_11, color = color.new(#ff3c00, 95)), plot(grid_12, color = color.new(#fd3d36, 95)), color = color.new(#ff0000, 80))fill(plot(grid_12, color = color.new(#ff0000, 95)), plot(grid_13, color = color.new(#ff0000, 95)), color = color.new(#ff0000, 85))fill(plot(grid_13, color = color.new(#ff0000, 95)), plot(grid_14, color = color.new(#ff0000, 95)), color = color.new(#ff0000, 85))fill(plot(grid_14, color = color.new(#ff0000, 95)), plot(grid_15, color = color.new(#ff0000, 95)), color = color.new(#ff0000, 90))fill(plot(grid_11, color = color.new(#ff0000, 95)), plot(grid_16, color = color.new(#ff0800, 95)), color = color.new(#ff4800, 80))fill(plot(grid_16, color = color.new(#ff1100, 95)), plot(grid_17, color = color.new(#ff2600, 95)), color = color.new(#ff3300, 80))fill(plot(grid_17, color = color.new(#ff0000, 95)), plot(grid_18, color = color.new(#ff0000, 95)), color = color.new(#ff3c00, 85))fill(plot(grid_18, color = color.new(#ff3300, 95)), plot(grid_19, color = color.new(#ff3c00, 95)), color = color.new(#ff3300, 85))fill(plot(grid_19, color = color.new(#ff3c00, 95)), plot(grid_20, color = color.new(#ff0800, 95)), color = color.new(#ff1e00, 90))// #########################################################################################################if strategy.equity <= 0 runtime.error(" BANKRUPTCY: BACKTEST RETURN LOSS > EQUITY !!! ")// ###########################################################################################################