Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Vin's Playzone Strategy

A Pine Script v5 strategy built on EMA (close, 2), RSI (close, 42) and SMA or Stoch (rsil, rsil, rsil, STOlen, 27). It has 6 order rules, 4 entries among them, and trades long and short with the default settings. Exits wait for a signal; there is no stop loss. Each trade is one contract and pays no commission. 21 settings; defaults include Source of price close, Timeframe in D and Fast EMA 13.

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 Vin's Playzone Strategy repaint?
Yes
At least one pattern in the source can repaint: higher-timeframe data.
How did Vin's Playzone Strategy do on BTCUSDT 1D with default settings?
−908.06%
From 26 Jan 2024 to 21 Oct 2026, over 21 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does Vin's Playzone Strategy 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: 21 before, 17 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 Vin's Playzone Strategy use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Vin's Playzone Strategy run in Zeal Terminal?
Yes
It compiles in 29 ms and runs 1,000 bars in 93 ms, in the browser.

BTCUSDT · 1D · default settings

  • Base-Line
  • Fast EMA
  • Slow EMA
  • BUY
  • Sell
  • Long
  • 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 (21)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$7,291$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. The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.
Net profit
−908.06%
−$9,080.60
Buy and hold
+102.5%
same period
Closed trades
21
6 won · 15 lost
Profitable
28.6%
of closed trades
Profit factor
0.90
gross profit ÷ gross loss
Max drawdown
3,570.52%
−$39,105.70

One run with the author's default settings, $1,000 starting capital, commission as the script sets it. A long position was still open at the last bar. 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.

  • Likely bug

    ta.ema(xcross, 1) ignores the settings line 26

    Line 26 hard-codes 1 where line 22 uses “Smoothing period”. Changing those settings moves one band but not this one.

    ta.ema(xcross, 1)ta.ema(xcross, smooter)
  • Check

    No stop loss

    Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.

  • Check

    No commission

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

  • Note

    No slippage

    Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.

  • Note

    Uses an argument v6 removed

    when = on line 89, 90, 91, 93, 94, 95. 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
Source of priceclosesourcexcross efast eslow ema3x
Fixed Timeframe?trueboolefast eslow
Timeframe inDtimeframeefast eslow ema3x
Fast EMA13intefast
Slow EMA26inteslow
Base-Line60intema3x
Smoothing period2intxcross efast eslow ema3x
Fill Bar Colorfalseboolbarcolor
Show Green-Red EMA?trueboolFast EMA Slow EMA
Show Buy-Sell signal?trueboolBUY Sell
Show Base-line?trueboolBase-Line
Fixed Base-line?trueboolema3x
Show Long-Short?trueboolplotshape
RSI Smoothing3int · min 0 · max 3buycon1 sellcon1 plotshape
StochRSI smooth K27int · min 1K
StochRSI smooth D18int · min 1D
RSI length42int · min 1rsil
Stochastic length42int · min 1K
Source for StochasticRSIclosesourcersil
Oversold Threshold30float · min 0.00iff_1 iff_2
overbought Threshold70float · min 0.00iff_3 iff_4

