OPEN-SOURCE SCRIPT
Directional Indicator Crossovers [JopAlgo]

Directional Indicator Crossovers [JopAlgo] — read trend intent at a glance, on any timeframe
Most traders ask two questions before they click: who’s in control right now and is control getting stronger or weaker?
The Directional Indicator (DI) answers the first one cleanly. +DI tracks upward directional movement; –DI tracks downward directional movement. When +DI crosses above –DI, buyers have the initiative; when –DI crosses above +DI, sellers do. DI Xover [JopAlgo] focuses on that simple, tradeable signal—the crossover—and keeps the pane uncluttered so you can layer it with your location/flow tools.
(If you add screenshots: image #1 can label +DI, –DI and a bullish crossover; image #2 can show a failed crossover in chop next to a successful one at a strong level.)
What you’re seeing (and how it’s built)
This indicator plots two lines in a separate pane:
+DI (green): smoothed positive directional movement.
–DI (red): smoothed negative directional movement.
Under the hood (length = 14 by default):
It measures how much today’s high exceeded yesterday’s high (up move) and how much today’s low fell below yesterday’s low (down move).
It keeps only the dominant side each bar (if up > down and up > 0 → up counts; vice-versa for down).
It normalizes by True Range (so moves are scaled by volatility) and smooths with RMA (so you don’t get jitter).
It raises alerts when +DI crosses above –DI (bullish) or –DI crosses above +DI (bearish).
How to read it, fast:
Cross up = buyers just took initiative.
Cross down = sellers just took initiative.
Wider distance between the lines = stronger control.
Lines braided/tight = balance/chop → expect more fake crosses.
DI is about directional control. It doesn’t tell you where to trade—that’s your location (e.g., Volume Profile, AVWAP). Use DI as a timing/confirmation layer, not as a standalone level generator.
Using DI Crossovers on any timeframe
The framework doesn’t change; only your expectations do as you zoom.
Scalping (1–5m)
Treat crossovers as triggers at levels. If price is tagging VAL/VAH/LVN (from Volume Profile v3.2) or Anchored VWAP, a fresh +DI cross up is your green light for a quick long; –DI cross up flips that logic for shorts.
Avoid taking every crossover mid-range—wait for location first.
In fast tape, require the lines to separate for 1–2 bars after the cross before you click.
Intraday (15m–1H)
In trend days, the first pullback into your level (POC/VA boundary/AVWAP) that prints a fresh +DI cross up is often the cleanest add/entry.
In balance days, fade DI crosses at edges back to POC—only if your flow tool isn’t screaming absorption against you.
Swing (2H–4H)
Look for confluence: at Weekly AVWAP or composite VAL/VAH, a DI crossover that stays separated for several bars is a solid momentum confirmation.
Failed crossover (lines recross quickly) near a level is a useful fail signal—expect a move back into value.
Position (1D–1W)
Use fewer, bigger signals: a weekly DI cross at Monthly/Quarterly AVWAP or at composite value edges marks a regime change.
Add on pullbacks when the controlling DI stays dominant (distance holds or widens).
Entries, exits, and risk (simple rules)
Entry (with level): wait for price to reach your level (e.g., VAL/VAH or AVWAP), then take the trade with the DI cross in that direction.
Filter: skip crosses when the two lines are braided (tiny separation) unless you’re trading a tight scalp with strict risk.
Exit / reduce: if your trade was based on a bullish cross, consider reducing when –DI recaptures +DI or the lines flatten at your target HVN/POC.
Stops: put them beyond the level (not just on a DI recross), but treat a fast recross as a warning to tighten.
Settings that actually matter (and how to tune them)
DI Length (default 14):
Shorter (7–10) = faster signals, more noise (good for scalps with filters).
Longer (20–30) = fewer but stronger signals (good for swing/position).
If you often see flip-flops, lengthen the setting or take crosses only at VP/AVWAP levels.
Pro tip: Define a minimum separation rule for yourself (e.g., after a cross, require the gap between +DI and –DI to increase on the next bar). You don’t need extra code for this—just enforce it visually.
What to look for (pattern cheatsheet)
Cross + hold at a level: The lines cross at your level and keep separating → high-quality entry in that direction.
Sneaky fail: Cross, then immediate recross back → treat it as a fade signal back into value (especially near VAH/VAL).
Strength confirmation: After a breakout, +DI stays above –DI on pullbacks → trend is healthy; buy dips at AVWAP/POC.
Pre-move tell: DI lines unbraid and begin diverging before price leaves a range; wait for location + trigger.
Combining DI Xover with other [JopAlgo] tools
Cumulative Volume Delta v1 [JopAlgo] (CVDv1):
Use DI for direction, and CVDv1 for quality. A bullish DI cross with ALIGN OK + Imbalance strong + no Absorption is a far better long than DI alone.
If DI crosses up but CVDv1 flags Absorption (red), don’t chase—look for the fail/reclaim instead.
Volume Profile v3.2 [JopAlgo]:
Let VP choose the battleground (POC/VAH/VAL/LVNs). Take the DI crossover at those references.
Classic: bearish DI cross at VAH → fade toward POC; bullish DI cross at VAL → rotate to POC—assuming CVDv1 isn’t vetoing with Absorption.
Anchored VWAP [JopAlgo]:
Treat reclaims/rejections of AVWAP as the location and DI cross as the trigger.
Example: price reclaims Weekly AVWAP, then on the next pullback, a +DI cross up confirms the add.
Common pitfalls this helps you avoid
Trading crosses in the middle of nowhere. DI is a trigger, not a level; wait for VP/AVWAP.
Chasing every wiggle. When the lines are braided, you’re likely in balance—expect fake crosses.
Ignoring flow. A DI cross against CVDv1 Absorption is often a trap; quality > quantity.
Practical defaults to start with
Length: 14
Timeframes: Works out of the box on 15m–4H. For 1–5m scalps try 10–12; for daily/weekly swings try 20–30.
Process: Only act on crosses at levels (VP v3.2 / Anchored VWAP), and prefer those where CVDv1 says ALIGN OK and no Absorption.
Alerts (what they tell you)
Bullish DI Crossover: +DI crossed above –DI → buyers just took initiative. Look to your chart for location and CVDv1 quality before entering.
Bearish DI Crossover: –DI crossed above +DI → sellers took initiative. Same rule: confirm at a level with flow.
Open source & disclaimer
This indicator is published open source so traders can learn, adapt, and build rules they trust. No tool guarantees outcomes; risk management remains essential.
Disclaimer — Not Financial Advice.
The “Directional Indicator Crossovers [JopAlgo]” indicator and this description are provided for educational purposes only and do not constitute financial or investment advice. Trading involves risk, including possible loss of capital. [JopAlgo] makes no warranties and assumes no responsibility for any trading decisions or outcomes resulting from the use of this script. Past performance is not indicative of future results.
Most traders ask two questions before they click: who’s in control right now and is control getting stronger or weaker?
The Directional Indicator (DI) answers the first one cleanly. +DI tracks upward directional movement; –DI tracks downward directional movement. When +DI crosses above –DI, buyers have the initiative; when –DI crosses above +DI, sellers do. DI Xover [JopAlgo] focuses on that simple, tradeable signal—the crossover—and keeps the pane uncluttered so you can layer it with your location/flow tools.
(If you add screenshots: image #1 can label +DI, –DI and a bullish crossover; image #2 can show a failed crossover in chop next to a successful one at a strong level.)
What you’re seeing (and how it’s built)
This indicator plots two lines in a separate pane:
+DI (green): smoothed positive directional movement.
–DI (red): smoothed negative directional movement.
Under the hood (length = 14 by default):
It measures how much today’s high exceeded yesterday’s high (up move) and how much today’s low fell below yesterday’s low (down move).
It keeps only the dominant side each bar (if up > down and up > 0 → up counts; vice-versa for down).
It normalizes by True Range (so moves are scaled by volatility) and smooths with RMA (so you don’t get jitter).
It raises alerts when +DI crosses above –DI (bullish) or –DI crosses above +DI (bearish).
How to read it, fast:
Cross up = buyers just took initiative.
Cross down = sellers just took initiative.
Wider distance between the lines = stronger control.
Lines braided/tight = balance/chop → expect more fake crosses.
DI is about directional control. It doesn’t tell you where to trade—that’s your location (e.g., Volume Profile, AVWAP). Use DI as a timing/confirmation layer, not as a standalone level generator.
Using DI Crossovers on any timeframe
The framework doesn’t change; only your expectations do as you zoom.
Scalping (1–5m)
Treat crossovers as triggers at levels. If price is tagging VAL/VAH/LVN (from Volume Profile v3.2) or Anchored VWAP, a fresh +DI cross up is your green light for a quick long; –DI cross up flips that logic for shorts.
Avoid taking every crossover mid-range—wait for location first.
In fast tape, require the lines to separate for 1–2 bars after the cross before you click.
Intraday (15m–1H)
In trend days, the first pullback into your level (POC/VA boundary/AVWAP) that prints a fresh +DI cross up is often the cleanest add/entry.
In balance days, fade DI crosses at edges back to POC—only if your flow tool isn’t screaming absorption against you.
Swing (2H–4H)
Look for confluence: at Weekly AVWAP or composite VAL/VAH, a DI crossover that stays separated for several bars is a solid momentum confirmation.
Failed crossover (lines recross quickly) near a level is a useful fail signal—expect a move back into value.
Position (1D–1W)
Use fewer, bigger signals: a weekly DI cross at Monthly/Quarterly AVWAP or at composite value edges marks a regime change.
Add on pullbacks when the controlling DI stays dominant (distance holds or widens).
Entries, exits, and risk (simple rules)
Entry (with level): wait for price to reach your level (e.g., VAL/VAH or AVWAP), then take the trade with the DI cross in that direction.
Filter: skip crosses when the two lines are braided (tiny separation) unless you’re trading a tight scalp with strict risk.
Exit / reduce: if your trade was based on a bullish cross, consider reducing when –DI recaptures +DI or the lines flatten at your target HVN/POC.
Stops: put them beyond the level (not just on a DI recross), but treat a fast recross as a warning to tighten.
Settings that actually matter (and how to tune them)
DI Length (default 14):
Shorter (7–10) = faster signals, more noise (good for scalps with filters).
Longer (20–30) = fewer but stronger signals (good for swing/position).
If you often see flip-flops, lengthen the setting or take crosses only at VP/AVWAP levels.
Pro tip: Define a minimum separation rule for yourself (e.g., after a cross, require the gap between +DI and –DI to increase on the next bar). You don’t need extra code for this—just enforce it visually.
What to look for (pattern cheatsheet)
Cross + hold at a level: The lines cross at your level and keep separating → high-quality entry in that direction.
Sneaky fail: Cross, then immediate recross back → treat it as a fade signal back into value (especially near VAH/VAL).
Strength confirmation: After a breakout, +DI stays above –DI on pullbacks → trend is healthy; buy dips at AVWAP/POC.
Pre-move tell: DI lines unbraid and begin diverging before price leaves a range; wait for location + trigger.
Combining DI Xover with other [JopAlgo] tools
Cumulative Volume Delta v1 [JopAlgo] (CVDv1):
Use DI for direction, and CVDv1 for quality. A bullish DI cross with ALIGN OK + Imbalance strong + no Absorption is a far better long than DI alone.
If DI crosses up but CVDv1 flags Absorption (red), don’t chase—look for the fail/reclaim instead.
Volume Profile v3.2 [JopAlgo]:
Let VP choose the battleground (POC/VAH/VAL/LVNs). Take the DI crossover at those references.
Classic: bearish DI cross at VAH → fade toward POC; bullish DI cross at VAL → rotate to POC—assuming CVDv1 isn’t vetoing with Absorption.
Anchored VWAP [JopAlgo]:
Treat reclaims/rejections of AVWAP as the location and DI cross as the trigger.
Example: price reclaims Weekly AVWAP, then on the next pullback, a +DI cross up confirms the add.
Common pitfalls this helps you avoid
Trading crosses in the middle of nowhere. DI is a trigger, not a level; wait for VP/AVWAP.
Chasing every wiggle. When the lines are braided, you’re likely in balance—expect fake crosses.
Ignoring flow. A DI cross against CVDv1 Absorption is often a trap; quality > quantity.
Practical defaults to start with
Length: 14
Timeframes: Works out of the box on 15m–4H. For 1–5m scalps try 10–12; for daily/weekly swings try 20–30.
Process: Only act on crosses at levels (VP v3.2 / Anchored VWAP), and prefer those where CVDv1 says ALIGN OK and no Absorption.
Alerts (what they tell you)
Bullish DI Crossover: +DI crossed above –DI → buyers just took initiative. Look to your chart for location and CVDv1 quality before entering.
Bearish DI Crossover: –DI crossed above +DI → sellers took initiative. Same rule: confirm at a level with flow.
Open source & disclaimer
This indicator is published open source so traders can learn, adapt, and build rules they trust. No tool guarantees outcomes; risk management remains essential.
Disclaimer — Not Financial Advice.
The “Directional Indicator Crossovers [JopAlgo]” indicator and this description are provided for educational purposes only and do not constitute financial or investment advice. Trading involves risk, including possible loss of capital. [JopAlgo] makes no warranties and assumes no responsibility for any trading decisions or outcomes resulting from the use of this script. Past performance is not indicative of future results.
Скрипт с открытым кодом
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения.
Отказ от ответственности
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.
Скрипт с открытым кодом
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения.
Отказ от ответственности
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.