Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

PMA Strategy Idea

A Pine Script v4 strategy built on EMA (hlc3, 10). It has 6 order rules, 2 entries among them, and trades long and short with the default settings. Exits use a stop loss. Each trade commits 100% of equity and pays 0.075% commission. 6 settings; defaults include EMA1 Period 10, EMA2 Period 20 and EMA3 Period 30.

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 PMA Strategy Idea repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 35 of 35 trades.
How did PMA Strategy Idea do on BTCUSDT 1D with default settings?
+51.68%
From 26 Jan 2024 to 21 Oct 2026, over 129 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Can PMA Strategy Idea be converted to Pine Script v5?
Yes
The upgrade takes 1 step, from v4; each was run before and after on the same candles with identical results, and the v5 script can be downloaded below.
Does PMA Strategy Idea use a stop loss?
Yes
strategy.exit sets a stop on line 39, 40.
Does PMA Strategy Idea run in Zeal Terminal?
Yes
It compiles in 11 ms and runs 1,000 bars in 35 ms, in the browser.

BTCUSDT · 1D · default settings

  • Plot
  • Plot
  • Plot
  • 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 (6)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$1,517$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
+51.68%
$516.77
Buy and hold
+102.5%
same period
Closed trades
129
42 won · 87 lost
Profitable
32.6%
of closed trades
Profit factor
1.19
gross profit ÷ gross loss
Max drawdown
30.79%
−$480.08

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

    Every trade uses all the equity

    default_qty_value is 100% of equity.

  • Note

    No slippage

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

  • Note

    Uses an argument v6 removed

    when = on line 30, 31, 33, 34. The upgraded version below moves each call inside an if block.

  • Note

    Uses transp =, which v5 removed line 49

    transp = on line 49. v5 folds the transparency into the colour with color.new(c, transp).

Upgrade and export

Written in Pine Script v4. The upgrade to v5 takes 1 step, one per version, each applied to the result of the one before. A last clean-v5 pass then types the settings and moves when = into if blocks, which v6 requires. Every step runs before and after on the same candles in Zeal Terminal's engine; a step whose results differ is shown but not offered as a download. Upgrades preserve behaviour: bugs are fixed in the Review, never silently here.

  • Upgrading to v5 renames ema → ta.ema, rising → ta.rising, falling → ta.falling.
  • 4 strategy calls use the when = argument (line 30, 31, 33, 34). It is deprecated in v5 and removed in v6, where each call moves inside an if block.

v4 → v5

Verified

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

  • Line 3: //@version=4 → //@version=5
  • Line 22: ema → ta.ema
  • Line 23: ema → ta.ema
  • Line 24: ema → ta.ema
  • Line 26: rising → ta.rising
  • Line 26: rising → ta.rising
5 more edits
  • Line 26: rising → ta.rising
  • Line 28: falling → ta.falling
  • Line 28: falling → ta.falling
  • Line 28: falling → ta.falling
  • Line 49: transp = 50 → color.new(colors, 50)
⋯// © QuantCT-//@version=4+//@version=5strategy("PMA Strategy Idea",⋯// ____ Logic-ema1 = ema(hlc3, ema1_period)+ema1 = ta.ema(hlc3, ema1_period)-ema2 = ema(hlc3, ema2_period)+ema2 = ta.ema(hlc3, ema2_period)-ema3 = ema(hlc3, ema3_period)+ema3 = ta.ema(hlc3, ema3_period)    -enter_long = (rising(ema1, 1) and rising(ema2, 1) and rising(ema3, 1))+enter_long = (ta.rising(ema1, 1) and ta.rising(ema2, 1) and ta.rising(ema3, 1))exit_long = not enter_long-enter_short = (falling(ema1, 1) and falling(ema2, 1) and falling(ema3, 1))+enter_short = (ta.falling(ema1, 1) and ta.falling(ema2, 1) and ta.falling(ema3, 1))exit_short = not enter_short⋯ema3_plot = plot(ema3, color=colors)-fill(ema1_plot, ema3_plot, color=colors, transp=50)+fill(ema1_plot, ema3_plot, color=color.new(colors, 50))

