There is no explanation on how are found the range zones. However I think it might be something like X candles haven’t moved more than Y points either up or down. Or a BB squeeze (BollingerBands inside Keltner Bands)?
Hi Nicolas,
Thanks for your quick response!
No, indeed, and I can’t find that explanation anywhere.
Your first option seems best to me. An adjustable number of bars, and could it be an adjustable percentage up or down? Then it is more universally applicable for multiple indices, currencies, etc. Can that be programmed?
Please find below a draft of that code with settings to change according to the instrument/timeframe:
percent = 0.3 //percent to find the zones
period = 10 //period of hh-ll boxes
minBar = 3 //minimal bar for the boxes
hh=highest[period](high)
ll=lowest[period](low)
irange = (hh-ll)/ll*100
if irange crosses under percent then
startbar=barindex
starthh=hh
startll=ll
endif
if irange<=percent and barindex-startbar>=minBar and startbar>0 then
drawrectangle(startbar,startll,barindex,starthh) coloured(168,168,168) bordercolor(168,168,168,0) style(dottedline)
endif
if close crosses over starthh or close crosses under startll then
startbar=0
endif
return //irange
Hi guys,
I’m probably way too premature and I know you guys are getting a lot more requests.
But could you see if my setup can be programmed?
I would really appreciate it.
On 28/8 I had reported a bug in the Bressert scalper improved in another topic as well.
Should something be changed here or can I change something myself?
Thanks in advance
I think that this code is in line with your query, let me know.
Regarding the Bressert Scalper, I will answer you asap.
percent = 0.3 //max percent deviation
period = 20 //period of lookback
minBar = 3 //minimal bar for the boxes
count=0
hh=0
ll=close*10
for i = period-1 downto 0 do
dev=abs(close[i+1]-close[i])/close[i+1]
if dev<=percent/100 then
//drawarrow(barindex[i],close[i])
count=count+1
hh=max(hh,high[i])
ll=min(ll,low[i])
if count=1 then
startbar=barindex[i]
else
endbar=barindex[i]
endif
else
break
endif
next
if count>=minbar then
drawrectangle(startbar,ll,endbar,hh)
endif
return //(close-close[1])/close,percent/100,count,high<hh and low>ll,dev