Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Take profit Multi timeframe

A Pine Script v5 strategy built on EMA (ap, 10), SMA (wt1, 4) and Change (time). It has 10 order rules, 1 entry among them, and trades long only with the default settings. Exits use a stop loss and a profit target. Each trade is one contract and pays no commission. 21 settings; defaults include Channel Length 10, Average Length 21 and Over Bought Lv 1 60.

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 Take profit Multi timeframe repaint?
Yes
At least one pattern in the source can repaint: intrabar recalculation.
How did Take profit Multi timeframe do on BTCUSDT 1D with default settings?
+25.41%
From 26 Jan 2024 to 21 Oct 2026, over 61 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does Take profit Multi timeframe 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: 61 before, 0 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 Take profit Multi timeframe use a stop loss?
Yes
strategy.exit sets a stop on line 62, 63, 64, 65, 68, 69, 70.
Does Take profit Multi timeframe run in Zeal Terminal?
Yes
It compiles in 91 ms and runs 1,000 bars in 190 ms, in the browser.

BTCUSDT · 1D · default settings

  • SL Long
  • Long TP1%
  • Long TP2%
  • Long TP3%
  • Long TP4%
  • Long TP1Mtf
  • Long TP2Mtf
  • Long TP3Mtf
  • Ema100 D
  • Ema200 D
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
TP1: 79641.67TP2: 81188.11TP3: 83507.77TP4: 85054.21Ema100 D: 77373.1375Ema200 D: 76126.571940,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$12,538$20,253Equity from $10,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. Lines, boxes and labels are the script's own drawings, the most recent ones its limits keep. The live re-run is not offered here: the script requests BINANCE:BTCUSDT 240, which this page cannot load in your browser.

Needs BINANCE:BTCUSDT 240 data, not available: a lower timeframe than the chart; the engine does not evaluate intrabar data Values that depend on it are empty on this chart.

Net profit
+25.41%
$2,540.89
Buy and hold
+102.5%
same period
Closed trades
61
31 won · 30 lost
Profitable
50.8%
of closed trades
Profit factor
1.06
gross profit ÷ gross loss
Max drawdown
97.47%
−$28,411.80

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

    5 settings do nothing

    “Over Bought Lv 1”, “Over Bought Lv 2”, “Over Sold Lv 1”, “Over Sold Lv 2”, “% Close At TP4” are declared but never read.

  • Check

    No commission

    The backtest assumes free trading. Results on any real exchange will be lower.

  • Note

    Uses an argument v6 removed

    when = on line 66, 71. The upgraded version below moves each call inside an if block.

Settings

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

SettingDefaultType and rangeFeeds
Set up take profit
Take profit %trueboolexit TP1% exit TP2% exit TP3% exit TP4% close_all line 61
Take profit Multi timeframefalseboolexit TP1Mtf exit TP2Mtf exit TP3Mtf close_all line 67
Example Strategy
Channel Length10intesa d
Average Length21inttci
Over Bought Lv 160intunused
Over Bought Lv 253intunused
Over Sold Lv 1-60intunused
Over Sold Lv 2-53intunused
Take profit %
TP1 %3float · step 0.1long_tp1_lv exit TP1%
TP2 %5float · step 1long_tp2_lv exit TP2%
TP3 %8float · step 1long_tp3_lv exit TP3%
TP4 %10float · step 1long_tp4_lv exit TP4%
Stop Loss %5float · step 1lossSTL
% Close At TP15float · step 1exit TP1% exit TP1Mtf
% Close At TP25float · step 1exit TP2% exit TP2Mtf
% Close At TP35float · step 1exit TP3% exit TP4% exit TP3Mtf
% Close At TP45float · step 1unused
Take profit Mtf
EMA1100inthtf_ma1 labelema1 labelema3
EMA2200inthtf_ma2 labelema2 labelema4
Timeframe 1240timeframeema1 ema2 labelema1 labelema2
Timeframe 2Dtimeframeema3 ema4 labelema3 labelema4

