This version was created entirely using AI.Eis wrote: Sat Jul 25, 2026 2:45 pm seemed pretty basic hi lo stuff after conversion so added tdfi filter which was great! only until it stopped working on different timeframes if anybody can find the time to fix this that would be cool thx
Check if it still meets your desired outcome.
Below is the changelog (generated by AI) detailing the changes made to the original SSSSSS.mq5 code, followed by the AI-generated version.
Change log:
# RMI Trend Sniper (TDFI Edition) — Changelog
**Version 1.25 — 2026-07-25**
Three bugs fixed related to the TDFI filter and the custom-timeframe ("Calculation Timeframe") feature. If you're only running the indicator on your chart's native timeframe and never touched the TDFI settings, the practical effect is: signals are more consistent, and the trend color no longer glitches when you switch timeframes.
### 1. TDFI filter didn't scale across timeframes or symbols
The TDFI momentum filter used to compare the average price move over a few bars against a fixed number. That worked fine on whatever chart it happened to be tuned on, but broke almost everywhere else — on some timeframes it blocked nearly every signal, on others it let almost everything through, because typical bar-to-bar price movement is a completely different size on M1 than on H4.
It now compares today's "force" against the indicator's own recent average force, so the threshold means the same thing regardless of timeframe or instrument.
### 2. Custom-timeframe mode was quietly mixing timeframes
If you set "Calculation Timeframe" to something other than your chart's own period, part of the indicator (the momentum/RSI-style component and the TDFI filter) was still silently reading price data from your chart's timeframe instead of the one you selected, while the rest of the indicator correctly used your selection. Everything now reads from the same, selected calculation timeframe.
### 3. Trend color could flip incorrectly right after switching chart timeframe
Switching your chart's timeframe forces the indicator to fully recalculate, and it was only looking back about 72 bars to figure out the current trend color. If the trend had been running longer than that without a fresh signal, or a small noisy blip sat in that recent window, the color could briefly show the wrong side right after the switch — even though nothing about the actual trend had changed. It now looks back through the full available history on a fresh load, so the color you see matches what it would have shown all along.
---
### If you customized the TDFI settings
- **TDFI Level default changed from 0.05 to 0.3**, and its meaning changed: it's no longer a raw price threshold, it's now "how many times the recent average force" is required to count as a signal. If you'd tuned this input yourself, you'll want to re-tune it — the old value won't mean the same thing anymore.
- **New setting: TDFI Normalization Window (default 50 bars)** — controls how far back the filter looks to judge what "average force" is. Shorter = more reactive, longer = smoother/slower to adapt.
All other settings are unchanged.