Execution-Aware Trend [BSL] — Strategy by BarStateLabs
By BarStateLabs
Performance Metrics
- Author: BarStateLabs
- Symbol: NASDAQ:AAPL
- Timeframe: 1 hour
Description
Execution-Aware Trend is a deliberately ordinary trend-and-breakout strategywhose main product is visible testing discipline. It answers “what did thisexact ruleset simulate after declared costs, next-tick execution and a fixedsample split?” It does not predict the next move and does not claim an edge.This is an original BarState Labs implementation created from an independentwritten specification. It does not reproduce another publication’s source,defaults, interface, chart grammar or report.HOW IT WORKSTrend qualification uses a fast and slow EMA. A long setup requires the fastEMA above the slow EMA and the slow EMA above its value at the configured slopelookback. The short rule is symmetric. Equality qualifies neither side.Entry and exit channels always exclude the current bar:`entryHigh = highest(high[1], entry length)``entryLow = lowest(low[1], entry length)``exitHigh = highest(high[1], exit length)``exitLow = lowest(low[1], exit length)`A confirmed close beyond the prior entry channel creates a market-entryintent only when the matching trend filter qualifies. There is no pyramidingand no same-calculation reversal.The close-risk line uses ATR and confirmed closes. For a long position, thehighest observed close is tracked and the line is the greater of its previousvalue and `peak close - ATR multiple × ATR`. It therefore never loosens. Theshort rule is symmetric and never rises. A channel breach or a confirmed closethrough the risk line creates a market-close intent.EXECUTION MODEL AND COSTSOrders are not processed on the signal bar’s close. The strategy keepsTradingView’s normal next-tick behavior, which on historical bars normallymeans a fill at the following bar’s open. The declaration includes:- 0.10% commission per filled order;- 2 ticks of slippage per market fill;- 10% of equity order size;- no pyramiding and no simulated leverage;- no calculation on every tick or on order fills.These are generic examples, not estimates for a particular broker or market.Users must replace them in Properties. The panel cannot detect a manualProperties override, so it labels them declaration defaults. Simulated fillsdo not model liquidity, spread variation, queue position, rejected orders ormarket impact.SAMPLE WINDOWSThe same signal parameters can be viewed as Full history, In-sample orOut-of-sample. The default split is 2024-01-01 UTC. In-sample ends immediatelybefore the split; out-of-sample begins at the split. No entry is allowedoutside the selected window, and an open position is closed by a normal delayedmarket intent when the window ends.One visible split does not prove that a user avoided tuning after seeing theresult. The script exposes the boundary; it cannot enforce research behavior.A visible 100-closed-trade gate is a sample-size warning, not statisticalproof.CONFIRMED AND STANDARD-CHART BOUNDARIESNew orders require a confirmed bar and `chart.is_standard`. On Heikin Ashi,Renko, Kagi, Line Break, Range, Point & Figure and other non-standard charts,the script displays `NON-STANDARD — NO ORDERS` and creates no trades.The script uses only the current chart symbol and timeframe. It makes noexternal requests, uses no lookahead and does not force same-bar-close fills.Exchange or broker feed corrections can still rebuild historical standardOHLC after reload.OUTPUTSThe chart shows fast and slow EMAs, optional prior-bar entry and exit channels,the active close-risk line, optional sample background and confirmed intentmarkers. Compact and Full panels expose state, sample, split, fill model,declaration costs, closed trades, the 100-trade gate, net result, average closedtrade and maximum drawdown.Hidden machine-readable plots expose:- Confirmed entry intent: +1, -1 or 0;- Confirmed exit intent: +1, -1 or 0;- Selected sample: 1 or 0;- OOS flag: 1 or 0.Order calls contain explicit alert messages, so TradingView order-fill alertscan identify the simulated action, size, ticker and resulting strategyposition. They are diagnostics, not recommendations.LIMITATIONS- Positive net profit is not a design requirement or evidence of robustness.- Results depend on symbol, feed, timeframe, loaded history, Properties and inputs.- Close-confirmed risk exits can gap on the next simulated fill.- Commission and slippage defaults are not a complete transaction-cost model.- One in-sample/out-of-sample split is not walk-forward validation.- The 100-trade gate does not establish significance or future performance.- Backtests are simulations and are not trading advice or expected returns.VALIDATIONThe candidate passed 16 deterministic Python fixtures and a 16/16 live Pineharness. Manual TradingView checks covered BTCUSDT and AAPL on daily andintraday charts, 187 BTCUSDT 30-minute and 103 AAPL hourly trades, unchangedparameters across IS/OOS, higher costs, reload parity, realtime confirmation,daily Bar Replay, zero orders on Heikin Ashi, the order-fill alert dialog,390 × 844 rendering and Pine Profiler. The profiler observed 32,614 executionson DJI daily history with 0.6 seconds total runtime.The validation intentionally retains unfavorable evidence: BTCUSDT 30-minuteFull history returned about -3.70%, AAPL hourly Full history about -2.63%, andAAPL daily OOS about -1.83%. No parameter was retuned after these observations.ORIGINALITY AND SOURCECategory demand was selected from dated popularity metadata. No protected,invite-only or closed source was accessed, and no compared script’s source wasimported. EMA, ATR, prior-bar channels and sample splitting are standard,transparent building blocks. The implementation is released under MPL 2.0.CHANGELOGv1.0.0- Initial open-source release candidate.- Symmetric confirmed-close trend and prior-channel entries.- Non-loosening ATR close-risk line with delayed market exits.- Explicit commission, slippage, sample split and standard-chart guard.- Compact/Full evidence panels, signed intent exports and order-fill messages.Release Notesv1.0.1- Fixed the Compact panel on live 24/7 markets. With calc_on_every_tick=false, the strategy now initializes its evidence table on the last confirmed historical bar, so the panel remains visible while the realtime bar is open.- Trading logic, entries, exits, declared costs, sample window and defaults are unchanged.Release NotesReadability update. The evidence panel can now choose Auto, Top right, or Bottom right; Auto positions it opposite the latest price within the visible range. Order comments are shortened to compact audit codes so TradingView's required strategy trade markers remain legible. Entry, exit, risk, cost, and sizing logic are unchanged.Release NotesThis update opens in Full history so a new chart starts with a larger descriptive sample. The compact panel now fills all ten rows, and lighter channel shading keeps price readable. Costs remain non-zero and orders still fill on the next bar. The strategy logic is unchanged. Switch to Out-of-sample when you want a dated split.