What it calculates

  • EMAap, Channel Length (10)esa · line 17
  • EMAmath.abs(ap - esa), Channel Length (10)d · line 18
  • EMAci, Average Length (21)tci · line 20
  • SMAwt1, 4wt2 · line 22
  • EMAsrc, EMA1 (100)htf_ma1 · line 47
  • EMAsrc, EMA2 (200)htf_ma2 · line 48
  • Changetime_x · line 91

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 61 named inputs, calculations, conditions and outputs, too many to draw legibly here; the tables above list them.

Order rules

OrderFires whenBy defaultLine
Open Long longbuyOn27
Exit TP1% stop and limittakepercent == trueOn62
Exit TP2% stop and limittakepercent == trueOn63
Exit TP3% stop and limittakepercent == trueOn64
Exit TP4% stop and limittakepercent == trueOn65
Close closebuyta.crossunder(wt1, wt2) and wt1 > 0On66
Exit TP1Mtf stop and limittakemtf == true and array.max(a, 1) > strategy.position_avg_priceOn68
Exit TP2Mtf stop and limittakemtf == true and array.max(a, 1) > strategy.position_avg_priceOn69
Exit TP3Mtf stop and limittakemtf == true and array.max(a, 1) > strategy.position_avg_priceOn70
Close closebuyta.crossunder(wt1, wt2) and wt1 > 0On71

Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.

Does it repaint?

Yes

At least one pattern in the source can repaint; it is marked Check below.

15/15trades 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. On 4 of them the position changed while the bar was forming before it settled. Anyone watching live sees those changes; once the bar closes it matches history.
  • ClearHigher-timeframe data4 request.security call(s), none with lookahead on.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • CheckIntrabar recalculationreads realtime-only state. Live values can differ from history.
  • 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

Not run on other markets: the script requests BINANCE:BTCUSDT 240, and that data is not available here (a lower timeframe than the chart; the engine does not evaluate intrabar data). Its results would rest on empty values.

The trades

By market direction

At entry, last 90 barsTradesWonP&L
Rising market1369%$12,571.10
Sideways market3845%−$12,308.70
Falling market1050%$2,278.51

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

How bad could the drawdown be?

86.2%

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

