Spécifications
Inputs being:
- Number of bars to the left of fractal
- Number of bars to the right of fractal
- Number of bars we look back from the current bar (e.g., 30)
- Number of most recent up (or down) fractals we take into account (e.g., 3) in those number of bars (third input)
- Most recent fractals' distance from each other, can be either fixed percentage difference between them or automatic based on another indicator (stdDev or other)
- Draw resistance at highest fractal value OR at high of candle associated with highest fractal value in most recent fractals taken into account (same applies for supports, in reverse)
Let's say we have these inputs:
- 2
- 2
- 30
- 3
- Fixed 0.05%
- Highest fractal value
This means that if in the last 30 bars, the last 3 or more down fractals (with settings 2 left, 2 right) are no more than 0.05% apart from each other, we draw a resistance at fractal value.
Support or resistance needs to be finite when one or more of these conditions are met:
- A new support is formed due to new criteria met; then the old one does not continue but stays historically drawn at the moment it was valid (same goes for resistance, of course).
- Prices went too far from the support or resistance. This criterion is important because we aim to find weak support and resistance, those being tested again and again in a short amount of time, showing potential explosive move incoming either from breakout or failed breakout. We have to define what and how to implement the "too far" criteria.
They need to be displayed in colored dotted lines, discreet but present.
It will be used in various EAs for catching turning points in the market so it needs to be a non-repainting, robust, and reliable indicator.
*Note:
For input number 5, I am open to suggestions for a way to automatically (via indicator or other) get the appropriate distance from fractals in order for the supports and resistances to be accurate.
The x-bar fractals indicator is provided to you for easier programming.