IFS Fern Color
This EA renders a Barnsley Fern fractal using the Iterated Function System (IFS) algorithm onto a BMP image displayed on the MetaTrader 5 chart. It uses a virtual screen with a color palette to produce a heatmap-style visualization where pixel color intensity reflects how many times each point was visited. Clicking the fern image zooms in by increasing the scale coefficient by 10% each time.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
Not backtested yet — this EA could not be converted automatically.
Strategy analysis
This is not a trading EA but a mathematical visualization tool based on the Iterated Function System (IFS). It generates a fractal pattern using the 4 affine transformation coefficients of the Barnsley Fern, each with different probability weights (1%, 85%, 7%, 7%). The algorithm starts from the origin and iterates, randomly selecting an affine transformation based on cumulative probabilities to compute new coordinates, drawing points onto an 800x800 virtual screen after over 100,000 iterations. Each pixel on the virtual screen records its visit count, which is then mapped to RGB colors through a 23-color palette to produce a heatmap effect. Users can interactively zoom by clicking the fern image on the chart, with each click increasing the scale coefficient by 10%. This EA has no trading logic, position management, or risk control whatsoever.
Strengths
- Accurately renders the Barnsley Fern fractal using the mathematically rigorous IFS algorithm
- Implements a heatmap palette based on visit counts for rich visual output
- Supports interactive zoom - users can click to enlarge and see fractal detail
- Clean code structure with the CIFS class encapsulating IFS logic using OOP
Weaknesses
- Not a trading program - contains no trading signals or strategy logic
- Random number generator uses rand()/32767.0 which has low precision and non-uniform distribution
- Iteration count grows dynamically with scale, potentially causing performance issues at large zoom
- No way to reset zoom - clicking only zooms in, never zooms out
Possible improvements
- Replace rand()/32767.0 with MathRand() or a better RNG method for improved probability distribution quality
- Add zoom reset functionality (e.g., double-click to reset or context menu) for better interactivity
Risk assessment
Overall risk: Safe
- This EA performs no trading operations, so there is no financial risk
- High iteration counts at large zoom levels may cause terminal slowdown
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
currentscale | 50 | Scaling factor controlling fractal display ratio |
x_size (Create) | 800 | BMP image width in pixels |
y_size (Create) | 800 | BMP image height in pixels |
back (Render) | true | Display image as background object |
Similar Utility EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.