Clean v5

VerifiedDownload the v5 script

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

  • Line 15: input() → input.int()
  • Line 16: input() → input.int()
  • Line 17: input() → input.int()
  • Line 18: input() → input.bool()
  • Line 19: input() → input.float()
  • Line 20: input() → input.bool()
4 more edits
  • Line 30: when = enter_long → if block
  • Line 31: when = exit_long → if block
  • Line 33: when = enter_short → if block
  • Line 34: when = exit_short → if block
⋯// ____ Inputs-ema1_period = input(title="EMA1 Period", defval=10)+ema1_period = input.int(title="EMA1 Period", defval=10)-ema2_period = input(title="EMA2 Period", defval=20)+ema2_period = input.int(title="EMA2 Period", defval=20)-ema3_period = input(title="EMA3 Period", defval=30)+ema3_period = input.int(title="EMA3 Period", defval=30)-long_only = input(title="Long Only", defval=false)+long_only = input.bool(title="Long Only", defval=false)-slp = input(title="Stop-loss (%)", minval=1.0, maxval=25.0, defval=5.0)+slp = input.float(title="Stop-loss (%)", minval=1.0, maxval=25.0, defval=5.0)-use_sl = input(title="Use Stop-Loss", defval=false)+use_sl = input.bool(title="Use Stop-Loss", defval=false)// ____ Logic⋯exit_short = not enter_short-strategy.entry("Long", strategy.long, when=enter_long)+if enter_long+    strategy.entry("Long", strategy.long)-strategy.close("Long", when=exit_long) +if exit_long+    strategy.close("Long") if (not long_only)-    strategy.entry("Short", strategy.short, when=enter_short)+    if enter_short+        strategy.entry("Short", strategy.short)-    strategy.close("Short", when=exit_short) +    if exit_short+        strategy.close("Short") // ____ 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: 129 before, 404 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.

⋯// © QuantCT-//@version=5+//@version=6strategy("PMA Strategy Idea",⋯

Settings

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

SettingDefaultType and rangeFeeds
EMA1 Period10intema1
EMA2 Period20intema2
EMA3 Period30intema3
Long Onlyfalseboolentry Short close Short line 32
Stop-loss (%)5.0float · min 1.0 · max 25.0sl_long sl_short
Use Stop-Lossfalseboolexit SL exit SL line 38

What it calculates

  • EMA (ema, ta.ema in v5)hlc3, EMA1 Period (10)ema1 · line 22
  • EMA (ema, ta.ema in v5)hlc3, EMA2 Period (20)ema2 · line 23
  • EMA (ema, ta.ema in v5)hlc3, EMA3 Period (30)ema3 · line 24

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.

hlc3hlc3price dataema1_periodEMA1 Periodsetting · 10ema2_periodEMA2 Periodsetting · 20ema3_periodEMA3 Periodsetting · 30slpStop-loss (%)setting · 5.0ema1EMA→ ema1ema2EMA→ ema2ema3EMA→ ema3sl_long, sl_shortsl_long · sl_short2 valuesenter_longenter_longconditionexit_longexit_longconditionenter_shortenter_shortconditionexit_shortexit_shortconditioncolorsColourcolorsentry:LongOpen Longstrategy.entryclose:LongClose Longstrategy.closeentry:ShortOpen Shortstrategy.entryclose:ShortClose Shortstrategy.closeexit:SLexit SLstrategy.exitplot:46plotplotplot:47plotplotplot:48plotplotfill:49Fillfill

Order rules

OrderFires whenBy defaultLine
Open Long longenter_long(rising(ema1, 1) and rising(ema2, 1) and rising(ema3, 1))On30
Close Longexit_longnot enter_longOn31
Open Short shortenter_short(falling(ema1, 1) and falling(ema2, 1) and falling(ema3, 1))On33
Close Shortexit_shortnot enter_shortOn34
Exit SL stop(use_sl)On39
Exit SL stop(use_sl)On40

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.

