Please find below the code for the Bill Williams Fractals indicator (found on the web from the SOHOCOOL website);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/////////// FRACTALS DE BILL WILLIAMS
//Varible = cp - par défaut =2
if high [ cp] >= highest [ 2 * cp+ 1 ] (high ) then
LH = 1
else
LH= 0
endif
if low [ cp] <= lowest [ 2 * cp+ 1 ] (low ) then
LL= - 1
else
LL= 0
endif
if LH= 1 then
hil = high [ cp]
endif
if LL = - 1 then
LOL= low [ cp]
endif
return lol coloured (255 ,0 ,0 ) as "bas" ,hil coloured (0 ,255 ,0 ) as "haut"
/////////////fin
You have to set the variables on points mode for a clearer view of the fractals points on the price chart. (see picture attached).
I’ll add this indicator to the library since it’s a common request.