0%99%
All 61 trades
SideEntryExitBarsP&L
long21 Apr 2024 64,940.6022 Apr 2024 66,888.801$97.41
long21 Apr 2024 64,940.6030 Apr 2024 61,693.609−$162.35
long21 Apr 2024 64,940.6030 Apr 2024 61,693.609−$162.35
long21 Apr 2024 64,940.6030 Apr 2024 61,693.609−$162.35
long21 Apr 2024 64,940.6025 May 2024 68,550.0034$2,887.53
long30 Jun 2024 60,986.701 Jul 2024 62,816.301$91.48
long30 Jun 2024 60,986.704 Jul 2024 57,937.304−$152.47
long30 Jun 2024 60,986.704 Jul 2024 57,937.304−$152.47
long30 Jun 2024 60,986.704 Jul 2024 57,937.304−$152.47
long30 Jun 2024 60,986.7026 Jul 2024 65,799.9026$3,850.62
long10 Aug 2024 60,838.0012 Aug 2024 57,796.102−$152.09
long10 Aug 2024 60,838.0012 Aug 2024 57,796.102−$152.09
long10 Aug 2024 60,838.0012 Aug 2024 57,796.102−$152.09
long10 Aug 2024 60,838.0012 Aug 2024 57,796.102−$152.09
long10 Aug 2024 60,838.0028 Aug 2024 59,415.0018−$1,138.39
long11 Sep 2024 57,636.0013 Sep 2024 59,365.102$86.45
long11 Sep 2024 57,636.0013 Sep 2024 60,517.802$144.09
long11 Sep 2024 57,636.0019 Sep 2024 62,246.908$230.54
long11 Sep 2024 57,636.0019 Sep 2024 63,399.608$288.18
long11 Sep 2024 57,636.001 Oct 2024 63,327.6020$4,553.29
long3 Jan 2025 96,984.806 Jan 2025 99,894.303$145.48
long3 Jan 2025 96,984.806 Jan 2025 101,834.003$242.46
long3 Jan 2025 96,984.809 Jan 2025 95,060.606−$1,731.76
long15 Feb 2025 97,500.5024 Feb 2025 92,625.409−$243.75
long15 Feb 2025 97,500.5024 Feb 2025 92,625.409−$243.75
long15 Feb 2025 97,500.5024 Feb 2025 92,625.409−$243.75
long15 Feb 2025 97,500.5024 Feb 2025 92,625.409−$243.75
long15 Feb 2025 97,500.5029 Mar 2025 84,424.4042−$10,460.90
long11 Apr 2025 79,607.3012 Apr 2025 83,423.801$190.83
long11 Apr 2025 79,607.3012 Apr 2025 83,587.701$199.02
long11 Apr 2025 79,607.3013 Apr 2025 85,975.902$318.43
long11 Apr 2025 79,607.3021 Apr 2025 87,568.0010$398.04
long11 Apr 2025 79,607.3030 Apr 2025 94,256.8019$11,719.60
long25 Jun 2025 106,083.002 Jul 2025 109,265.007$159.13
long25 Jun 2025 106,083.009 Jul 2025 111,387.0014$265.21
long25 Jun 2025 106,083.0010 Jul 2025 114,570.0015$424.33
long25 Jun 2025 106,083.0010 Jul 2025 116,691.0015$530.41
long25 Jun 2025 106,083.0017 Jul 2025 118,630.0022$10,038.00
long3 Sep 2025 111,240.0011 Sep 2025 114,577.008$166.86
long3 Sep 2025 111,240.0016 Sep 2025 116,802.0013$278.10
long3 Sep 2025 111,240.0021 Sep 2025 115,686.0018$4,001.06
long22 Oct 2025 108,298.0024 Oct 2025 111,547.002$162.45
long22 Oct 2025 108,298.0026 Oct 2025 113,713.004$270.74
long22 Oct 2025 108,298.004 Nov 2025 102,883.0013−$270.74
long22 Oct 2025 108,298.004 Nov 2025 102,883.0013−$270.74
long22 Oct 2025 108,298.009 Jan 2026 91,100.0079−$13,758.10
long9 Feb 2026 70,330.4011 Feb 2026 66,813.902−$175.83
long9 Feb 2026 70,330.4011 Feb 2026 66,813.902−$175.83
long9 Feb 2026 70,330.4011 Feb 2026 66,813.902−$175.83
long9 Feb 2026 70,330.4011 Feb 2026 66,813.902−$175.83
long9 Feb 2026 70,330.408 Mar 2026 67,262.9027−$2,453.98
long2 Apr 2026 68,113.906 Apr 2026 70,157.304$102.17
long2 Apr 2026 68,113.907 Apr 2026 71,519.605$170.28
long2 Apr 2026 68,113.9011 Apr 2026 73,563.009$272.46
long2 Apr 2026 68,113.9014 Apr 2026 74,925.3012$340.57
long2 Apr 2026 68,113.9020 Apr 2026 73,801.8018$4,550.30
long26 May 2026 77,322.0028 May 2026 73,455.902−$193.31
long26 May 2026 77,322.0028 May 2026 73,455.902−$193.31
long26 May 2026 77,322.0028 May 2026 73,455.902−$193.31
long26 May 2026 77,322.0028 May 2026 73,455.902−$193.31
long26 May 2026 77,322.0025 Jul 2026 64,140.0060−$10,545.60

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
Take profit Multi timeframe this page—v5 strategy+25.4%6197.5%
MACD Long Strat by TheGrindTodayema smav4 strategy+24.0%7920.1%
Stock trending strategy by exlux99ema smav4 strategy+35.3%2114.7%
4-Hour Stochastic EMA Trend by slymnturkogluema smav4 strategyNo trades on this market
4X EMA and volume strategy by SoftKill21ema smav4 strategy+1.8%325.8%
Simple Momentum Strategy Based on SMA, EMA and Volume by slip_streamsma emav4 strategy+7.4%1827.4%

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 strategy calls use the when = argument (line 66, 71). It is deprecated in v5 and removed in v6, where each call moves inside an if block.
  • 6 settings use the untyped input() (line 10, 11, 12, 13, 14, 15). 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 61 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 10: input() → input.int()
  • Line 11: input() → input.int()
  • Line 12: input() → input.int()
  • Line 13: input() → input.int()
  • Line 14: input() → input.int()
  • Line 15: input() → input.int()
  • Line 66: when = closebuy → if block
  • Line 71: when = closebuy → if block
