bill williams fractal code

elrois

Newbie
Messages
2
Likes
0
If someone could please help me with this code I got for Bill Williams fractals (prorealtime). I don't know what [PC] should be? The variables can be 2,or 5. When I tried to put it on my price chart, it shorten all the candlesticks. I would appreciate any help. Thanks

//CP=variables -default=2
if high[PC]>=highest[2*CP+1](high) then
LH=1
else
LH=0
endif

if low[PC]<=lowest[2*CP+1](low)then
LL=-1
else
LL=0
endif

if LH=1 then
HiL=high[CP]
endif
if LL=-1then
LoL=low[CP]
endif

LoL coloured return(255,0,0) as "low" coloured HiL(0,255,0) as "high"
////////////end
 
REM// CP = 5 , PC = 5 in Variables on EOD price Daily Charts
REM// Hope you get it to work, It makes for a similar indicator to a Donchian Channel

if high[PC]>=highest[2*CP+1](high) then
LH=1
else
LH=0
endif

if low[PC]<=lowest[2*CP+1](low)then
LL=-1
else
LL=0
endif

if LH=1 then
HiL=high[CP]
endif

if LL=-1then
LoL=low[CP]
endif

Return LoL coloured (255,0,0) as "low" , HiL coloured (0,255,0) as "high"

// END


try this
 
Top