Composite Cycle Forecast
If a market's recent behaviour really is dominated by a small number of cycles, summing those cycles back together and running the sum forward is the most direct way to ask "what would price do next if this held". This indicator does exactly that: it scans a period range with the Goertzel algorithm (the same targeted single-frequency technique as GoertzelCycleFinder, re-implemented here so this project stands alone), keeps the InpNumCycles strongest matches with their period, amplitude and phase, sums those sinusoids on top of the window's own linear trend, and draws the result as a dashed line running from the last closed bar out to InpForecastBars bars ahead. The projection is drawn with small trend-line segments rather than an indicator buffer, because a buffer's plotted range cannot extend past the chart's currently loaded bars - drawing genuinely into the future needs chart objects positioned at future timestamps instead. A fixed, impossible-to-miss label reading "OUT OF SAMPLE FORECAST" is drawn alongside the projection every time it redraws. This is extrapolation, not prediction: it assumes the measured cycles keep their period, amplitude and phase unchanged into the future, which is a strong assumption real markets routinely break, often well before InpForecastBars bars pass. The label exists so the line is never mistaken for anything sturdier than what it actually is. Notes and limitations - Needs InpWindowBars plus one bar of history before a forecast can be drawn. - This is curve extrapolation from measured cycles, not a trained model and not a guarantee. Treat it as a "what if this holds" overlay only. - Longer InpForecastBars values compound the assumption further into the future; confidence in the line should fall as it extends rightward, not stay constant. - The projection is redrawn from scratch once per closed bar, replacing the previous one entirely rather than blending with it. - Draws with chart trend-line objects, not an indicator buffer, since a buffer cannot plot beyond the chart's currently loaded bar range.
Indicator · MT5 · v1.0 · Free
About Composite Cycle Forecast
Composite Cycle Forecast is an indicator for MetaTrader 5. It has 7 settings, such as Window bars, Min period and Max period. MQL source code included.
Files in the download: CompositeCycleForecast.ex5, CompositeCycleForecast.mq5, CompositeCycleForecast.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Window bars | 200 | Samples analysed to extract cycles |
| Min period | 5 | Shortest period tested, in bars |
| Max period | 60 | Longest period tested, in bars |
| Num cycles | 3 | Strongest cycles summed into the forecast |
| Forecast bars | 40 | Bars projected forward beyond the last close |
| Forecast color | clrYellow | Projection line colour |
| Line width | 2 | Projection line width |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 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: MT5 Indicator · MQL5 Source Code