Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Views:
134
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
Fractal with CCI Filter


  • Description
This indicator enhances the classic fractal indicator by adding a smart filter based on the Commodity Channel Index (CCI). While the standard fractal indicator generates many false signals, especially in sideways markets, this version only displays signals when the CCI confirms the strength of the movement, significantly increasing the signal success rate.
  • Main Features
    • CCI Smart Filter: Fractal signals are only displayed when the CCI reaches extreme levels, confirming the strength of the movement
    • Timing accuracy: Uses the CCI value exactly on the signal candle, not on the confirmation candle
    • Flexible configuration: CCI period and filtering threshold are fully configurable
    • Clear visualisation: Red arrows above candles for sell signals, green arrows below for buy signals
    • Works on all timeframes: Adapted to work correctly in both real mode and Strategy Tester
  • How to Use
  1. Sell Signals: When a red arrow appears above the candle, it indicates a confirmed bullish fractal with CCI above the threshold.
  2. Buy Signals: When a green arrow appears below the candle, it indicates a confirmed bearish fractal with CCI below the negative threshold.
  3. Confirmation: For greater reliability, wait for the confirmation candle to close before entering the trade.
  • Inputs
- CCI_Period: CCI period (default: 7) - adjust according to your strategy
- CCI_Threshold: CCI threshold for filtering fractals (default: 110) - increase for rarer and more reliable signals

  • Usage Tips
- For reversal operations: Use CCI_Threshold = 100-110
- For trend trading: Combine with a long-term moving average
- In very volatile markets: Increase CCI_Threshold to reduce false signals
- In sideways markets: Decrease CCI_Period for greater sensitivity
  • Observations
- This indicator does not repaint - signals are confirmed after the necessary candles close
- Signals are plotted exactly on the candle where the fractal occurs, with the CCI checked on the same candle
- Based on the correct mathematical logic of fractal detection (5 candles for confirmation)

This indicator is the result of collaborative work between Joy and Qwen, enhancing the traditional fractal approach with a statistically significant CCI filter.


Translated from Portuguese by MetaQuotes Ltd.
Original code: https://www.mql5.com/pt/code/62145

ZigZag WaveSize ZigZag WaveSize

Modified standard ZigZag indicator with the addition of information about wavelength in pips, levels and different alerts logic

Adaptive CCI Adaptive CCI

Adaptive CCI - Commodity Channel Index with dynamically adjusting upper and lower limits based on market volatility. Eliminates fixed thresholds (like 100/-100) by using EMA-smoothed peaks and troughs, providing more reliable overbought/oversold signals tailored to each asset's current volatility. Perfect for identifying high-probability reversal points with adaptive confirmation levels.

Simplest CSV file writer Simplest CSV file writer

Provide simplest class to write CSV file

MACD Signals MACD Signals

Indicator edition for new platform.