What it calculates

  • EMASource of price (close), Smoothing period (2)xcross · line 22
  • EMArequest.security(syminfo.tickerid, tfn, ta.ema(srcf, ema1), gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on), Smoothing period (2)efast · line 23
  • EMArequest.security(syminfo.tickerid, tfn, ta.ema(srcf, ema2), gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on), Smoothing period (2)eslow · line 24
  • EMArequest.security(syminfo.tickerid, tfn, ta.ema(srcf, ema3), gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on), Smoothing period (2)ema3x · line 25
  • EMAxcross, 1emabl · line 26
  • RSISource for StochasticRSI (close), RSI length (42)rsil · line 63
  • SMA / Stochta.stoch(rsil, rsil, rsil, STOlen), StochRSI smooth K (27)K · line 64
  • SMAK, StochRSI smooth D (18)D · line 65
  • CrossoverK, Dcrossover_1 · line 66
  • CrossoverK, Dcrossover_2 · line 67
  • CrossunderK, Dcrossunder_1 · line 71
  • CrossunderK, Dcrossunder_2 · line 72

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 datasmooterSmoothing periodsetting · 2tfnTimeframe insetting · Dema1Fast EMAsetting · 13ema2Slow EMAsetting · 26ema3Base-Linesetting · 60RSIlenRSI lengthsetting · 42STOlenStochastic lengthsetting · 42smoothKStochRSI smooth Ksetting · 27smoothDStochRSI smooth Dsetting · 18OSlelOversold Thresholdsetting · 30OBleloverbought Thresholdsetting · 70plotmmsmRSI Smoothingsetting · 3xcrossEMA→ xcrossefastEMA→ efasteslowEMA→ eslowema3xEMA→ ema3xemablEMA→ emablrsilRSI→ rsilKSMA / Stoch→ KDSMA→ Dcrossover_1Crossover→ crossover_1crossover_2Crossover→ crossover_2crossunder_1Crossunder→ crossunder_1crossunder_2Crossunder→ crossunder_2iff_1iff_1valueiff_2iff_2valuebuymorebuymorevalueiff_3iff_3valueiff_4iff_4valuesellmoresellmorevaluebuyconbuyconvaluesellconsellconvalueBull, BearBull · Bear2 conditionsG1, buywhenG1 · buywhen2 conditionsG2, G3G2 · G32 conditionsR1, sellwhenR1 · sellwhen2 conditionsR2, R3R2 · R32 conditionsbullish, bearishbullish · bearish2 conditionsbuybuyconditionsellsellconditionbuycon1buycon1conditionsellcon1sellcon1conditionbuyfirmbuyfirmconditionsellfirmsellfirmconditionbcl, fillclColourbcl · fillclentry:LongOpen Longstrategy.entryclose:LongClose Longstrategy.closeentry:ShortOpen Shortstrategy.entryclose:ShortClose Shortstrategy.closebarcolor:38barcolorbarcolorplot:40Base-Lineplotplot:41Fast EMAplotplot:42Slow EMAplotfill:44Fillfillplotshape:53BUYplotshapeplotshape:54Sellplotshapeplotshape:77plotshapeplotshapeplotshape:78plotshapeplotshape

Order rules

OrderFires whenBy defaultLine
Open Long longbuycon and buyfirmOn89
Open Long longbuycon1 and buyfirmOn90
Close Longsell or BearOn91
Open Short shortsellcon and sellfirmOn93
Open Short shortsellcon1 and sellfirmOn94
Close Shortbuy or BullOn95

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.

6/6trades 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.
  • CheckHigher-timeframe data3 request.security call(s) use lookahead_on (line 23, 24, 25). Without a [1] offset this reads future bars in history.
  • 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−908.1%+102.5%2129%0.903,570.5%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−54.6%+5.5%333%0.76169.7%8 May 2026 – 21 Oct 2026
ETHUSDT 1D+60.8%+9.8%1932%1.16126.2%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+84.1%+8.4%2100%—8.1%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+4.9%+16.7%2133%1.209.9%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+2.0%+21.5%425%2.721.4%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+18.0%+148.3%2020%1.3234.2%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+18.2%+17.1%2100%—1.6%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 market540%$3,401.12
Sideways market1020%−$14,887.20
Falling market633%$2,405.47

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

How bad could the drawdown be?

53,689.5%

The 95th percentile of the worst drawdown when the same 21 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 151.7% to 53,689.5%; the tick is what actually happened, 3,170.3%. Order luck alone moves it this much.

