Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Daily Investments Index Scalp

A Pine Script v5 strategy built on SMA (close, 8), EMA (close, 150) and TR or Highest (true). It has 10 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 commits 100% of equity and pays no commission. 18 settings; defaults include Stoploss Type SWING, Take Profit Type ATR and Swing Stoploss Lookback Candles 15.

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 Investments Index Scalp repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 14 of 14 trades.
How did Daily Investments Index Scalp do on BTCUSDT 1D with default settings?
−6.95%
From 26 Jan 2024 to 21 Oct 2026, over 42 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does Daily Investments Index Scalp 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: 42 before, 35 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 Investments Index Scalp use a stop loss?
Yes
strategy.exit sets a stop on line 70, 71, 77, 78, 112, 115.
Does Daily Investments Index Scalp run in Zeal Terminal?
Yes
It compiles in 59 ms and runs 1,000 bars in 93 ms, in the browser.

BTCUSDT · 1D · default settings

  • Plot
  • Plot
  • SL LONG
  • TP1 LONG
  • TP2 LONG
  • SL SHORT
  • TP1 SHORT
  • TP2 SHORT
  • 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 (18)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$930$2,025Equity from $1,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
−6.95%
−$69.48
Buy and hold
+102.5%
same period
Closed trades
42
18 won · 16 lost
Profitable
42.9%
of closed trades
Profit factor
0.90
gross profit ÷ gross loss
Max drawdown
30.15%
−$368.57

One run with the author's default settings, $1,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 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

    2 settings have no label

    In the settings dialog src1 (line 30), src2 (line 31) 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.

Settings

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

SettingDefaultType and rangeFeeds
Stoploss TypeSWINGstring · options ["ATR", "SWING", "PERCENTAGE"]line 49 line 52
Take Profit TypeATRstring · options ["ATR", "SWING", "PERCENTAGE"]line 55 line 60
Swing Stoploss Lookback Candles15intslShort slLong TP_Short_1 TP_Short_2 TP_Long_1 TP_Long_2
Short Length3intshort
Medium Length8intmedium
Long Length20intlong
sourceclosesourcemedium short long emaValue emaShortValue
Ema Long Lenght150intemaValue
Ema Short Length35intemaShortValue
TP - ATR Multiplier1.5floatTP_Short_1 TP_Long_1
TP - ATR Multiplier3floatTP_Short_2 TP_Long_2
TP - TP RR1.2floatTP_Short_1 TP_Long_1
TP - TP RR2floatTP_Short_2 TP_Long_2
SL - ATR Multiplier1.5floatslShort slLong
ATR Length14int · min 1slShort slLong TP_Short_1 TP_Short_2 TP_Long_1 TP_Long_2
Smoothing ATRRMAstring · options ["RMA", "SMA", "EMA", "WMA"]line 33 line 36 line 39
Src1 (no label in the script)highsourceslShort TP_Long_1 TP_Long_2
Src2 (no label in the script)lowsourceslLong TP_Short_1 TP_Short_2

What it calculates

  • SMAsource (close), Medium Length (8)medium · line 13
  • SMAsource (close), Short Length (3)short · line 14
  • SMAsource (close), Long Length (20)long · line 15
  • EMAsource (close), Ema Long Lenght (150)emaValue · line 24
  • EMAsource (close), Ema Short Length (35)emaShortValue · line 25
  • TR / HighesttrueslShort · line 50
  • TR / LowesttrueslLong · line 51
  • TR / HighesttrueTP_Short_1 · line 56
  • TR / HighesttrueTP_Short_2 · line 57
  • TR / LowesttrueTP_Long_1 · line 58
  • TR / LowesttrueTP_Long_2 · line 59

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 datamediumLengthMedium Lengthsetting · 8shortLengthShort Lengthsetting · 3longLengthLong Lengthsetting · 20emaEma Long Lenghtsetting · 150emaShortEma Short Lengthsetting · 35highhighprice datahigh · low · closehigh · low · closeprice datalengthAtrATR Lengthsetting · 14multiplierSLSL - ATR Multipliersetting · 1.5SwingLenghtSwing Stoploss Lookback…setting · 15lowlowprice datamultiplierTP1TP - ATR Multipliersetting · 1.5RRTP1TP - TP RRsetting · 1.2multiplierTP2TP - ATR Multipliersetting · 3RRTP2TP - TP RRsetting · 2mediumSMA→ mediumshortSMA→ shortlongSMA→ longemaValueEMA→ emaValueemaShortValueEMA→ emaShortValueslShortTR / Highest→ slShortslLongTR / Lowest→ slLongTP_Short_1TR / Highest→ TP_Short_1TP_Short_2TR / Highest→ TP_Short_2TP_Long_1TR / Lowest→ TP_Long_1TP_Long_2TR / Lowest→ TP_Long_2long_stop_levellong_stop_levelvaluelong_limit1_levellong_limit1_levelvaluelong_limit2_levellong_limit2_levelvalueshort_stop_levelshort_stop_levelvalueshort_limit1_levelshort_limit1_levelvalueshort_limit2_levelshort_limit2_levelvaluelblColourlblclose_all:close_all strategy.close_allentry:LongOpen Longstrategy.entryexit:Exit Long TP1exit Exit Long TP1strategy.exitexit:Exit Long TP2exit Exit Long TP2strategy.exitentry:ShortOpen Shortstrategy.entryexit:Exit Short TP1exit Exit Short TP1strategy.exitexit:Exit Short TP2exit Exit Short TP2strategy.exitplot:26plotplotplot:27plotplotplot:122SL LONGplotplot:123TP1 LONGplotplot:124TP2 LONGplotplot:125SL SHORTplotplot:126TP1 SHORTplotplot:127TP2 SHORTplot

