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
- 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.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| Stoploss Type | SWING | string · options ["ATR", "SWING", "PERCENTAGE"] | line 49 line 52 |
| Take Profit Type | ATR | string · options ["ATR", "SWING", "PERCENTAGE"] | line 55 line 60 |
| Swing Stoploss Lookback Candles | 15 | int | slShort slLong TP_Short_1 TP_Short_2 TP_Long_1 TP_Long_2 |
| Short Length | 3 | int | short |
| Medium Length | 8 | int | medium |
| Long Length | 20 | int | long |
| source | close | source | medium short long emaValue emaShortValue |
| Ema Long Lenght | 150 | int | emaValue |
| Ema Short Length | 35 | int | emaShortValue |
| TP - ATR Multiplier | 1.5 | float | TP_Short_1 TP_Long_1 |
| TP - ATR Multiplier | 3 | float | TP_Short_2 TP_Long_2 |
| TP - TP RR | 1.2 | float | TP_Short_1 TP_Long_1 |
| TP - TP RR | 2 | float | TP_Short_2 TP_Long_2 |
| SL - ATR Multiplier | 1.5 | float | slShort slLong |
| ATR Length | 14 | int · min 1 | slShort slLong TP_Short_1 TP_Short_2 TP_Long_1 TP_Long_2 |
| Smoothing ATR | RMA | string · options ["RMA", "SMA", "EMA", "WMA"] | line 33 line 36 line 39 |
| Src1 (no label in the script) | high | source | slShort TP_Long_1 TP_Long_2 |
| Src2 (no label in the script) | low | source | slLong 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 / Highesttrue
slShort · line 50 - TR / Lowesttrue
slLong · line 51 - TR / Highesttrue
TP_Short_1 · line 56 - TR / Highesttrue
TP_Short_2 · line 57 - TR / Lowesttrue
TP_Long_1 · line 58 - TR / Lowesttrue
TP_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.
Order rules
| Order | Fires when | By default | Line |
|---|---|---|---|
| Close | (ta.crossover(short,long) and close > emaValue and emaShortValue > emaValue and strategy.position_size <= 0) | On | 68 |
| Open Long long | (ta.crossover(short,long) and close > emaValue and emaShortValue > emaValue and strategy.position_size <= 0) | On | 69 |
| Exit Exit Long TP1 stop and limit | (ta.crossover(short,long) and close > emaValue and emaShortValue > emaValue and strategy.position_size <= 0) | On | 70 |
| Exit Exit Long TP2 stop and limit | (ta.crossover(short,long) and close > emaValue and emaShortValue > emaValue and strategy.position_size <= 0) | On | 71 |
| Close | (ta.crossunder(short,long) and close < emaValue and emaShortValue < emaValue and strategy.position_size >= 0) | On | 75 |
| Open Short short | (ta.crossunder(short,long) and close < emaValue and emaShortValue < emaValue and strategy.position_size >= 0) | On | 76 |
| Exit Exit Short TP1 stop and limit | (ta.crossunder(short,long) and close < emaValue and emaShortValue < emaValue and strategy.position_size >= 0) | On | 77 |
| Exit Exit Short TP2 stop and limit | (ta.crossunder(short,long) and close < emaValue and emaShortValue < emaValue and strategy.position_size >= 0) | On | 78 |
| Exit Exit Long TP2 stop and limit | (curLongStage == 2) | On | 112 |
| Exit Exit Short TP2 stop and limit | (curShortStage == 2) | On | 115 |
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.
- 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 | −6.9% | +102.5% | 42 | 43% | 0.90 | 30.1% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | −11.6% | +5.5% | 38 | 32% | 0.55 | 13.4% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | −56.7% | +9.8% | 46 | 33% | 0.50 | 64.2% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | −1.8% | +8.4% | 42 | 48% | 0.94 | 11.6% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | −57.9% | +16.7% | 44 | 32% | 0.46 | 61.5% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | −11.7% | +21.5% | 38 | 37% | 0.71 | 17.9% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | −34.2% | +148.3% | 39 | 41% | 0.55 | 45.2% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | +16.5% | +17.1% | 42 | 55% | 2.03 | 9.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 bars | Trades | Won | P&L |
|---|---|---|---|
| Rising market | 14 | 50% | $68.84 |
| Sideways market | 18 | 50% | $149.61 |
| Falling market | 10 | 20% | −$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.
All 42 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| short | 30 Aug 2024 59,359.00 | 6 Sep 2024 54,573.80 | 7 | $40.31 |
| short | 30 Aug 2024 59,359.00 | 13 Sep 2024 59,359.00 | 14 | $0.00 |
| long | 14 Oct 2024 62,870.00 | 14 Oct 2024 66,237.20 | 0 | $27.86 |
| long | 14 Oct 2024 62,870.00 | 20 Oct 2024 69,188.70 | 6 | $52.28 |
| long | 7 Nov 2024 75,572.00 | 10 Nov 2024 80,229.90 | 3 | $34.53 |
| long | 7 Nov 2024 75,572.00 | 11 Nov 2024 84,059.80 | 4 | $62.92 |
| long | 5 Jan 2025 98,220.50 | 9 Jan 2025 91,530.40 | 4 | −$41.48 |
| long | 5 Jan 2025 98,220.50 | 9 Jan 2025 91,530.40 | 4 | −$41.48 |
| long | 16 Jan 2025 100,497.00 | 19 Jan 2025 106,217.00 | 3 | $32.30 |
| long | 16 Jan 2025 100,497.00 | 20 Jan 2025 100,497.00 | 4 | $0.00 |
| long | 22 Feb 2025 96,182.00 | 24 Feb 2025 93,388.10 | 2 | −$16.95 |
| long | 22 Feb 2025 96,182.00 | 24 Feb 2025 93,388.10 | 2 | −$16.95 |
| short | 31 Mar 2025 82,390.00 | 7 Apr 2025 76,591.40 | 7 | $39.88 |
| short | 31 Mar 2025 82,390.00 | 9 Apr 2025 82,390.00 | 9 | $0.00 |
| long | 10 Jun 2025 110,263.00 | 22 Jun 2025 100,372.00 | 12 | −$52.62 |
| long | 10 Jun 2025 110,263.00 | 22 Jun 2025 100,372.00 | 12 | −$52.62 |
| long | 26 Jun 2025 107,341.00 | 10 Jul 2025 112,841.00 | 14 | $27.36 |
| long | 26 Jun 2025 107,341.00 | 11 Jul 2025 117,546.00 | 15 | $50.77 |
| long | 10 Aug 2025 116,462.00 | 11 Aug 2025 121,802.00 | 1 | $26.27 |
| long | 10 Aug 2025 116,462.00 | 18 Aug 2025 116,462.00 | 8 | $0.00 |
| long | 10 Sep 2025 111,546.00 | 18 Sep 2025 117,370.00 | 8 | $30.60 |
| long | 10 Sep 2025 111,546.00 | 23 Sep 2025 111,546.00 | 13 | $0.00 |
| long | 2 Oct 2025 118,595.00 | 3 Oct 2025 122,438.00 | 1 | $19.49 |
| long | 2 Oct 2025 118,595.00 | 10 Oct 2025 118,595.00 | 8 | $0.00 |
| long | 27 Oct 2025 114,559.00 | 4 Nov 2025 103,528.00 | 8 | −$58.86 |
| long | 27 Oct 2025 114,559.00 | 4 Nov 2025 103,528.00 | 8 | −$58.86 |
| short | 15 Dec 2025 88,172.20 | 5 Jan 2026 94,589.00 | 21 | −$40.20 |
| short | 15 Dec 2025 88,172.20 | 5 Jan 2026 94,589.00 | 21 | −$40.20 |
| short | 21 Jan 2026 88,427.70 | 29 Jan 2026 84,184.90 | 8 | $24.57 |
| short | 21 Jan 2026 88,427.70 | 31 Jan 2026 80,473.80 | 10 | $46.07 |
| short | 9 Mar 2026 65,971.20 | 16 Mar 2026 74,050.00 | 7 | −$67.05 |
| short | 9 Mar 2026 65,971.20 | 16 Mar 2026 74,050.00 | 7 | −$67.05 |
| short | 22 Mar 2026 68,918.10 | 14 Apr 2026 76,000.00 | 23 | −$49.37 |
| short | 22 Mar 2026 68,918.10 | 14 Apr 2026 76,000.00 | 23 | −$49.37 |
| short | 18 May 2026 77,457.70 | 28 May 2026 73,534.50 | 10 | $21.83 |
| short | 18 May 2026 77,457.70 | 2 Jun 2026 70,333.80 | 15 | $39.65 |
| short | 24 Jun 2026 62,734.60 | 25 Jun 2026 58,749.80 | 1 | $29.33 |
| short | 24 Jun 2026 62,734.60 | 3 Jul 2026 62,734.60 | 9 | $0.00 |
| short | 29 Jul 2026 63,915.00 | 19 Aug 2026 66,956.10 | 21 | −$22.67 |
| short | 29 Jul 2026 63,915.00 | 19 Aug 2026 66,956.10 | 21 | −$22.67 |
| long | 20 Sep 2026 81,250.00 | 21 Sep 2026 85,346.40 | 1 | $22.88 |
| long | 20 Sep 2026 81,250.00 | 8 Oct 2026 81,250.00 | 18 | $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.
| Script | Shares | Type | Net | Trades | Max drawdown |
|---|---|---|---|---|---|
| Daily Investments Index Scalp this page | — | v5 strategy | −6.9% | 42 | 30.1% |
| stoch supertrd atr 200ma by sammie123567858 | ema sma tr highest lowest | v5 strategy | +0.7% | 9 | 1.4% |
| Forex bot full strategy with risk management by exlux99 | lowest highest ema sma | v4 strategy | −26.4% | 11 | 38.9% |
| [fpemehd] SSL Baseline Strategy by DuDu95 | ema sma highest lowest tr | v5 strategy | +2.3% | 71 | 3.7% |
| SSL + Wave Trend Strategy by kevinmck100 | ema sma highest lowest tr | v5 strategy | −1.0% | 1 | 1.0% |
| ATR + STC + MA by Romedius | ema lowest highest sma | v5 strategy | −1.2% | 15 | 3.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.
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
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 59 ms | Yes 1,000 bars in 93 ms | Not measured |
| PineTS | Not tested | Not tested | 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.
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)