0%61,743%
All 21 trades
SideEntryExitBarsP&L
long19 May 2024 66,915.2018 Jun 2024 66,504.3030−$410.87
long20 Jul 2024 66,660.006 Aug 2024 54,018.8017−$12,641.20
short6 Aug 2024 54,018.8026 Aug 2024 64,220.0020−$10,201.20
long26 Aug 2024 64,220.0030 Aug 2024 59,359.004−$4,860.99
short30 Aug 2024 59,359.0020 Sep 2024 62,948.0021−$3,589.00
long20 Sep 2024 62,948.0031 Dec 2024 92,792.10102$29,844.10
long7 Jan 2025 102,236.0010 Jan 2025 92,552.503−$9,683.11
long17 Jan 2025 99,987.307 Feb 2025 96,554.4021−$3,432.95
short7 Feb 2025 96,554.4021 Apr 2025 85,179.2073$11,375.10
long27 Jun 2025 106,947.0022 Aug 2025 112,500.0056$5,552.94
short22 Aug 2025 112,500.0015 Sep 2025 115,268.0024−$2,768.01
long15 Sep 2025 115,268.0026 Sep 2025 108,994.0011−$6,273.52
short26 Sep 2025 108,994.003 Oct 2025 120,529.007−$11,534.90
long3 Oct 2025 120,529.0016 Oct 2025 110,763.0013−$9,766.07
short16 Oct 2025 110,763.006 Jan 2026 93,859.7082$16,903.60
long6 Jan 2026 93,859.7025 Jan 2026 89,225.3019−$4,634.37
short25 Jan 2026 89,225.3017 Mar 2026 74,884.7051$14,340.70
short28 Mar 2026 66,407.3010 Apr 2026 71,788.0013−$5,380.70
long10 Apr 2026 71,788.0025 May 2026 77,065.0045$5,276.98
short3 Aug 2026 63,570.008 Aug 2026 64,923.205−$1,353.19
short14 Aug 2026 63,490.9020 Aug 2026 69,334.806−$5,843.92

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
Vin's Playzone Strategy this page—v5 strategy−908.1%213,570.5%
RSI Mean Reversion Bot Strategy by Solutions1978rsi ema stoch smav4 strategyNo trades on this market
MACD, RSI, & RVOL Strategy by BobBarker42069rsi ema smav4 strategy+32.6%11.5%
IFR2 - RSI2 by jocker.soadrsi sma emav4 strategyNo trades on this market
Bitcoin Scalping Strategy (Sampled with- PMARP+MADRID MA RIBBON) by CheatCode1ema rsi stochv5 strategy−3.0%7245.4%
Stoch-RSI 4h-1h-15min by MoonFlagema rsi sma stochv4 strategyNo trades on this market

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.

  • 6 strategy calls use the when = argument (line 89, 90, 91, 93, 94, 95). It is deprecated in v5 and removed in v6, where each call moves inside an if block.
  • 13 settings use the untyped input() (line 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 60). 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 21 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 7: input() → input.source()
  • Line 8: input() → input.bool()
  • Line 10: input() → input.int()
  • Line 11: input() → input.int()
  • Line 12: input() → input.int()
  • Line 13: input() → input.int()
13 more edits
  • Line 14: input() → input.bool()
  • Line 15: input() → input.bool()
  • Line 16: input() → input.bool()
  • Line 17: input() → input.bool()
  • Line 18: input() → input.bool()
  • Line 19: input() → input.bool()
  • Line 60: input() → input.source()
  • Line 89: when = buycon and buyfirm → if block
  • Line 90: when = buycon1 and buyfirm → if block
  • Line 91: when = sell or Bear → if block
  • Line 93: when = sellcon and sellfirm → if block
  • Line 94: when = sellcon1 and sellfirm → if block
  • Line 95: when = buy or Bull → if block