Order rules

OrderFires whenBy defaultLine
Close (ta.crossover(short,long) and close > emaValue and emaShortValue > emaValue and strategy.position_size <= 0)On68
Open Long long(ta.crossover(short,long) and close > emaValue and emaShortValue > emaValue and strategy.position_size <= 0)On69
Exit Exit Long TP1 stop and limit(ta.crossover(short,long) and close > emaValue and emaShortValue > emaValue and strategy.position_size <= 0)On70
Exit Exit Long TP2 stop and limit(ta.crossover(short,long) and close > emaValue and emaShortValue > emaValue and strategy.position_size <= 0)On71
Close (ta.crossunder(short,long) and close < emaValue and emaShortValue < emaValue and strategy.position_size >= 0)On75
Open Short short(ta.crossunder(short,long) and close < emaValue and emaShortValue < emaValue and strategy.position_size >= 0)On76
Exit Exit Short TP1 stop and limit(ta.crossunder(short,long) and close < emaValue and emaShortValue < emaValue and strategy.position_size >= 0)On77
Exit Exit Short TP2 stop and limit(ta.crossunder(short,long) and close < emaValue and emaShortValue < emaValue and strategy.position_size >= 0)On78
Exit Exit Long TP2 stop and limit(curLongStage == 2)On112
Exit Exit Short TP2 stop and limit(curShortStage == 2)On115

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.

14/14trades 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−6.9%+102.5%4243%0.9030.1%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−11.6%+5.5%3832%0.5513.4%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−56.7%+9.8%4633%0.5064.2%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h−1.8%+8.4%4248%0.9411.6%8 May 2026 – 21 Oct 2026
SOLUSDT 1D−57.9%+16.7%4432%0.4661.5%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h−11.7%+21.5%3837%0.7117.9%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−34.2%+148.3%3941%0.5545.2%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+16.5%+17.1%4255%2.039.2%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 market1450%$68.84
Sideways market1850%$149.61
Falling market1020%−$287.93

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

How bad could the drawdown be?

30.3%

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