⋯//WaveTrend indicator-n1          = input(10, "Channel Length",       group="Example Strategy")+n1          = input.int(10, "Channel Length",       group="Example Strategy")-n2          = input(21, "Average Length",       group="Example Strategy")+n2          = input.int(21, "Average Length",       group="Example Strategy")-oblv1       = input(60, "Over Bought Lv 1",     group="Example Strategy")+oblv1       = input.int(60, "Over Bought Lv 1",     group="Example Strategy")-oblv2       = input(53, "Over Bought Lv 2",     group="Example Strategy")+oblv2       = input.int(53, "Over Bought Lv 2",     group="Example Strategy")-oslv1       = input(-60, "Over Sold Lv 1",      group="Example Strategy")+oslv1       = input.int(-60, "Over Sold Lv 1",      group="Example Strategy")-oslv2       = input(-53, "Over Sold Lv 2",      group="Example Strategy")+oslv2       = input.int(-53, "Over Sold Lv 2",      group="Example Strategy")ap          = hlc3 ⋯    strategy.exit("TP4%", "Long", qty_percent = qty3,   profit = percent(TP4), loss = lossSTL)-    strategy.close_all(when= closebuy, comment="Close All")+    if closebuy+        strategy.close_all(comment="Close All")if takemtf == true and array.max(a, 1) > strategy.position_avg_price⋯    strategy.exit("TP3Mtf", "Long", qty_percent = qty3, limit = tpmtf3, stop = long_sl_lv)-    strategy.close_all(when= closebuy, comment="Close All")+    if closebuy+        strategy.close_all(comment="Close All")// Plot TP & SL⋯

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