⋯//variable-srcf = input(title='Source of price', defval=close)+srcf = input.source(title='Source of price', defval=close)-tffix = input(title='Fixed Timeframe?', defval=true)+tffix = input.bool(title='Fixed Timeframe?', defval=true)tfn = input.timeframe(title='Timeframe in', defval='D')-ema1 = input(title='Fast EMA', defval=13)+ema1 = input.int(title='Fast EMA', defval=13)-ema2 = input(title='Slow EMA', defval=26)+ema2 = input.int(title='Slow EMA', defval=26)-ema3 = input(title='Base-Line', defval=60)+ema3 = input.int(title='Base-Line', defval=60)-smooter = input(title='Smoothing period', defval=2)+smooter = input.int(title='Smoothing period', defval=2)-fillbar = input(title='Fill Bar Color', defval=false)+fillbar = input.bool(title='Fill Bar Color', defval=false)-emasw = input(title='Show Green-Red EMA?', defval=true)+emasw = input.bool(title='Show Green-Red EMA?', defval=true)-bssw = input(title='Show Buy-Sell signal?', defval=true)+bssw = input.bool(title='Show Buy-Sell signal?', defval=true)-blsw = input(title='Show Base-line?', defval=true)+blsw = input.bool(title='Show Base-line?', defval=true)-fxbl = input(title='Fixed Base-line?', defval=true)+fxbl = input.bool(title='Fixed Base-line?', defval=true)-plotmm = input(title='Show Long-Short?', defval=true)+plotmm = input.bool(title='Show Long-Short?', defval=true)plotmmsm = input.int(title='RSI Smoothing', defval=3, minval=0, maxval=3)⋯STOlen = input.int(42, 'Stochastic length', minval=1)-SRsrc = input(close, 'Source for StochasticRSI')+SRsrc = input.source(close, 'Source for StochasticRSI')OSlel = input.float(30, 'Oversold Threshold', minval=0.00)⋯//Long-strategy.entry('Long', strategy.long, when= buycon and buyfirm , comment='Buy', alert_message='Buy Now!')+if buycon and buyfirm+    strategy.entry('Long', strategy.long , comment='Buy', alert_message='Buy Now!')-strategy.entry('Long', strategy.long, when= buycon1 and buyfirm , comment='Long', alert_message='Buy More!')+if buycon1 and buyfirm+    strategy.entry('Long', strategy.long , comment='Long', alert_message='Buy More!')-strategy.close('Long', when= sell or Bear, comment='Stop-L', alert_message='Take profit Long')+if sell or Bear+    strategy.close('Long', comment='Stop-L', alert_message='Take profit Long')//Short-strategy.entry('Short', strategy.short, when= sellcon and sellfirm , comment='Sell', alert_message='Sell Now!')+if sellcon and sellfirm+    strategy.entry('Short', strategy.short , comment='Sell', alert_message='Sell Now!')-strategy.entry('Short', strategy.short, when= sellcon1 and sellfirm , comment='Short', alert_message='Sell More!')+if sellcon1 and sellfirm+    strategy.entry('Short', strategy.short , comment='Short', alert_message='Sell More!')-strategy.close('Short', when= buy or Bull, comment='Stop-S', alert_message='Take profit Short')+if buy or Bull+    strategy.close('Short', comment='Stop-S', alert_message='Take profit Short')

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: 21 before, 17 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.

⋯//base-on CDC ActionZone By Piriya   a simple 2EMA and is most suitable for use with medium volatility market-//@version=5+//@version=6strategy(title='Playzone', shorttitle='VXIZ', overlay=true, initial_capital=1000)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 29 msWith a workaround 1,000 bars in 93 msNot measured
PineTSNot testedNot testedNot measured

The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.