0%35%
All 42 trades
SideEntryExitBarsP&L
short30 Aug 2024 59,359.006 Sep 2024 54,573.807$40.31
short30 Aug 2024 59,359.0013 Sep 2024 59,359.0014$0.00
long14 Oct 2024 62,870.0014 Oct 2024 66,237.200$27.86
long14 Oct 2024 62,870.0020 Oct 2024 69,188.706$52.28
long7 Nov 2024 75,572.0010 Nov 2024 80,229.903$34.53
long7 Nov 2024 75,572.0011 Nov 2024 84,059.804$62.92
long5 Jan 2025 98,220.509 Jan 2025 91,530.404−$41.48
long5 Jan 2025 98,220.509 Jan 2025 91,530.404−$41.48
long16 Jan 2025 100,497.0019 Jan 2025 106,217.003$32.30
long16 Jan 2025 100,497.0020 Jan 2025 100,497.004$0.00
long22 Feb 2025 96,182.0024 Feb 2025 93,388.102−$16.95
long22 Feb 2025 96,182.0024 Feb 2025 93,388.102−$16.95
short31 Mar 2025 82,390.007 Apr 2025 76,591.407$39.88
short31 Mar 2025 82,390.009 Apr 2025 82,390.009$0.00
long10 Jun 2025 110,263.0022 Jun 2025 100,372.0012−$52.62
long10 Jun 2025 110,263.0022 Jun 2025 100,372.0012−$52.62
long26 Jun 2025 107,341.0010 Jul 2025 112,841.0014$27.36
long26 Jun 2025 107,341.0011 Jul 2025 117,546.0015$50.77
long10 Aug 2025 116,462.0011 Aug 2025 121,802.001$26.27
long10 Aug 2025 116,462.0018 Aug 2025 116,462.008$0.00
long10 Sep 2025 111,546.0018 Sep 2025 117,370.008$30.60
long10 Sep 2025 111,546.0023 Sep 2025 111,546.0013$0.00
long2 Oct 2025 118,595.003 Oct 2025 122,438.001$19.49
long2 Oct 2025 118,595.0010 Oct 2025 118,595.008$0.00
long27 Oct 2025 114,559.004 Nov 2025 103,528.008−$58.86
long27 Oct 2025 114,559.004 Nov 2025 103,528.008−$58.86
short15 Dec 2025 88,172.205 Jan 2026 94,589.0021−$40.20
short15 Dec 2025 88,172.205 Jan 2026 94,589.0021−$40.20
short21 Jan 2026 88,427.7029 Jan 2026 84,184.908$24.57
short21 Jan 2026 88,427.7031 Jan 2026 80,473.8010$46.07
short9 Mar 2026 65,971.2016 Mar 2026 74,050.007−$67.05
short9 Mar 2026 65,971.2016 Mar 2026 74,050.007−$67.05
short22 Mar 2026 68,918.1014 Apr 2026 76,000.0023−$49.37
short22 Mar 2026 68,918.1014 Apr 2026 76,000.0023−$49.37
short18 May 2026 77,457.7028 May 2026 73,534.5010$21.83
short18 May 2026 77,457.702 Jun 2026 70,333.8015$39.65
short24 Jun 2026 62,734.6025 Jun 2026 58,749.801$29.33
short24 Jun 2026 62,734.603 Jul 2026 62,734.609$0.00
short29 Jul 2026 63,915.0019 Aug 2026 66,956.1021−$22.67
short29 Jul 2026 63,915.0019 Aug 2026 66,956.1021−$22.67
long20 Sep 2026 81,250.0021 Sep 2026 85,346.401$22.88
long20 Sep 2026 81,250.008 Oct 2026 81,250.0018$0.00

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
Daily Investments Index Scalp this page—v5 strategy−6.9%4230.1%
stoch supertrd atr 200ma by sammie123567858ema sma tr highest lowestv5 strategy+0.7%91.4%
Forex bot full strategy with risk management by exlux99lowest highest ema smav4 strategy−26.4%1138.9%
[fpemehd] SSL Baseline Strategy by DuDu95ema sma highest lowest trv5 strategy+2.3%713.7%
SSL + Wave Trend Strategy by kevinmck100ema sma highest lowest trv5 strategy−1.0%11.0%
ATR + STC + MA by Romediusema lowest highest smav5 strategy−1.2%153.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.

  • 2 settings use the untyped input() (line 30, 31). 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.

Clean v5

VerifiedDownload the v5 script

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

  • Line 30: input() → input.source()
  • Line 31: input() → input.source()
⋯smoothingAtr = input.string(title="Smoothing ATR", defval="RMA", options=["RMA", "SMA", "EMA", "WMA"])-src1 = input(high)+src1 = input.source(high)-src2 = input(low)+src2 = input.source(low)ma_function(source, length) =>⋯

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

