Ehlers Sinewave Cycle Indicator
Most oscillators tell you a turn happened after price has already moved. Ehlers' Sinewave Indicator is built to lead instead: it first measures the market's own dominant cycle length using a Hilbert transform (the same technique behind the MAMA adaptive average), then runs a short discrete Fourier sum over that many bars of smoothed price to recover exactly where in its cycle the market currently sits - its phase. Sine is that phase plotted directly; LeadSine is the same phase advanced by 45 degrees. In a genuinely cycling market the two lines cross roughly every half cycle, ahead of the peak or trough, which is the entire point of measuring phase instead of just plotting a lagging average. The honest limitation, which Ehlers states plainly in the source material and which this submission repeats rather than hides: this only works while the market is cycling. When the measured dominant period pins against its 50-bar ceiling for a stretch, that is the algorithm's own signal that price has stopped cycling and started trending - and Sine/LeadSine crosses during a trend are noise, not signal. A tool that measures cycle phase cannot also promise to work when there is no cycle to measure; this one does not try. Notes and limitations - Needs roughly 60 bars of history before the dominant-cycle measurement and the 50-bar DFT window are both fully populated; earlier bars are seeded flat rather than left blank. - Sine/LeadSine crosses are a timing cue, not a trade signal on their own - they say nothing about direction beyond the immediate cycle turn, and nothing about position size, stop placement or trend context. - Deliberately unreliable during trends, by construction - see the full description above. This is not a defect to be patched; a phase-based cycle tool cannot honestly claim to time a market that has stopped cycling. - Recursive filters throughout mean no repainting: once a bar closes, its Sine and LeadSine values are final.
Indicator · MT4 · v1.0 · Free
About Ehlers Sinewave Cycle Indicator
Ehlers Sinewave Cycle Indicator is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 1 setting, such as Alerts. MQL source code included.
Files in the download: EhlersSinewaveIndicator.ex4, EhlersSinewaveIndicator.mq4, EhlersSinewaveIndicator.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Alerts | true | Alert once per closed bar when Sine crosses LeadSine |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Oscillator · Alerts · MT4 Indicator · MQL4 Source Code