35/35trades 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+51.7%+102.5%12933%1.1930.8%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−16.1%+5.5%13124%0.8022.1%8 May 2026 – 21 Oct 2026
ETHUSDT 1D+33.2%+9.8%12427%1.0954.6%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h−23.9%+8.4%15522%0.8031.9%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+44.8%+16.7%12731%1.1144.1%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h−4.9%+21.5%12427%0.9621.5%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+1.7%+148.3%12834%1.0144.8%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h−19.8%+17.1%13725%0.7730.8%8 May 2026 – 21 Oct 2026

Backtests are simulations on historical data and are not investment advice.

Settings heatmap

Two settings that feed the entry signal, moved around their defaults. The best in-sample pair (EMA1 Period 6, EMA2 Period 34) made +88.9% before 26 Dec 2025 and −1.5% after it, worse than the defaults' +16.9% after. Tuning on the past did not carry forward. 100% of the 64 combinations made money in-sample and 97% out-of-sample.

Before 26 Dec 2025 · in-sample
EMA2 Period ↓ · EMA1 Period →567910121417
10+76%+83%+40%+25%+35%+35%+33%+33%
12+76%+83%+40%+25%+35%+29%+27%+27%
14+73%+81%+39%+24%+33%+27%+16%+16%
17+72%+80%+39%+24%+33%+27%+16%+31%
20+68%+75%+35%+25%+35%+29%+16%+31%
24+70%+75%+35%+25%+35%+29%+16%+31%
28+74%+76%+35%+25%+35%+29%+16%+31%
34+85%+89%+45%+34%+47%+41%+27%+43%
From 26 Dec 2025 · out-of-sample
EMA2 Period ↓ · EMA1 Period →567910121417
10+2%+0%+6%+5%+13%+15%+15%+17%
12+9%+8%+9%+7%+15%+24%+24%+25%
14+9%+7%+9%+7%+15%+24%+23%+24%
17+4%+3%+5%+9%+17%+25%+24%+36%
20+4%+3%+5%+9%+17%+26%+24%+36%
24+7%+5%+5%+11%+20%+28%+27%+39%
28+7%+5%+5%+10%+18%+27%+25%+39%
34+0%−2%−0%+5%+13%+25%+24%+39%

Net P&L of trades opened in each period, as a share of starting capital. marks the defaults and the best in-sample cell. Hover a cell for its trade count. Backtests are simulations on historical data and are not investment advice.

The trades

By market direction

At entry, last 90 barsTradesWonP&L
Rising market3526%−$329.26
Sideways market6837%$791.44
Falling market2631%$54.59

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

How bad could the drawdown be?

55.7%

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

