Hi all,
Sorry for being far from this site, these last weeks… I’m very busy, but still happy to trade and post some codes. These times I did prefer manual trading… but this trading is made with the help of custom indicators.
Here is one of these indicators.
As you know, there was already a code of the Fractals of Bill Williams on prorealcode.com.
But I wanted to create this code myself.
And I did add Arrows, so that you can visualize the fractals as if you were on Metatrader for example.
On the picture, you can see :
- the support / resistance levels (in blue, but you can change the colors)
- the fractals themselves (with arrows)
You can change the period of the fractals.
Best regards,
// Code : Fractales
// www.doctrading.fr
// Visualisation des fractales avec flèches
Arrow = 0
// Nombres de bougies constituant la fractale (impair)
Ncandles = 5
// Nombres de bougies de chaque côté de la bougie extrême
Nside = (Ncandles - 1) / 2
// Définition de la fractale supérieure
IF high[Nside] >= highest[Ncandles](high) THEN
Fup = high[Nside]
Arrow = -1
ENDIF
// Définition de la fractale inférieure
IF low[Nside] <= lowest[Ncandles](low) THEN
Fdown = low[Nside]
Arrow = 1
ENDIF
// Tracé des flèches
IF Arrow = 1 THEN
DRAWARROWUP(barindex[2],low[2]-Averagetruerange[5]/3)coloured(0,150,0)
ELSIF Arrow = -1 THEN
DRAWARROWDOWN(barindex[2],high[2]+Averagetruerange[5]/3)coloured(255,0,0)
ENDIF
Return Fup as "Fractale UP", Fdown as "Fractale DOWN"
Hi Doc, thanks for sharing your code.
While reviewing it for the library, I stumble upon the bug of multiple arrows like in the picture attached, I don’t know if you are aware of it?
The fractals with same design as MT4 has been coded in this topic already FYI: https://www.prorealcode.com/topic/indicateurs-bill-williams/#post-20690
Hello Nicolas,
Actually I did test only on daily candles ; I didn’t see this bug…
Sorry, I didn’t see that this indicator was already coded here !
Best regards,
Strange, actually I have a but with fractals of 3 candles, but non with fractals of 5 candles…
Hi Nicolas,
Is there an updated Fractals indicator that works with 10.3 with dots rather that arrows ?
Kind Regards
Tom
You can try this one: https://www.prorealcode.com/topic/indicateurs-bill-williams/#post-20690
You can change the symbol used to plot the fractals by something else if you want to.