⋯// © TrendCrypto2022-//@version=5+//@version=6strategy(title = "Take profit Multi timeframe", overlay = true,  pyramiding=0,initial_capital = 10000, default_qty_type= strategy.fixed, default_qty_value =1, calc_on_order_fills=false, slippage=0,commission_type=strategy.commission.percent,commission_value=0)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 91 msYes 1,000 bars in 190 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/// © TrendCrypto2022//@version=5strategy(title = "Take profit Multi timeframe", overlay = true,  pyramiding=0,initial_capital = 10000, default_qty_type= strategy.fixed, default_qty_value =1, calc_on_order_fills=false, slippage=0,commission_type=strategy.commission.percent,commission_value=0)//Inputtakepercent     = input.bool(title="Take profit %",                 defval=true ,       group="Set up take profit")takemtf         = input.bool(title="Take profit Multi timeframe",   defval=false ,      group="Set up take profit")//Paste your strategy at here. This is example strategy: I use WaveTrend indicator//WaveTrend indicatorn1          = input(10, "Channel Length",       group="Example Strategy")n2          = input(21, "Average Length",       group="Example Strategy")oblv1       = input(60, "Over Bought Lv 1",     group="Example Strategy")oblv2       = input(53, "Over Bought Lv 2",     group="Example Strategy")oslv1       = input(-60, "Over Sold Lv 1",      group="Example Strategy")oslv2       = input(-53, "Over Sold Lv 2",      group="Example Strategy")ap          = hlc3 esa         = ta.ema(ap, n1)d           = ta.ema(math.abs(ap - esa), n1)ci          = (ap - esa) / (0.015 * d)tci         = ta.ema(ci, n2)wt1         = tciwt2         = ta.sma(wt1,4)//Strategybuy         = ta.crossover(wt1, wt2)    and wt1 < -20closebuy    = ta.crossunder(wt1, wt2)    and wt1 > 0if buy    strategy.entry("Long", strategy.long)//Set up take profit %percent(pcnt) =>    strategy.position_size != 0 ? math.round(pcnt / 100 * strategy.position_avg_price / syminfo.mintick) : float(na)TP1     =input.float(3, title="TP1 %", step=0.1,    group="Take profit %", inline = "1")TP2     =input.float(5, title="TP2 %", step=1,      group="Take profit %", inline = "1")TP3     =input.float(8, title="TP3 %", step=1,      group="Take profit %", inline = "2")TP4     =input.float(10, title="TP4 %", step=1,     group="Take profit %", inline = "2")SL      =input.float(5, title="Stop Loss %", step=1,        group="Take profit %")qty1    =input.float(5, title="% Close At TP1", step=1,     group="Take profit %", inline = "3")qty2    =input.float(5, title="% Close At TP2", step=1,     group="Take profit %", inline = "3")qty3    =input.float(5, title="% Close At TP3", step=1,     group="Take profit %", inline = "4")qty4    =input.float(5, title="% Close At TP4", step=1,     group="Take profit %", inline = "4")lossSTL = percent(SL)//Set up take profit at higher TFema_len1        = input.int(title='EMA1',                   defval=100,     group='Take profit Mtf')ema_len2        = input.int(title='EMA2',                   defval=200,     group='Take profit Mtf')src             = closetf1             = input.timeframe(title='Timeframe 1',      defval='240',   group='Take profit Mtf')tf2             = input.timeframe(title='Timeframe 2',      defval='D',     group='Take profit Mtf')htf_ma1         = ta.ema(src, ema_len1)htf_ma2         = ta.ema(src, ema_len2)ema1            = request.security(syminfo.tickerid, tf1, htf_ma1)ema2            = request.security(syminfo.tickerid, tf1, htf_ma2)ema3            = request.security(syminfo.tickerid, tf2, htf_ma1)ema4            = request.security(syminfo.tickerid, tf2, htf_ma2)//Set up take profit multi timeframea       = array.from((ema1), (ema2), (ema3), (ema4))tpmtf1  = array.min(a)tpmtf2  = array.min(a, 2)tpmtf3  = array.min(a, 3)tpmtf4  = array.min(a, 4)//Set up exitlong_sl_lv = strategy.position_avg_price - lossSTL*syminfo.mintickif takepercent == true    strategy.exit("TP1%", "Long", qty_percent = qty1,   profit = percent(TP1), loss = lossSTL)    strategy.exit("TP2%", "Long", qty_percent = qty2,   profit = percent(TP2), loss = lossSTL)    strategy.exit("TP3%", "Long", qty_percent = qty3,   profit = percent(TP3), loss = lossSTL)    strategy.exit("TP4%", "Long", qty_percent = qty3,   profit = percent(TP4), loss = lossSTL)    strategy.close_all(when= closebuy, comment="Close All")if takemtf == true and array.max(a, 1) > strategy.position_avg_price    strategy.exit("TP1Mtf", "Long", qty_percent = qty1, limit = tpmtf1, stop = long_sl_lv)    strategy.exit("TP2Mtf", "Long", qty_percent = qty2, limit = tpmtf2, stop = long_sl_lv)    strategy.exit("TP3Mtf", "Long", qty_percent = qty3, limit = tpmtf3, stop = long_sl_lv)    strategy.close_all(when= closebuy, comment="Close All")// Plot TP & SLlong_tp1_lv = strategy.position_avg_price + percent(TP1)*syminfo.minticklong_tp2_lv = strategy.position_avg_price + percent(TP2)*syminfo.minticklong_tp3_lv = strategy.position_avg_price + percent(TP3)*syminfo.minticklong_tp4_lv = strategy.position_avg_price + percent(TP4)*syminfo.mintickplot(strategy.position_size > 0 ? long_sl_lv : na, color=color.red, style=plot.style_linebr, title="SL Long")plot(strategy.position_size > 0 ? long_tp1_lv : na, color=color.lime, style=plot.style_linebr, title="Long TP1%")plot(strategy.position_size > 0 ? long_tp2_lv : na, color=color.lime, style=plot.style_linebr, title="Long TP2%")plot(strategy.position_size > 0 ? long_tp3_lv : na, color=color.lime, style=plot.style_linebr, title="Long TP3%")plot(strategy.position_size > 0 ? long_tp4_lv : na, color=color.lime, style=plot.style_linebr, title="Long TP4%")plot(strategy.position_size > 0 ? tpmtf1 : na, color=color.orange, style=plot.style_linebr, title="Long TP1Mtf", display = display.none)plot(strategy.position_size > 0 ? tpmtf2 : na, color=color.orange, style=plot.style_linebr, title="Long TP2Mtf", display = display.none)plot(strategy.position_size > 0 ? tpmtf3 : na, color=color.orange, style=plot.style_linebr, title="Long TP3Mtf", display = display.none)//Plot Resistant in higher TFplotema1 = plot(ema1, color=color.new(color.silver, 0),     style=plot.style_line, linewidth=1, offset=0, title='Ema100 4h',    display=display.none)plotema2 = plot(ema2, color=color.new(color.silver, 0),     style=plot.style_line, linewidth=1, offset=0, title='Ema200 4h',    display=display.none)plotema3 = plot(ema3, color=color.new(color.orange, 20),    style=plot.style_line, linewidth=1, offset=0, title='Ema100 D',     display=display.none)plotema4 = plot(ema4, color=color.new(color.orange, 20),    style=plot.style_line, linewidth=1, offset=0, title='Ema200 D',     display=display.none)//Label TP_x = timenow + math.round(ta.change(time) * 2)var label labelema1 = nalabel.delete(labelema1)labelema1 := label.new(x=_x, y=ema1, text='Ema' + str.tostring(ema_len1) + ' ' + str.tostring(tf1) + ': ' + str.tostring(math.round(ema1,4)) + '', color=color.new(#000000, 100), textcolor =  color.yellow, size=size.small, style=label.style_label_left, xloc=xloc.bar_time, yloc=yloc.price)var label labelema2 = nalabel.delete(labelema2)labelema2 := label.new(x=_x, y=ema2, text='Ema' + str.tostring(ema_len2) + ' ' + str.tostring(tf1) + ': ' + str.tostring(math.round(ema2,4)) + '', color=color.new(#000000, 100), textcolor = color.yellow, size=size.small, style=label.style_label_left, xloc=xloc.bar_time, yloc=yloc.price)var label labelema3 = nalabel.delete(labelema3)labelema3 := label.new(x=_x, y=ema3, text='Ema' + str.tostring(ema_len1) + ' ' + str.tostring(tf2) + ': ' + str.tostring(math.round(ema3,4)) + '', color=color.new(#000000, 100), textcolor = color.yellow, size=size.small, style=label.style_label_left, xloc=xloc.bar_time, yloc=yloc.price)var label labelema4 = nalabel.delete(labelema4)labelema4 := label.new(x=_x, y=ema4, text='Ema' + str.tostring(ema_len2) + ' ' + str.tostring(tf2) + ': ' + str.tostring(math.round(ema4,4)) + '', color=color.new(#000000, 100), textcolor = color.yellow, size=size.small, style=label.style_label_left, xloc=xloc.bar_time, yloc=yloc.price)if strategy.position_size > 0    var label labellongtp1 = na    label.delete(labellongtp1)    labellongtp1 := label.new(x=_x, y=long_tp1_lv, text='TP1: ' + str.tostring(math.round(long_tp1_lv,2)) + '', color=color.new(#000000, 100), textcolor = color.lime, size=size.small, style=label.style_label_left, xloc=xloc.bar_time, yloc=yloc.price)         var label labellongtp2 = na    label.delete(labellongtp2)    labellongtp2 := label.new(x=_x, y=long_tp2_lv, text='TP2: ' + str.tostring(math.round(long_tp2_lv,2)) + '', color=color.new(#000000, 100), textcolor = color.lime, size=size.small, style=label.style_label_left, xloc=xloc.bar_time, yloc=yloc.price)         var label labellongtp3 = na    label.delete(labellongtp3)    labellongtp3 := label.new(x=_x, y=long_tp3_lv, text='TP3: ' + str.tostring(math.round(long_tp3_lv,2)) + '', color=color.new(#000000, 100), textcolor = color.lime, size=size.small, style=label.style_label_left, xloc=xloc.bar_time, yloc=yloc.price)            var label labellongtp4 = na    label.delete(labellongtp4)    labellongtp4 := label.new(x=_x, y=long_tp4_lv, text='TP4: ' + str.tostring(math.round(long_tp4_lv,2)) + '', color=color.new(#000000, 100), textcolor = color.lime, size=size.small, style=label.style_label_left, xloc=xloc.bar_time, yloc=yloc.price)