⋯// © nedled-//@version=5+//@version=6strategy("Daily Investments Index Scalp", overlay=true,format=format.price,precision = 2, pyramiding = 0, initial_capital = 1000, default_qty_value = 100, default_qty_type = strategy.percent_of_equity)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 59 msYes 1,000 bars in 93 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/// © nedled//@version=5strategy("Daily Investments Index Scalp", overlay=true,format=format.price,precision = 2, pyramiding = 0, initial_capital = 1000, default_qty_value = 100, default_qty_type = strategy.percent_of_equity)var entryPrice = 0StoplossType = input.string(title="Stoploss Type", defval="SWING", options=["ATR", "SWING", "PERCENTAGE"])takeProfitType = input.string(title="Take Profit Type", defval="ATR", options=["ATR", "SWING", "PERCENTAGE"])SwingLenght = input.int(title="Swing Stoploss Lookback Candles",defval = 15) shortLength =  input.int(title="Short Length",defval = 3) mediumLength = input.int(title="Medium Length",  defval=8)longLength = input.int(title="Long Length",  defval=20)src = input.source(title="source", defval = close)medium = ta.sma(src,mediumLength)short = ta.sma(src,shortLength) / mediumlong = ta.sma(src,longLength) / mediumema = input.int(150,title = "Ema Long Lenght")emaShort = input.int(35,title = "Ema Short Length")//multi profitmultiplierTP1 = input.float(1.5,"TP - ATR Multiplier")multiplierTP2 = input.float(3,"TP - ATR Multiplier")RRTP1 = input.float(1.2,"TP - TP RR")RRTP2 = input.float(2,"TP - TP RR")multiplierSL = input.float(1.5,"SL - ATR Multiplier")emaValue = ta.ema(src,ema)emaShortValue = ta.ema(src,emaShort)plot(emaValue, color= color.red)plot(emaShortValue, color = color.blue)lengthAtr = input.int(title="ATR Length", defval=14,minval = 1)smoothingAtr = input.string(title="Smoothing ATR", defval="RMA", options=["RMA", "SMA", "EMA", "WMA"])src1 = input(high)src2 = input(low)ma_function(source, length) =>    if smoothingAtr == "RMA"        ta.rma(source, length)    else        if smoothingAtr == "SMA"            ta.sma(source, length)        else            if smoothingAtr == "EMA"                ta.ema(source, length)            else                ta.wma(source, length)slShort = 0.0slLong = 0.0TP_Short_1 = 0.0TP_Short_2 = 0.0TP_Long_1 = 0.0TP_Long_2 = 0.0if(StoplossType == "ATR")    slShort := ma_function(ta.tr(true), lengthAtr) * multiplierSL + src1    slLong := src2 - ma_function(ta.tr(true), lengthAtr) * multiplierSLelse if(StoplossType == "SWING")    slShort :=   ta.highest(high,SwingLenght)    slLong  := ta.lowest(low, SwingLenght)if(takeProfitType == "ATR")    TP_Short_1 := src2 - ma_function(ta.tr(true), lengthAtr) * multiplierTP1    TP_Short_2 := src2 - ma_function(ta.tr(true), lengthAtr) * multiplierTP2    TP_Long_1 := ma_function(ta.tr(true), lengthAtr) * multiplierTP1 + src1    TP_Long_2 := ma_function(ta.tr(true), lengthAtr) * multiplierTP2 + src1else if(takeProfitType == "SWING")    TP_Short_1 := close - ((ta.highest(high,SwingLenght) - close)* RRTP1)    TP_Short_2 := close - ((ta.highest(high,SwingLenght) - close)* RRTP2)    TP_Long_1 :=  close + ((close - ta.lowest(low, SwingLenght) ) * RRTP1)    TP_Long_2 := close + ((close - ta.lowest(low, SwingLenght)  ) * RRTP2)bool goLong = falseif(ta.crossover(short,long) and close > emaValue and emaShortValue > emaValue and strategy.position_size <= 0)    goLong := true    strategy.close_all()    strategy.entry("Long", strategy.long, stop = slLong, alert_message = "Entered long position")    strategy.exit("Exit Long TP1", from_entry = "Long", limit = TP_Long_1, qty_percent = 50, stop = slLong)    strategy.exit("Exit Long TP2", from_entry = "Long", limit = TP_Long_2, stop = slLong)bool goShort = falseif(ta.crossunder(short,long) and close < emaValue and  emaShortValue < emaValue and strategy.position_size >= 0)    goShort := true    strategy.close_all()    strategy.entry("Short", strategy.short, stop = slShort, alert_message = "Entered short position")    strategy.exit("Exit Short TP1", from_entry = "Short", limit= TP_Short_1, qty_percent = 50, stop = slShort)    strategy.exit("Exit Short TP2", from_entry = "Short", limit= TP_Short_2, stop = slShort)long_stop_level = float(na)long_stop_level := goLong ? slLong : long_stop_level[1]long_limit1_level = float(na)long_limit1_level := goLong ? TP_Long_1 : long_limit1_level[1]long_limit2_level = float(na)long_limit2_level := goLong ? TP_Long_2 : long_limit2_level[1]short_stop_level = float(na)short_stop_level := goShort ?  slShort : short_stop_level[1]short_limit1_level = float(na)short_limit1_level := goShort ? TP_Short_1 : short_limit1_level[1]short_limit2_level = float(na)short_limit2_level := goShort ? TP_Short_2 : short_limit2_level[1]getCurrentStageLong() =>    var stage = 0    if strategy.position_size == 0         stage := 0    if stage == 0 and strategy.position_size > 0        stage := 1    else if stage == 1 and long_limit1_level[1] < high        stage := 2    stagegetCurrentStageShort() =>    var stage = 0    if strategy.position_size == 0         stage := 0    if stage == 0 and strategy.position_size < 0        stage := 1    else if stage == 1 and short_limit1_level[1] > low        stage := 2        stagecurLongStage = getCurrentStageLong()if(curLongStage == 2)    strategy.exit("Exit Long TP2", from_entry = "Long", limit = long_limit2_level, stop = strategy.opentrades.entry_price(strategy.opentrades - 1))curShortStage = getCurrentStageShort()if(curShortStage == 2)    strategy.exit("Exit Short TP2", from_entry = "Short", limit = short_limit2_level, stop = strategy.opentrades.entry_price(strategy.opentrades - 1))print(txt) =>    // Create label on the first bar.    var lbl = label.new(bar_index, na, txt, xloc.bar_index, yloc.price, color(na), label.style_none, color.gray, size.large, text.align_left)    // On next bars, update the label's x and y position, and the text it displays.    label.set_xy(lbl, bar_index, ta.highest(10)[1])    label.set_text(lbl, txt)plot(strategy.position_size > 0 ?  long_stop_level : na,title= "SL LONG", color = color.red, style = plot.style_steplinebr)plot(strategy.position_size > 0 ?  long_limit1_level : na,title= "TP1 LONG", color = color.green, style = plot.style_steplinebr)plot(strategy.position_size > 0 ?  long_limit2_level : na,title= "TP2 LONG", color = color.green, style = plot.style_steplinebr)plot(strategy.position_size < 0 ?  short_stop_level : na,title= "SL SHORT", color = color.yellow, style = plot.style_steplinebr)plot(strategy.position_size < 0 ?  short_limit1_level : na,title= "TP1 SHORT", color = color.green, style = plot.style_steplinebr)plot(strategy.position_size < 0 ?  short_limit2_level : na,title= "TP2 SHORT", color = color.green, style = plot.style_steplinebr)// Table Results//tableBgcolor=#686868//if barstate.islastconfirmedhistory  //  var tbl = table.new(position.bottom_right, 3, 3, bgcolor = tableBgcolor, frame_width = 2, frame_color = color.black, border_width=2,border_color=color.black)    //table.cell(tbl, 0, 1, "Total Trades: " + str.tostring(strategy.closedtrades),           bgcolor=color.gray,text_size=size.small,text_color=color.white,text_valign=text.align_center)    //table.cell(tbl, 0, 2, "Win Rate: " +  str.tostring(math.round(strategy.wintrades / strategy.closedtrades * 100,2)) + "%", bgcolor=color.gray,text_size=size.small,text_color=color.white,text_valign=text.align_center)    //table.cell(tbl, 0, 0, "Initial Capital: " + str.tostring(strategy.initial_capital),     bgcolor=color.gray,text_size=size.small,text_color=color.white,text_valign=text.align_center)    //table.cell(tbl, 1, 0, "Net Profit: "  + str.tostring(math.round(strategy.netprofit,2)) + " ("+  str.tostring(math.round(strategy.netprofit / strategy.initial_capital * 100,2)) + "%"+ ")", bgcolor=strategy.netprofit>0?color.teal:color.maroon,text_size=size.small,text_color=color.white,text_valign=text.align_center)    //table.cell(tbl, 1, 1, "Current equity: "+ str.tostring(math.round(strategy.equity,2))+ "",    bgcolor=strategy.netprofit>0?color.teal:color.red,text_size=size.small,text_color=color.white,text_valign=text.align_center)    //table.cell(tbl, 1, 2, "Max DrawDown: "+ str.tostring(math.round(strategy.max_drawdown))+ " ("+ str.tostring(math.round(strategy.max_drawdown/ strategy.initial_capital * 100,2))+ "%"+ ")",     bgcolor=color.maroon,text_size=size.small,text_color=color.white,text_valign=text.align_center)