0%64%
All 129 trades
SideEntryExitBarsP&L
long28 Jan 2024 42,120.6028 Jan 2024 42,120.600−$1.50
short28 Jan 2024 42,120.6029 Jan 2024 42,031.101$0.63
long29 Jan 2024 42,031.1029 Jan 2024 42,031.100−$1.50
short29 Jan 2024 42,031.1030 Jan 2024 43,302.701−$31.75
long30 Jan 2024 43,302.7030 Jan 2024 43,302.700−$1.45
short30 Jan 2024 43,302.7031 Jan 2024 42,941.101$6.62
long31 Jan 2024 42,941.1031 Jan 2024 42,941.100−$1.46
short31 Jan 2024 42,941.101 Feb 2024 42,580.001$6.72
long1 Feb 2024 42,580.001 Feb 2024 42,580.000−$1.46
short1 Feb 2024 42,580.002 Feb 2024 43,082.901−$13.01
long2 Feb 2024 43,082.902 Feb 2024 43,082.900−$1.44
short2 Feb 2024 43,082.903 Feb 2024 43,200.001−$4.06
long3 Feb 2024 43,200.003 Feb 2024 43,200.000−$1.43
short3 Feb 2024 43,200.004 Feb 2024 43,011.101$2.75
long4 Feb 2024 43,011.104 Feb 2024 43,011.100−$1.44
short4 Feb 2024 43,011.105 Feb 2024 42,582.901$8.11
long5 Feb 2024 42,582.905 Feb 2024 42,582.900−$1.45
short5 Feb 2024 42,582.906 Feb 2024 42,708.701−$4.30
long6 Feb 2024 42,708.7017 Mar 2024 65,300.6040$505.25
long25 Mar 2024 67,210.003 Apr 2024 65,464.009−$40.17
short4 Apr 2024 65,963.305 Apr 2024 68,487.801−$56.62
long7 Apr 2024 68,896.0013 Apr 2024 67,116.506−$37.30
short14 Apr 2024 63,924.5022 Apr 2024 64,941.208−$23.14
long23 Apr 2024 66,819.3025 Apr 2024 64,289.602−$51.35
short25 Apr 2024 64,289.605 May 2024 63,892.0010$5.89
short9 May 2024 61,193.0014 May 2024 62,940.105−$37.90
short15 May 2024 61,577.5016 May 2024 66,206.501−$93.79
long16 May 2024 66,206.5030 May 2024 67,652.4014$22.96
long31 May 2024 68,352.201 Jun 2024 67,540.001−$15.40
long4 Jun 2024 68,809.909 Jun 2024 69,310.505$6.55
long10 Jun 2024 69,648.1012 Jun 2024 67,314.202−$39.98
short12 Jun 2024 67,314.2013 Jun 2024 68,264.001−$17.24
short14 Jun 2024 66,773.002 Jul 2024 62,900.0018$61.38
short3 Jul 2024 62,135.5014 Jul 2024 59,204.0011$52.43
long16 Jul 2024 64,724.1026 Jul 2024 65,799.9010$18.12
long27 Jul 2024 67,908.0031 Jul 2024 66,188.004−$32.64
short2 Aug 2024 65,354.0010 Aug 2024 60,838.008$80.15
short12 Aug 2024 58,712.6014 Aug 2024 60,587.202−$42.31
short15 Aug 2024 58,683.4021 Aug 2024 59,013.806−$8.72
long24 Aug 2024 64,037.2028 Aug 2024 59,415.004−$89.37
short28 Aug 2024 59,415.0011 Sep 2024 57,636.0014$32.03
long14 Sep 2024 60,498.0017 Sep 2024 58,214.003−$45.37
long18 Sep 2024 60,314.001 Oct 2024 63,327.6013$53.81
short2 Oct 2024 60,804.906 Oct 2024 62,058.004−$25.77
long7 Oct 2024 62,819.909 Oct 2024 62,160.502−$13.66
short10 Oct 2024 60,636.0012 Oct 2024 62,540.002−$37.06
long12 Oct 2024 62,540.0024 Oct 2024 66,668.6012$70.23
long25 Oct 2024 68,198.303 Nov 2024 69,374.709$18.24
long6 Nov 2024 69,372.0027 Nov 2024 91,965.2021$381.26
long28 Nov 2024 95,863.104 Dec 2024 95,849.706−$2.55
long5 Dec 2024 98,587.3010 Dec 2024 97,276.505−$23.00
long12 Dec 2024 101,125.0020 Dec 2024 97,461.908−$57.77
short21 Dec 2024 97,805.4022 Dec 2024 97,292.001$5.54
short23 Dec 2024 95,186.3025 Dec 2024 98,663.602−$56.34
long26 Dec 2024 99,429.6027 Dec 2024 95,791.601−$54.20
short28 Dec 2024 94,299.003 Jan 2025 96,984.806−$41.10
long3 Jan 2025 96,984.809 Jan 2025 95,060.606−$28.36
short9 Jan 2025 95,060.6015 Jan 2025 96,560.906−$22.51
long15 Jan 2025 96,560.9028 Jan 2025 102,083.0013$71.16
long30 Jan 2025 103,733.002 Feb 2025 100,636.003−$42.28
short3 Feb 2025 97,700.6015 Feb 2025 97,500.5012$0.72
short17 Feb 2025 96,118.1021 Feb 2025 98,305.004−$31.73
short22 Feb 2025 96,182.003 Mar 2025 94,270.009$23.47
short4 Mar 2025 86,221.206 Mar 2025 90,606.002−$68.07
short8 Mar 2025 86,801.7016 Mar 2025 84,338.408$33.12
short17 Mar 2025 82,574.5020 Mar 2025 86,845.903−$67.34
short22 Mar 2025 84,088.8024 Mar 2025 86,082.502−$30.20
long25 Mar 2025 87,498.2029 Mar 2025 84,424.404−$42.71
short29 Mar 2025 84,424.402 Apr 2025 85,158.404−$11.48
short4 Apr 2025 83,213.1012 Apr 2025 83,423.808−$4.49
long13 Apr 2025 85,276.9030 May 2025 105,590.0047$262.11
short6 Jun 2025 101,509.008 Jun 2025 105,552.002−$56.67
long8 Jun 2025 105,552.0013 Jun 2025 105,672.005−$0.48
long17 Jun 2025 106,795.0018 Jun 2025 104,551.001−$29.53
short19 Jun 2025 104,887.0025 Jun 2025 106,083.006−$16.57
long25 Jun 2025 106,083.002 Jul 2025 105,681.007−$6.70
long3 Jul 2025 108,850.0026 Jul 2025 117,614.0023$99.51
long27 Jul 2025 117,920.0031 Jul 2025 117,840.004−$2.96
short2 Aug 2025 113,298.008 Aug 2025 117,472.006−$52.06
long8 Aug 2025 117,472.0016 Aug 2025 117,342.008−$3.40
short19 Aug 2025 116,227.004 Sep 2025 111,706.0016$48.71
short5 Sep 2025 110,731.006 Sep 2025 110,660.001−$1.16
short7 Sep 2025 110,188.008 Sep 2025 111,137.001−$13.65
long11 Sep 2025 113,960.0023 Sep 2025 112,651.0012−$17.33
short23 Sep 2025 112,651.0030 Sep 2025 114,312.007−$21.44
long30 Sep 2025 114,312.0011 Oct 2025 112,774.0011−$19.38
short11 Oct 2025 112,774.0025 Oct 2025 111,005.0014$18.15
long27 Oct 2025 114,559.0030 Oct 2025 110,021.003−$53.21
short30 Oct 2025 110,021.0011 Nov 2025 106,011.0012$43.47
short12 Nov 2025 103,059.0028 Nov 2025 91,333.9016$144.43
short2 Dec 2025 86,286.003 Dec 2025 91,277.901−$84.92
short6 Dec 2025 89,330.009 Dec 2025 90,634.403−$21.67
short13 Dec 2025 90,268.4022 Dec 2025 88,658.909$21.63
short24 Dec 2025 87,486.0030 Dec 2025 87,237.106$1.81
long3 Jan 2026 89,995.109 Jan 2026 91,100.006$14.50
long10 Jan 2026 90,641.3011 Jan 2026 90,504.701−$4.09
long12 Jan 2026 91,013.7020 Jan 2026 92,631.008$22.06
short21 Jan 2026 88,427.7026 Feb 2026 67,988.0036$316.95
short28 Feb 2026 65,872.103 Mar 2026 68,830.103−$78.75
long5 Mar 2026 72,666.807 Mar 2026 68,114.002−$103.67
short8 Mar 2026 67,262.9011 Mar 2026 69,948.603−$62.75
long11 Mar 2026 69,948.6020 Mar 2026 69,930.009−$2.56
short20 Mar 2026 69,930.0025 Mar 2026 70,556.705−$15.17
long26 Mar 2026 71,336.5027 Mar 2026 68,820.301−$52.66
short27 Mar 2026 68,820.302 Apr 2026 68,113.906$12.12
short3 Apr 2026 66,902.006 Apr 2026 69,034.203−$46.51
long7 Apr 2026 68,853.7029 Apr 2026 76,342.8022$144.29
long2 May 2026 78,231.1014 May 2026 79,313.6012$18.37
long15 May 2026 81,090.0016 May 2026 79,113.201−$39.01
short18 May 2026 77,457.7014 Jun 2026 64,458.0027$244.64
short19 Jun 2026 62,958.0023 Jun 2026 64,020.004−$31.51
short24 Jun 2026 62,734.603 Jul 2026 61,560.009$29.00
long11 Jul 2026 64,161.7014 Jul 2026 62,334.503−$51.28
short14 Jul 2026 62,334.5015 Jul 2026 65,044.001−$74.77
long15 Jul 2026 65,044.0018 Jul 2026 63,931.703−$29.50
long19 Jul 2026 64,834.2025 Jul 2026 64,140.006−$18.98
short26 Jul 2026 64,375.0027 Jul 2026 65,400.001−$26.80
long27 Jul 2026 65,400.0028 Jul 2026 63,755.901−$40.24
short29 Jul 2026 63,915.0031 Jul 2026 64,780.002−$22.12
long31 Jul 2026 64,780.001 Aug 2026 62,887.901−$44.47
short1 Aug 2026 62,887.905 Aug 2026 64,106.604−$29.35
long6 Aug 2026 64,665.2011 Aug 2026 63,970.005−$16.83
short12 Aug 2026 63,600.0018 Aug 2026 64,532.106−$21.95
long18 Aug 2026 64,532.103 Sep 2026 77,340.0016$263.09
long4 Sep 2026 81,270.409 Sep 2026 78,455.805−$57.72
long15 Sep 2026 78,189.2016 Sep 2026 75,644.501−$52.42
long19 Sep 2026 80,883.908 Oct 2026 83,321.8019$42.60
short9 Oct 2026 81,754.5010 Oct 2026 82,635.601−$18.81
short16 Oct 2026 82,245.9020 Oct 2026 81,938.404$3.39

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
PMA Strategy Idea this page—v4 strategy+51.7%12930.8%
TEMA-DEMA-HMA Strategy by Tuned_Officialema rising fallingv4 strategy+73.8%430.6%
Strategy Myth-Busting #13 - MultiEMA+BXTrender - [SP-MYN] by myncryptoema rising fallingv5 strategy−0.3%20.3%
Trading Day and Time Session by Dannnnnnnyrising fallingv5 strategyNo trades on this market
Momentum Strategy by PrattyChartsema risingv4 strategyNo trades on this market
Trendelicious Strategy by levieuxrising fallingv5 strategy−12.8%941.4%

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 11 msYes 1,000 bars in 35 msNot measured
PineTSNo v5 and v6 only—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. PineTS runs Pine Script v5 and v6 only.

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/// © QuantCT//@version=4strategy("PMA Strategy Idea",         shorttitle="PMA",          overlay=true,         pyramiding=0,              default_qty_type=strategy.percent_of_equity,          default_qty_value=100,          initial_capital=1000,                    commission_type=strategy.commission.percent,          commission_value=0.075)         // ____ Inputsema1_period = input(title="EMA1 Period", defval=10)ema2_period = input(title="EMA2 Period", defval=20)ema3_period = input(title="EMA3 Period", defval=30)long_only = input(title="Long Only", defval=false)slp = input(title="Stop-loss (%)", minval=1.0, maxval=25.0, defval=5.0)use_sl = input(title="Use Stop-Loss", defval=false)// ____ Logicema1 = ema(hlc3, ema1_period)ema2 = ema(hlc3, ema2_period)ema3 = ema(hlc3, ema3_period)    enter_long = (rising(ema1, 1) and rising(ema2, 1) and rising(ema3, 1))exit_long = not enter_longenter_short = (falling(ema1, 1) and falling(ema2, 1) and falling(ema3, 1))exit_short = not enter_shortstrategy.entry("Long", strategy.long, when=enter_long)strategy.close("Long", when=exit_long) if (not long_only)    strategy.entry("Short", strategy.short, when=enter_short)    strategy.close("Short", when=exit_short) // ____ SLsl_long = strategy.position_avg_price * (1- (slp/100))sl_short = strategy.position_avg_price * (1 + (slp/100))if (use_sl)    strategy.exit(id="SL", from_entry="Long", stop=sl_long)    strategy.exit(id="SL", from_entry="Short", stop=sl_short)// ____ Plotscolors =  enter_long ? #27D600 : enter_short ? #E30202 : color.orangeema1_plot = plot(ema1, color=colors)ema2_plot = plot(ema2, color=colors)ema3_plot = plot(ema3, color=colors)fill(ema1_plot, ema3_plot, color=colors, transp=50)