“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/// © Vvaz_//base-on CDC ActionZone By Piriya   a simple 2EMA and is most suitable for use with medium volatility market//@version=5strategy(title='Playzone', shorttitle='VXIZ', overlay=true, initial_capital=1000)//variablesrcf = input(title='Source of price', defval=close)tffix = input(title='Fixed Timeframe?', defval=true)tfn = input.timeframe(title='Timeframe in', defval='D')ema1 = input(title='Fast EMA', defval=13)ema2 = input(title='Slow EMA', defval=26)ema3 = input(title='Base-Line', defval=60)smooter = input(title='Smoothing period', defval=2)fillbar = input(title='Fill Bar Color', defval=false)emasw = input(title='Show Green-Red EMA?', defval=true)bssw = input(title='Show Buy-Sell signal?', defval=true)blsw = input(title='Show Base-line?', defval=true)fxbl = input(title='Fixed Base-line?', defval=true)plotmm = input(title='Show Long-Short?', defval=true)plotmmsm = input.int(title='RSI Smoothing', defval=3, minval=0, maxval=3)//emaxcross = ta.ema(srcf, smooter)efast = tffix ? ta.ema(request.security(syminfo.tickerid, tfn, ta.ema(srcf, ema1), gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on), smooter) : ta.ema(xcross, ema1)eslow = tffix ? ta.ema(request.security(syminfo.tickerid, tfn, ta.ema(srcf, ema2), gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on), smooter) : ta.ema(xcross, ema2)ema3x = fxbl ? ta.ema(request.security(syminfo.tickerid, tfn, ta.ema(srcf, ema3), gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on), smooter) : ta.ema(xcross, ema3)emabl = ta.ema(xcross, 1)//ZoneBull = efast > eslowBear = efast < eslowG1 = Bull and xcross > efast  //buyG2 = Bear and xcross > efast and xcross > eslow  //pre-buy1G3 = Bear and xcross > efast and xcross < eslow  //pre-buy2R1 = Bear and xcross < efast  //sellR2 = Bull and xcross < efast and xcross < eslow  //pre-sell1R3 = Bull and xcross < efast and xcross > eslow  //pre-sell2//colorbcl = G1 ? color.green : G2 ? color.yellow : G3 ? color.orange : R1 ? color.red : R2 ? color.orange : R3 ? color.yellow : color.blackbarcolor(color=fillbar ? bcl : na)//plotsline1 = plot(blsw ? ema3x : na, 'Base-Line', color=color.new(color.yellow, 0))line2 = plot(emasw ? efast : na, 'Fast EMA', color=color.new(color.green, 0))line3 = plot(emasw ? eslow : na, 'Slow EMA', color=color.new(color.red, 30))fillcl = Bull ? color.new(color.green, 80) : Bear ? color.new(color.red, 80) : color.new(color.black, 99)fill(line2, line3, fillcl )//actionsbuywhen = G1 and G1[1] == 0sellwhen = R1 and R1[1] == 0bullish = ta.barssince(buywhen) < ta.barssince(sellwhen)bearish = ta.barssince(sellwhen) < ta.barssince(buywhen)buy = bearish[1] and buywhensell = bullish[1] and sellwhen//plot trendplotshape(bssw ? buy : na, style=shape.diamond, title='BUY', location=location.belowbar, color=color.new(color.green, 0), size=size.tiny)plotshape(bssw ? sell : na, style=shape.diamond, title='Sell', location=location.abovebar, color=color.new(color.red, 0), size=size.tiny)// Momentum Signal using StochRSIsmoothK = input.int(27, 'StochRSI smooth K', minval=1)smoothD = input.int(18, 'StochRSI smooth D', minval=1)RSIlen = input.int(42, 'RSI length', minval=1)STOlen = input.int(42, 'Stochastic length', minval=1)SRsrc = input(close, 'Source for StochasticRSI')OSlel = input.float(30, 'Oversold Threshold', minval=0.00)OBlel = input.float(70, 'overbought Threshold', minval=0.00)rsil = ta.rsi(SRsrc, RSIlen)K = ta.sma(ta.stoch(rsil, rsil, rsil, STOlen), smoothK)D = ta.sma(K, smoothD)crossover_1 = ta.crossover(K, D)crossover_2 = ta.crossover(K, D)iff_1 = D > OSlel and crossover_2 ? 2 : 0iff_2 = D < OSlel and crossover_1 ? 4 : iff_1buymore = bullish ? iff_2 : 0crossunder_1 = ta.crossunder(K, D)crossunder_2 = ta.crossunder(K, D)iff_3 = D < OBlel and crossunder_2 ? 2 : 0iff_4 = D > OBlel and crossunder_1 ? 4 : iff_3sellmore = bearish ? iff_4 : 0//plot momentumplotshape(plotmm ? buymore > plotmmsm ? buymore : na : na, 'Long', style=shape.triangleup, location=location.belowbar, color=color.new(color.green, 0), size=size.tiny)plotshape(plotmm ? sellmore > plotmmsm ? sellmore : na : na, 'Short', style=shape.triangledown, location=location.abovebar, color=color.new(color.red, 0), size=size.tiny)//stratgy excuter//conditionbuycon =  buysellcon = sellbuycon1 = buymore > plotmmsmsellcon1 = sellmore > plotmmsm//confirm_trendbuyfirm = emabl >= ema3x and Bullsellfirm = emabl <= ema3x and Bear//Longstrategy.entry('Long', strategy.long, when= buycon and buyfirm , comment='Buy', alert_message='Buy Now!')strategy.entry('Long', strategy.long, when= buycon1 and buyfirm , comment='Long', alert_message='Buy More!')strategy.close('Long', when= sell or Bear, comment='Stop-L', alert_message='Take profit Long')//Shortstrategy.entry('Short', strategy.short, when= sellcon and sellfirm , comment='Sell', alert_message='Sell Now!')strategy.entry('Short', strategy.short, when= sellcon1 and sellfirm , comment='Short', alert_message='Sell More!')strategy.close('Short', when= buy or Bull, comment='Stop-S', alert_message='Take profit Short')