Traders Dynamic Index — ForexBestRobots edition 1.10 — MT5
SOURCE ONLY. Native MT4/MT5 compilation, rendering, broker synchronization and
actual notifications NOT verified. No ready EX4/EX5. Compile with F7 in matching
MetaEditor, inspect errors/warnings and test on a demo chart.
C++ checks cover extracted numerical/event functions, not native MQL/runtime.

INSTALL
1. Extract ZIP; MetaTrader > File > Open Data Folder > MQL5.
2. Copy Indicators there. Keep upstream separately as the unchanged reference.
3. Open Indicators/Traders_Dynamic_Index_ForexBestRobots.mq5 in matching desktop MetaEditor; F7.
4. Refresh Navigator > Indicators and attach compiled program to a demo chart.
5. Start with defaults, unique ArrowPrefix and all delivery/arrows OFF.
No DLL or extra include file. Not a mobile custom indicator or cTrader package.
Modified code: UTF-16LE with BOM. Original upstream bytes retained unchanged.

DEFAULT CALCULATION
Close RSI13, native platform RSI. G=SMA(RSI,2), R=SMA(RSI,7), Y=SMA(RSI,34).
U=Y+1.6185*s; L=Y-1.6185*s. Sample variance divisor n-1 over 34 RSI readings.
RSI averages support SMA/EMA/SMMA/LWMA. MT5 includes its original MA helper.
Five display lines; levels 32/50/68; scale 0..100 can clip external bands.
37 functional inputs on both platforms; MT4 adds 3 separator strings.
RSI/Band>=2, MA periods>=1, positive finite StdDev. Defensive period cap 100000.
ArrowSize 1..5; ArrowPrefix nonempty/no spaces/max 40, unique namespace.
Default prefix ForexBestRobots-TDI-. Duplicate/nested prefixes rejected.
Failed init does not clean another instance. Do not remove the hidden InstanceLock.

EVENTS
Up cross a>b now and previous_a<=previous_b; down a<b and previous_a>=previous_b.
Five independent families: red/yellow, hook, green/red, qualified green/red,
green/yellow. Qualified family also requires BOTH lines on the proper side of
Y on the evaluated candle. Default red/yellow ON but popup/email/push/arrows OFF.
HOOK preserves upstream OR test over TWO bars: upper downcross needs each of
G and U above 68 on at least one bar; lower upcross needs each of G and L below 32
on at least one bar. Not necessarily both on the current candle.
One delivered notification per family per chart bar. First calculation/history
reset silent. Failed delivery not retried each tick. Current may change/reverse;
already sent messages remain. Arrows update and use family-specific names,
including ordinary/qualified families sharing glyph codes. Historical arrows
anchor on evaluated candle time and chart High/Low, not trade execution prices.
No orders, external WebRequest, account identity or DLL imports.

TIMEFRAMES / HISTORY
UpperTimeframe default PERIOD_CURRENT. Same or higher permitted; lower rejected.
Previous means previous CHART candle. H1 Previous does not close a developing H4.
Historical MTF projection uses snapshots of the higher bar on lower chart bars;
final higher values may not have been known at those earlier lower-bar times.
Do not interpret historical MTF arrows as an executable real-time backtest.
Program timestamps use broker chart clock. No timezone conversion is performed.
Source buffers require full RSI/band/MA context; valid zero RSI is allowed.
Initial RSI warm-up tail is excluded from plotted windows; terminal feed and
RSI/EMA seeding affect early values. Load enough higher-timeframe history.
New chart bars detected by timestamp even at capped count. Higher buffers fully
refresh at new chart bars to avoid lower-chart buffer shifts misaligning them.
After older-history corrections reattach if full refresh is needed.
Long histories/many MTF instances can cost resources; test responsiveness.

LICENSE / ATTRIBUTION
EarnForex copyright 2025; based on Dean Malone 2006. Apache 2.0 full LICENSE.
https://github.com/EarnForex/Traders-Dynamic-Index/tree/faee171b3dd03d7d98537787c37d0737509cce09
No NOTICE in that pinned tree. Original source unchanged under upstream.
Our changes marked in source/CHANGES/patch; no author endorsement implied.
CHECKSUMS.sha256 covers every other entry. INSTALL/ has 12 native instructions.
https://forexbestrobots.com/indicators/traders-dynamic-index-mt4-mt5.html

SOURCE-HISTORY FIX
Edition 1.10 bounds RSI moving-average input to the actual source-timeframe history. This fixes SMMA with longer custom periods when the lower chart has more bars; default SMA2/7 values are unchanged.
