When trend and correction align
The 4× slower MACD remains above zero to confirm the bullish regime. The current MACD corrects below zero. The Arrow.AlgoNexta signal appears when the qualified bullish release is confirmed.
Arrow.AlgoNexta: dual-timeframe MACD corrections and hidden-divergence signals with trend, range, session, and alert controls.
Vision Grade
NOT GRADED — VALIDATION INCOMPLETE
Overview
Arrow.AlgoNexta is a chart overlay that combines two MACD configurations with optional hidden-divergence and correction-release logic. The fast oscillator uses 12/26/9 settings and the slower confirmation uses 48/104/36 settings by default; both are configurable.
How it works
When trend and correction align
The 4× slower MACD remains above zero to confirm the bullish regime. The current MACD corrects below zero. The Arrow.AlgoNexta signal appears when the qualified bullish release is confirmed.
Bullish hidden divergence
The 4× slower MACD remains above zero. A hidden divergence forms in the current MACD.
How filters, labels, and projections are framed
Defaults require EMA 60 above EMA 240 and a positive EMA 240 slope for buys, with inverse conditions for sells. `Range Filter Mode` is `Balanced`, requiring two of ADX, EMA separation, and slow-MACD strength checks. Accepted setups plot REL, HID, or COMBO labels/arrows and can draw a `Pivot + ATR Buffer` stop projection with 1R, 2R, and 3R reference levels; none are orders or strategy exits.
Walkthrough
Live market chart
Running the NexaScript on recent candles…
Backtest evidence
E0 · Reconstructed reference
algonexta-reference · Yahoo Finance · EURUSD · 1h
Net profit
0.0105
Max drawdown
$0.0103
Trades
73
Symbol · TF
EURUSD · 1h
Equity curve
| Time | Side | Price |
|---|---|---|
| Aug 5, 11:00 AM | long | 1.15553 |
| Aug 5, 01:00 PM | exit | 1.15473 |
| Aug 5, 01:00 PM | short | 1.15473 |
| Aug 5, 05:00 PM | exit | 1.15594 |
| Aug 5, 05:00 PM | long | 1.15594 |
| Aug 5, 07:00 PM | exit | 1.15540 |
| Aug 5, 07:00 PM | short | 1.15540 |
| Aug 6, 03:00 PM | exit | 1.15302 |
| Aug 7, 04:00 AM | long | 1.15274 |
| Aug 7, 12:00 PM | exit | 1.15537 |
| Aug 10, 02:00 AM | short | 1.15553 |
| Aug 10, 07:00 AM | exit | 1.15657 |
| Aug 11, 12:00 PM | long | 1.15460 |
| Aug 12, 03:00 AM | exit | 1.15386 |
| Aug 12, 03:00 AM | short | 1.15380 |
| Aug 12, 09:00 AM | exit | 1.15458 |
| Aug 12, 11:00 AM | long | 1.15473 |
| Aug 12, 04:00 PM | exit | 1.15342 |
| Aug 12, 04:00 PM | short | 1.15314 |
| Aug 13, 08:00 AM | exit | 1.15274 |
| Aug 13, 08:00 AM | long | 1.15274 |
| Aug 13, 07:00 PM | exit | 1.15314 |
| Aug 13, 07:00 PM | short | 1.15314 |
| Aug 13, 11:00 PM | exit | 1.15367 |
| Aug 13, 11:00 PM | long | 1.15367 |
| Aug 14, 08:00 AM | exit | 1.15557 |
| Aug 14, 08:00 PM | short | 1.15727 |
| Aug 17, 12:00 AM | exit | 1.15833 |
| Aug 17, 12:00 AM | long | 1.15835 |
| Aug 17, 07:00 AM | exit | 1.16067 |
| Aug 17, 11:00 AM | short | 1.15955 |
| Aug 18, 05:00 AM | exit | 1.15744 |
| Aug 18, 02:00 PM | long | 1.15848 |
| Aug 18, 07:00 PM | exit | 1.15781 |
| Aug 18, 07:00 PM | short | 1.15781 |
| Aug 19, 02:00 AM | exit | 1.15880 |
| Aug 19, 02:00 AM | long | 1.15861 |
| Aug 19, 08:00 AM | exit | 1.16056 |
| Aug 20, 02:00 AM | short | 1.16781 |
| Aug 20, 07:00 AM | exit | 1.16927 |
| Aug 20, 09:00 AM | long | 1.17110 |
| Aug 20, 10:00 AM | exit | 1.17000 |
| Aug 20, 10:00 AM | short | 1.17000 |
| Aug 21, 05:00 AM | exit | 1.17014 |
| Aug 21, 05:00 AM | long | 1.17014 |
| Aug 21, 07:00 AM | exit | 1.16945 |
| Aug 21, 07:00 AM | short | 1.16945 |
| Aug 21, 08:00 AM | exit | 1.17086 |
| Aug 21, 12:00 PM | short | 1.16945 |
| Aug 24, 07:00 AM | exit | 1.16717 |
Showing the most recent 50 of 146 reference trades.
⚠Executed from the versioned AlgoNexta IR on the same OHLC dataset used by the chart.
⚠This is an independent reference backtest; TradingView Strategy Tester remains the official comparison.
⚠This is an AI-reconstructed approximation of the script’s logic, not an execution of the exact source — verify the real script in TradingView Strategy Tester.
Vision Grade
Vision Grade Standard v1.0
NOT GRADED — VALIDATION INCOMPLETE
Vision Grade measures the strength of validation evidence, not the probability of future profit. A score of 82 is not an 82% chance of profit.
No grade is published until every mandatory gate has been verified. The measurements below are preliminary evidence, not a grade.
G1 No look-ahead bias — not yet verified
G2 No undisclosed repainting — not yet verified
G3 Realistic costs included — not yet verified
G4 Genuine out-of-sample evidence — not yet verified
G5 Reproducible evaluation — not yet verified
Legacy VG-Signal · E2 · LOW confidence · 31.7/100
The measured component from the earlier VG engine, kept for transparency. It is not the VG score.
Legacy VG-Signal components (not part of the VG score)
Predictive power
22
Trading performance
7.9
Robustness
40
Risk
85
Signal-Based Performance
Signals
73
Win rate
28.8%
Profit factor
0.27
Max drawdown
0.0403
Robustness — chronological out-of-sample split
In-sample IC
—
Out-of-sample IC
—
OOS retention
—
OOS_SAMPLE_TOO_SMALL
ic here is a pooled event-conditional Spearman rank correlation (signal_strength vs forward return), not a cross-sectional factor IC — see methodology.
⚠Vision Grade measures the strength of statistical and trading-quality evidence. It does not predict future returns.
⚠A high Information Coefficient does not guarantee profitability.
⚠Trading Performance here is Signal-Based Performance, not an execution backtest against the original source.
⚠Historical results do not guarantee future performance.
⚠Only 73 valid signals (config minimum is 100) — results below are directional, not reliable.
⚠Horizon 10: 1 signals dropped (not enough forward OHLC bars).
⚠Horizon 20: 1 signals dropped (not enough forward OHLC bars).
⚠Horizon 50: 3 signals dropped (not enough forward OHLC bars).
Full breakdown
Published by AlgoNexta, an evidence-first platform for building, reviewing, and documenting algorithmic trading tools. This page explains the script's actual logic and intended use; it does not promise profitability or replace verification in TradingView.
Arrow.AlgoNexta is a chart overlay that combines two MACD configurations with optional hidden-divergence and correction-release logic. The fast oscillator uses 12/26/9 settings and the slower confirmation uses 48/104/36 settings by default; both are configurable.
The script can wait for a fast MACD correction and signal-line confirmation, or for a confirmed hidden-divergence pattern built from price pivots. Signals may be filtered by the 60/240 EMA trend relationship, slow-EMA slope, ADX and EMA separation. An optional London, New York, or custom session filter and a same-direction cooldown help control when markers are displayed.
Depending on the display settings, the indicator plots correction-release, hidden-divergence, and combined markers, divergence lines, EMA references, regime shading, and rejected-signal diagnostics. Alerts are available for the script's emitted signal events. It does not place orders, calculate broker fills, or guarantee that a displayed setup will continue in the indicated direction.
This is an AlgoNexta publication for research and education. Confirm the source in TradingView, review the inputs for the symbol and timeframe, and validate behavior with TradingView's own chart and alert tools before relying on it.
Source
arrow-algonexta.nxs · 252 lines · 11.8 KB
✓ Verified by AlgoNexta · Oct 4, 2026
Reference port of Arrow.AlgoNexta (AN-M007-B-AND-A). It reproduces the Python reference implementation exactly on the 69,744-bar XAUUSD M5 reference run (512 signals). Direct TradingView runtime parity has not been checked yet.
# AN-M007-B-AND-A — NexaScript port of Arrow.
#
# The skill you get first when you say "the arrow skill". Two mirrored machines
# (bull/bear): arm on a regular MACD correction against the regime, or on a
# confirmed hidden divergence at a pivot; release on a signal crossover or the
# hidden trigger; lock until the oscillator has recrossed zero, gated the whole
# time by a three-vote range filter (ADX, EMA separation, trend strength).
#
# Ported against an_m007_b_and_a.py, profile XAUUSD_M5_v0_1. Every seeded
# indicator here matches that module's own helpers, not TradingView:
#
# atr(14, seed: "window") - an_m007_b_and_a._atr
# adx(14, seed: "window") - an_m007_b_and_a._dmi (its own ADX
# seeding, distinct even from the other
# engines' window-seeded rma - see the
# comment on asl/builtins._adx)
#
# The pivot ties default ("right": strict left, at-or-beyond right) matches
# this engine's own _pivot_low/_pivot_high, so no ties: override is needed -
# unlike AN-M001-BOS, which needed "none".
#
# `divosc` is the fast MACD *value*, not its histogram - the engine's default
# (div_source: MACD_VALUE). The port does not express the histogram variant;
# nothing in the shipped profile uses it.
#
# Locked/armed/hidden all reduce to scalars carried per side, which is why this
# is portable at all despite the length: no collection, just a lot of it.
skill "Arrow" {
id AN-M007-B-AND-A
use XAUUSD M5
warmup 0
let fast = ema(close, 12) - ema(close, 26)
let fastSig = ema(fast, 9)
let slow = ema(close, 48) - ema(close, 104)
let ef = ema(close, 60)
let es = ema(close, 240)
let atrV = atr(14, seed: "window")
let adxV = adx(14, seed: "window")
let strengthAvg = sma(abs(slow), 50)
let esSlope = es - es[10]
let slopeRatio = abs(esSlope) / max(atrV, 0.01)
let bullReg = slow > 0
let bearReg = slow < 0
let emaBuyOk = ef > es and esSlope > 0 and slopeRatio >= 0.05
let emaSellOk = ef < es and esSlope < 0 and slopeRatio >= 0.05
let adxOk = adxV >= 20
let emaSepOk = abs(ef - es) / max(atrV, 0.01) >= 0.2
let strengthOk = abs(slow) > strengthAvg * 0.5
let votes = if(adxOk, 1, 0) + if(emaSepOk, 1, 0) + if(strengthOk, 1, 0)
let rangeOk = votes >= 2
let pivLo = pivot_low(left: 3, right: 3)
let pivHi = pivot_high(left: 3, right: 3)
# The oscillator's value AT the pivot bar - not the confirming bar three bars
# later - which is what fast[3] reaches back to when .confirmed is true.
let oscAtPivot = fast[3]
machine bull {
var locked = 0
var sawPositiveAfterLock = 0
var correctionArmed = 0
var depth = 0
var hiddenArmed = 0
var hiddenArmedBar = -1000
var hiddenOrigin = -1
var prevLowPrice = 0
var prevLowOsc = 0
var prevLowBar = -1000
var lastBuyBar = -1000
let dCorrArmed = if(bullReg == 0, 0, correctionArmed)
let dDepth = if(bullReg == 0, 0, depth)
let dHiddenArmed = if(bullReg == 0, 0, hiddenArmed)
let dHiddenOrigin = if(bullReg == 0, -1, hiddenOrigin)
let sawPos = if(locked == 1, if(sawPositiveAfterLock == 1 or fast > 0, 1, 0), sawPositiveAfterLock)
let unlocks = locked == 1 and sawPos == 1 and fast <= 0 and bullReg
let lLocked = if(unlocks, 0, locked)
let lSawPos = if(unlocks, 0, sawPos)
let cCorrArmed = if(unlocks, 1, dCorrArmed)
let cDepth = if(unlocks, abs(fast), dDepth)
let arms = bullReg and fast < 0 and lLocked == 0
let eCorrArmed = if(arms, 1, cCorrArmed)
let eDepth = if(arms, max(cDepth, abs(fast)), cDepth)
let minDepth = 0.05 * max(atrV, 0.01)
let depthOk = eCorrArmed == 1 and eDepth >= minDepth
let pivotDist = pivLo.bar - prevLowBar
let pivotDistOk = prevLowBar > -1000 and pivotDist >= 5 and pivotDist <= 100
let hiddenConfirmed = pivLo.confirmed and bullReg and lLocked == 0 and depthOk and pivotDistOk
and prevLowBar > -1000 and pivLo.price > prevLowPrice and oscAtPivot < prevLowOsc
let nPrevLowPrice = if(pivLo.confirmed, pivLo.price, prevLowPrice)
let nPrevLowOsc = if(pivLo.confirmed, oscAtPivot, prevLowOsc)
let nPrevLowBar = if(pivLo.confirmed, pivLo.bar, prevLowBar)
let fHiddenArmed = if(hiddenConfirmed, 1, dHiddenArmed)
let fHiddenArmedBar = if(hiddenConfirmed, bar_index, hiddenArmedBar)
let fHiddenOrigin = if(hiddenConfirmed, pivLo.bar, dHiddenOrigin)
let expires = fHiddenArmed == 1 and (bullReg == 0 or bar_index - fHiddenArmedBar > 20)
let gHiddenArmed = if(expires, 0, fHiddenArmed)
let gHiddenOrigin = if(expires, -1, fHiddenOrigin)
let buyRel = bullReg and lLocked == 0 and depthOk and crossover(fast, fastSig) and fast < 0
let buyHid = gHiddenArmed == 1 and bullReg and lLocked == 0 and crossover(fast, fastSig)
let buyType = if(buyRel and buyHid, 3, if(buyHid, 2, if(buyRel, 1, 0)))
let buyBarsOk = bar_index - lastBuyBar >= 20
let buyFilters = bullReg and emaBuyOk and rangeOk
let buyAccept = buyType > 0 and buyFilters and buyBarsOk
# buyType 1/2/3 is a real distinction the engine makes in its event_type -
# RELEASE (plain crossover), HIDDEN (a confirmed hidden divergence
# triggered it), COMBINED (both at once) - not three names for one thing.
# One transition per type, same guard split three ways.
IDLE -> IDLE when buyType == 1 and buyAccept emit BA_BUY_RELEASE
set locked = 1 set sawPositiveAfterLock = if(fast > 0, 1, 0)
set correctionArmed = 0 set depth = 0 set hiddenArmed = 0
set hiddenArmedBar = -1000 set hiddenOrigin = -1
set prevLowPrice = nPrevLowPrice set prevLowOsc = nPrevLowOsc set prevLowBar = nPrevLowBar
set lastBuyBar = bar_index
IDLE -> IDLE when buyType == 2 and buyAccept emit BA_BUY_HIDDEN
set locked = 1 set sawPositiveAfterLock = if(fast > 0, 1, 0)
set correctionArmed = 0 set depth = 0 set hiddenArmed = 0
set hiddenArmedBar = -1000 set hiddenOrigin = -1
set prevLowPrice = nPrevLowPrice set prevLowOsc = nPrevLowOsc set prevLowBar = nPrevLowBar
set lastBuyBar = bar_index
IDLE -> IDLE when buyType == 3 and buyAccept emit BA_BUY_COMBINED
set locked = 1 set sawPositiveAfterLock = if(fast > 0, 1, 0)
set correctionArmed = 0 set depth = 0 set hiddenArmed = 0
set hiddenArmedBar = -1000 set hiddenOrigin = -1
set prevLowPrice = nPrevLowPrice set prevLowOsc = nPrevLowOsc set prevLowBar = nPrevLowBar
set lastBuyBar = bar_index
IDLE -> IDLE when buyType > 0 and (buyAccept == 0) reject "filtered"
set locked = 1 set sawPositiveAfterLock = if(fast > 0, 1, 0)
set correctionArmed = 0 set depth = 0 set hiddenArmed = 0
set hiddenArmedBar = -1000 set hiddenOrigin = -1
set prevLowPrice = nPrevLowPrice set prevLowOsc = nPrevLowOsc set prevLowBar = nPrevLowBar
IDLE -> IDLE when true
set locked = lLocked set sawPositiveAfterLock = lSawPos
set correctionArmed = eCorrArmed set depth = eDepth
set hiddenArmed = gHiddenArmed set hiddenArmedBar = fHiddenArmedBar set hiddenOrigin = gHiddenOrigin
set prevLowPrice = nPrevLowPrice set prevLowOsc = nPrevLowOsc set prevLowBar = nPrevLowBar
}
machine bear {
var locked = 0
var sawNegativeAfterLock = 0
var correctionArmed = 0
var depth = 0
var hiddenArmed = 0
var hiddenArmedBar = -1000
var hiddenOrigin = -1
var prevHighPrice = 0
var prevHighOsc = 0
var prevHighBar = -1000
var lastSellBar = -1000
let dCorrArmed = if(bearReg == 0, 0, correctionArmed)
let dDepth = if(bearReg == 0, 0, depth)
let dHiddenArmed = if(bearReg == 0, 0, hiddenArmed)
let dHiddenOrigin = if(bearReg == 0, -1, hiddenOrigin)
let sawNeg = if(locked == 1, if(sawNegativeAfterLock == 1 or fast < 0, 1, 0), sawNegativeAfterLock)
let unlocks = locked == 1 and sawNeg == 1 and fast >= 0 and bearReg
let lLocked = if(unlocks, 0, locked)
let lSawNeg = if(unlocks, 0, sawNeg)
let cCorrArmed = if(unlocks, 1, dCorrArmed)
let cDepth = if(unlocks, abs(fast), dDepth)
let arms = bearReg and fast > 0 and lLocked == 0
let eCorrArmed = if(arms, 1, cCorrArmed)
let eDepth = if(arms, max(cDepth, abs(fast)), cDepth)
let minDepth = 0.05 * max(atrV, 0.01)
let depthOk = eCorrArmed == 1 and eDepth >= minDepth
let pivotDist = pivHi.bar - prevHighBar
let pivotDistOk = prevHighBar > -1000 and pivotDist >= 5 and pivotDist <= 100
let hiddenConfirmed = pivHi.confirmed and bearReg and lLocked == 0 and depthOk and pivotDistOk
and prevHighBar > -1000 and pivHi.price < prevHighPrice and oscAtPivot > prevHighOsc
let nPrevHighPrice = if(pivHi.confirmed, pivHi.price, prevHighPrice)
let nPrevHighOsc = if(pivHi.confirmed, oscAtPivot, prevHighOsc)
let nPrevHighBar = if(pivHi.confirmed, pivHi.bar, prevHighBar)
let fHiddenArmed = if(hiddenConfirmed, 1, dHiddenArmed)
let fHiddenArmedBar = if(hiddenConfirmed, bar_index, hiddenArmedBar)
let fHiddenOrigin = if(hiddenConfirmed, pivHi.bar, dHiddenOrigin)
let expires = fHiddenArmed == 1 and (bearReg == 0 or bar_index - fHiddenArmedBar > 20)
let gHiddenArmed = if(expires, 0, fHiddenArmed)
let gHiddenOrigin = if(expires, -1, fHiddenOrigin)
let sellRel = bearReg and lLocked == 0 and depthOk and crossunder(fast, fastSig) and fast > 0
let sellHid = gHiddenArmed == 1 and bearReg and lLocked == 0 and crossunder(fast, fastSig)
let sellType = if(sellRel and sellHid, 3, if(sellHid, 2, if(sellRel, 1, 0)))
let sellBarsOk = bar_index - lastSellBar >= 20
let sellFilters = bearReg and emaSellOk and rangeOk
let sellAccept = sellType > 0 and sellFilters and sellBarsOk
IDLE -> IDLE when sellType == 1 and sellAccept emit BA_SELL_RELEASE
set locked = 1 set sawNegativeAfterLock = if(fast < 0, 1, 0)
set correctionArmed = 0 set depth = 0 set hiddenArmed = 0
set hiddenArmedBar = -1000 set hiddenOrigin = -1
set prevHighPrice = nPrevHighPrice set prevHighOsc = nPrevHighOsc set prevHighBar = nPrevHighBar
set lastSellBar = bar_index
IDLE -> IDLE when sellType == 2 and sellAccept emit BA_SELL_HIDDEN
set locked = 1 set sawNegativeAfterLock = if(fast < 0, 1, 0)
set correctionArmed = 0 set depth = 0 set hiddenArmed = 0
set hiddenArmedBar = -1000 set hiddenOrigin = -1
set prevHighPrice = nPrevHighPrice set prevHighOsc = nPrevHighOsc set prevHighBar = nPrevHighBar
set lastSellBar = bar_index
IDLE -> IDLE when sellType == 3 and sellAccept emit BA_SELL_COMBINED
set locked = 1 set sawNegativeAfterLock = if(fast < 0, 1, 0)
set correctionArmed = 0 set depth = 0 set hiddenArmed = 0
set hiddenArmedBar = -1000 set hiddenOrigin = -1
set prevHighPrice = nPrevHighPrice set prevHighOsc = nPrevHighOsc set prevHighBar = nPrevHighBar
set lastSellBar = bar_index
IDLE -> IDLE when sellType > 0 and (sellAccept == 0) reject "filtered"
set locked = 1 set sawNegativeAfterLock = if(fast < 0, 1, 0)
set correctionArmed = 0 set depth = 0 set hiddenArmed = 0
set hiddenArmedBar = -1000 set hiddenOrigin = -1
set prevHighPrice = nPrevHighPrice set prevHighOsc = nPrevHighOsc set prevHighBar = nPrevHighBar
IDLE -> IDLE when true
set locked = lLocked set sawNegativeAfterLock = lSawNeg
set correctionArmed = eCorrArmed set depth = eDepth
set hiddenArmed = gHiddenArmed set hiddenArmedBar = fHiddenArmedBar set hiddenOrigin = gHiddenOrigin
set prevHighPrice = nPrevHighPrice set prevHighOsc = nPrevHighOsc set prevHighBar = nPrevHighBar
}
plot fast, fastSig on price
plot slow as histogram in "slow" guide 0
plot adxV as line in "adx" guide 20
mark BA_BUY_RELEASE arrow_up below_bar color bull
mark BA_BUY_HIDDEN arrow_up below_bar color bull
mark BA_BUY_COMBINED arrow_up below_bar color bull
mark BA_SELL_RELEASE arrow_down above_bar color bear
mark BA_SELL_HIDDEN arrow_down above_bar color bear
mark BA_SELL_COMBINED arrow_down above_bar color bear
}
FAQ
It detects fast-MACD correction-release crosses and confirmed hidden divergences within a slow-MACD bullish or bearish regime. Accepted signals must also pass the enabled EMA, range, session, correction-depth, and signal-spacing rules.
Accepted markers require `barstate.isconfirmed`, so they are emitted on confirmed bar closes. Hidden-divergence pivots require `Pivot Right Bars` future completed bars; divergence lines are then drawn back on the pivot bars, but signal markers are not backdated.
REL is a correction-release setup based on the fast MACD crossing its signal line after an armed correction. HID is a confirmed hidden-divergence setup, while COMBO means both core conditions occurred together.
No. This is an indicator, and its SL/TP drawings are visual projections from the signal close; it does not call strategy orders, simulate fills, or manage positions.
The script provides alert conditions for accepted buy/sell signals, plus separate correction-release, hidden-divergence, and combined alerts. Add the indicator to a chart, then select the relevant Arrow.AlgoNexta condition when creating a TradingView alert.
No. This indicator is not financial advice and contains no verified performance claim; use TradingView Strategy Tester or an equivalent platform for your own historical, paper-trading, and live-result evaluation.
Describe the change in plain English and AlgoNexta rebuilds it as a fresh Pine v6 script — with its own explanation, evidence, and walkthrough.
Build your own versionEducational content only — not financial advice. TradingView is the source of truth for live data, compilation, and Strategy Tester results.
We use cookies to understand how the site is used and improve it. We only load analytics after you accept. Privacy Policy