Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

adx efi 50 ema channel, trend pullback

A Pine Script v5 strategy built on BB (ohlc4, 50), SAR (.1, .1) and EMA (hlc3, 50). It has 5 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 is one contract and pays no commission. It has no settings.

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 adx efi 50 ema channel, trend pullback repaint?
No
No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
How did adx efi 50 ema channel, trend pullback do on BTCUSDT 1D with default settings?
Not measured
It closed no trades there from 26 Jan 2024 to 21 Oct 2026 with the default settings, so there is no result to report. Its entry conditions never all held on this data. It closed no trades on the other markets either. A backtest, not investment advice.
Does adx efi 50 ema channel, trend pullback run in Pine Script v6?
Not tested
Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download.
Does adx efi 50 ema channel, trend pullback use a stop loss?
Yes
strategy.exit sets a stop on line 66, 70.
Does adx efi 50 ema channel, trend pullback run in Zeal Terminal?
Yes
It compiles in 24 ms and runs 1,000 bars in 67 ms, in the browser.

BTCUSDT · 1D · default settings

  • Plot
  • Plot
  • Plot
  • Plot
  • Plot
  • Plot
  • Plot
  • Plot
  • Plot
  • Plot
  • Plot
  • Plot
  • Plot
  • Winning trade
  • Losing trade
  • Equity
Prerendered with the defaults. Change anything and run it here. The script runs in your browser.
Settings (0)
25,00050,00075,000100,000125,000AprJulOct2025AprJulOct2026AprJulOct$100,000$202,527Equity from $100,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
0.00%
$0.00
Buy and hold
+102.5%
same period
Closed trades
0
0 won · 0 lost
Profitable
0.0%
of closed trades
Profit factor
—
gross profit ÷ gross loss
Max drawdown
0.00%
$0.00

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

  • 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 65, 67, 69. 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.

The script declares no settings.

What it calculates

  • BBohlc4, 50, 3basis · line 6
  • BBohlc4, 50, 3upperband · line 6
  • BBohlc4, 50, 3lowerband · line 6
  • BBohlc4, 50, 2basis2 · line 7
  • BBohlc4, 50, 2upperband2 · line 7
  • BBohlc4, 50, 2lowerband2 · line 7
  • SAR.1, .1, .09psar · line 8
  • EMAhlc3, 50ema50 · line 9
  • EMAhigh, 50ema50hi · line 10
  • EMAlow, 50ema50lo · line 11
  • WMAhlc3, 15ema18 · line 12
  • WMAopen, 9wma9 · line 13
  • WMAohlc4, 5wma5 · line 14
  • RMAhlc3, 10ema34 · line 15
  • MACDhlc3, 5, 34, 5macdline · line 16
  • MACDhlc3, 5, 34, 5signalline · line 16
  • MACDhlc3, 5, 34, 5histline · line 16
  • MACDhlc3, 15, 70, 24macdline2 · line 17
  • MACDhlc3, 15, 70, 24signalline2 · line 17
  • MACDhlc3, 15, 70, 24histline2 · line 17
  • DMI20, 20diplus · line 18
  • DMI20, 20diminus · line 18
  • DMI20, 20adx · line 18
  • DMI12, 12diplus2 · line 19
  • DMI12, 12diminus2 · line 19
  • DMI12, 12adx2 · line 19
  • RSIhlc3, 14rsi · line 20
  • SMArsi, 10rsisma · line 21
  • Stochclose, high, low, 21stoch · line 22
  • WMAstoch, 3k · line 23
  • WMAk, 3d · line 24
  • WMAhlc3, 300trendline5 · line 25
  • WMAopen, 540trendline9 · line 26
  • WMAopen, 1080trendline18 · line 27
  • ATR14atr · line 28
  • RMA / Changeta.change(close) * volume, 15efi · line 43
  • RMA / Changeta.change(close) * volume, 120efi2 · line 44

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

Order rules

OrderFires whenBy defaultLine
Open buy longbuytrigema34 >= ema50loOn65
Exit exit buy stop and limit(buy)On66
Close closeta.crossunder(ema34, ema50lo)On67
Open sell shortselltrigema34 <= ema50hiOn69
Exit exit sell stop and limit(sell)On70

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.

Not measuredNo trades to compareThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, but neither the live nor the historical run produced any trades in them, so the replay says nothing either way.
  • 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 1D0.0%+102.5%00%—0.0%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h0.0%+5.5%00%—0.0%8 May 2026 – 21 Oct 2026
ETHUSDT 1D0.0%+9.8%00%—0.0%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h0.0%+8.4%00%—0.0%8 May 2026 – 21 Oct 2026
SOLUSDT 1D0.0%+16.7%00%—0.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h0.0%+21.5%00%—0.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D0.0%+148.3%00%—0.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h0.0%+17.1%00%—0.0%8 May 2026 – 21 Oct 2026

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

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
adx efi 50 ema channel, trend pullback this page—v5 strategy0.0%00.0%
888 BOT #backtest by UnknownUnicorn2151907sma ema rma sar macd atrv4 strategy+3.0%120.9%
Super 8 - 30M BTC by Good-Vibeema dmi sar macd sma bb atrv5 strategy−5.5%85.5%
BankNifty_Bearish_Intraday by makarandpatilmacd rsi dmi sma bbv5 strategyNo trades on this market
BankNifty_Bullish_Intraday by makarandpatilmacd rsi dmi sma bbv5 strategyNo trades on this market
[VJ]Phoenix Force of PSAR +MACD +RSI by vikrissar sma macd rsi atrv4 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.

  • 3 strategy calls use the when = argument (line 65, 67, 69). It is deprecated in v5 and removed in v6, where each call moves inside an if block.
  • No v6-only features. v6 is not needed to run this script.

Clean v5

Not verified

Neither version placed a trade on any of the 8 markets, so there was nothing to compare.

  • Line 65: when = buytrig → if block
  • Line 67: when = ta.crossunder(ema34, ema50lo) → if block
  • Line 69: when = selltrig → if block
⋯if(buy)-    strategy.entry("buy", strategy.long, 5000, when= buytrig)+    if buytrig+        strategy.entry("buy", strategy.long, 5000)    strategy.exit("exit buy", "buy", limit= tp, stop= sl)-    strategy.close("close", when= ta.crossunder(ema34, ema50lo))+    if ta.crossunder(ema34, ema50lo)+        strategy.close("close")if(sell)-    strategy.entry("sell", strategy.short, 5000, when= selltrig)+    if selltrig+        strategy.entry("sell", strategy.short, 5000)    strategy.exit("exit sell", "sell", limit= selltp, stop= sellsl)

Does it run in Pine Script v6?

Not tested

Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © trent777brown-//@version=5+//@version=6strategy("adx efi 50 ema channel, trend pullback", overlay=true, margin_long=100, margin_short=100, currency=currency.USD, initial_capital= 100000, close_entries_rule="ANY")⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 24 msYes 1,000 bars in 67 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/// © trent777brown//@version=5strategy("adx efi 50 ema channel, trend pullback", overlay=true, margin_long=100, margin_short=100, currency=currency.USD, initial_capital= 100000, close_entries_rule="ANY")//bollingerbands[basis, upperband, lowerband]= ta.bb(ohlc4, 50, 3) [basis2, upperband2, lowerband2]= ta.bb(ohlc4, 50, 2)psar= ta.sar(.1, .1, .09)ema50= ta.ema(hlc3, 50) ema50hi= ta.ema(high, 50) ema50lo= ta.ema(low, 50) ema18= ta.wma(hlc3, 15)wma9= ta.wma(open, 9) wma5= ta.wma(ohlc4, 5) ema34= ta.rma(hlc3, 10)[macdline, signalline, histline]= ta.macd(hlc3, 5, 34, 5) [macdline2, signalline2, histline2]= ta.macd(hlc3, 15,70, 24) [diplus, diminus, adx]= ta.dmi(20, 20) [diplus2, diminus2, adx2]= ta.dmi(12, 12)rsi= ta.rsi(hlc3, 14)rsisma= ta.sma(rsi, 10) stoch= ta.stoch(close, high, low, 21)k= ta.wma(stoch, 3)d= ta.wma(k, 3)trendline5= ta.wma(hlc3, 300) trendline9= ta.wma(open, 540) trendline18= ta.wma(open, 1080)atr=ta.atr(14)plot(psar, color=color.red, style=plot.style_circles)plot(ema50, color=color.white, linewidth=4) plot(ema50hi, color=color.yellow, linewidth=4)plot(ema50lo, color=color.yellow, linewidth=4)plot(ema34, color=color.aqua, linewidth=4)plot(wma9, color=color.gray, linewidth=4) plot(wma5, color=color.lime, linewidth=4) plot(trendline18, color=color.orange, linewidth=4) plot(upperband, color=color.navy, linewidth=4) plot(lowerband, color=color.navy, linewidth=4)plot(upperband2, color=color.navy, linewidth=4)plot(lowerband2, color=color.navy, linewidth=4)plot(trendline9, color=color.maroon, linewidth=4)plot(trendline5, color=color.yellow, linewidth=4)efi = ta.rma(ta.change(close) * volume, 15)efi2= ta.rma(ta.change(close) * volume, 120)buy= efi2 > 0 and efi < 0 and efi[1] < efi  and adx >= 20 and open < ema50hisell= efi2 < 0 and efi > 0 and efi[1] > efi and adx >= 20 and open > ema50lo//ell= rsi > 50 and ta.crossunder(wma5, wma9) and psar > high and ema18 <= ema50hi and macdline > 0 and macdline < signalline//buy= ta.crossunder(close, ema50) and rsi < 50 and adx2 < adx2[1] and k < 25 and psar > high//uy= rsi < 60 and ta.crossover(wma5, wma9)  and psar < low and ema18 >= ema50 and macdline2 > 0 and diplus2 < 30 // and histline2 < 0  //buy=  ema18 > ema50 and ta.crossunder(rsi, 45) and open < ema50hi and adx2[3] < adx2 and diplus2 < 25 and macdline < 0  and adx < 10//sell= ta.crossover(close, ema50) and rsi > 50 and adx2 < adx2[1] and k > 75 and psar < low//ell= ema18 < ema50 and ta.crossover(rsi, 60) and open > ema50lo and diminus2 < 30 and macdline2 < 0 and adx2[2] < adx2 //buy sell conditions 1//buy= ta.crossover(wma5, ema18) and ema18 > ema50lo and diplus > 22 and diminus < 22 and adx > 15//ell= ta.crossover(psar, high) and macdline2 < signalline2 and rsi < rsisma//when conditionsbuytrig= ema34 >= ema50loselltrig= ema34 <= ema50hi//strategysl= low - atr * 8tp= high +  atr * 4sellsl= high + atr * 8selltp= low - atr * 4if(buy)    strategy.entry("buy", strategy.long, 5000, when= buytrig)    strategy.exit("exit buy", "buy", limit= tp, stop= sl)    strategy.close("close", when= ta.crossunder(ema34, ema50lo))if(sell)    strategy.entry("sell", strategy.short, 5000, when= selltrig)    strategy.exit("exit sell", "sell", limit= selltp, stop= sellsl)