# CD_Average Daily Range Zones- highs and lows of the day

จำนวนเข้าชม 5982
5982
Uses daily average ranges of 5 and 10 (most used) as buy (support) and highs (resistance) areas - half ranges used in calculations for a more accurate "forecast" of the H and L . Uses open but not close, so it does not repaint - experimental
```//CD
//Average Daily Range Levels - 10 day

study(title="CD_Average Daily Range Zones", shorttitle="CD_Daily High/Low Zones V01", overlay=true)

//dayHigh=security(tickerid, 'D', high[1])
OPEN=security(tickerid, 'D', open)

//ADR L
dayrange=(high - low)

r1 = security(tickerid, 'D', dayrange[1])
r2 = security(tickerid, 'D', dayrange[2])
r3 = security(tickerid, 'D', dayrange[3])
r4= security(tickerid, 'D', dayrange[4])
r5= security(tickerid, 'D', dayrange[5])
r6 = security(tickerid, 'D', dayrange[6])
r7 = security(tickerid, 'D', dayrange[7])
r8 = security(tickerid, 'D', dayrange[8])
r9= security(tickerid, 'D', dayrange[9])
r10= security(tickerid, 'D', dayrange[10])

adr_10 = (r1+r2+r3+r4+r5+r6+r7+r8+r9+r10) /10
adr_9 = (r1+r2+r3+r4+r5+r6+r7+r8+r9) /9
adr_8 = (r1+r2+r3+r4+r5+r6+r7+r8) /8
adr_7 = (r1+r2+r3+r4+r5+r6+r7) /7
adr_6 = (r1+r2+r3+r4+r5+r6) /6
adr_5 = (r1+r2+r3+r4+r5) /5
adr_4 = (r1+r2+r3+r4) /4
adr_3 = (r1+r2+r3) /3
adr_2= (r1+r2)/2
adr_1 = r1

//plot
adrhigh10=plot((OPEN+(adr_10/2)) , title="ADR High10",style=circles,color=red,linewidth=2)
adrlow10=plot((OPEN-(adr_10/2)), title="ADR LOW10",style=circles, color=green,linewidth=2)
//adrhigh9=plot((OPEN+(adr_9/2)) , title="ADR High9",style=circles,color=red,linewidth=2)
//adrlow9=plot((OPEN-(adr_9/2)), title="ADR LOW9",style=circles, color=green,linewidth=2)
//adrhigh8=plot((OPEN+(adr_8/2)) , title="ADR High8",style=circles,color=red,linewidth=2)
//adrlow8=plot((OPEN-(adr_8/2)), title="ADR LOW8",style=circles, color=green,linewidth=2)
//adrhigh7=plot((OPEN+(adr_7/2)) , title="ADR High7",style=circles,color=red,linewidth=2)
//adrlow7=plot((OPEN-(adr_7/2)), title="ADR LOW7",style=circles, color=green,linewidth=2)
//adrhigh6=plot((OPEN+(adr_6/2)) , title="ADR High6",style=circles,color=red,linewidth=2)
//adrlow6=plot((OPEN-(adr_6/2)), title="ADR LOW6",style=circles, color=green,linewidth=2)
adrhigh5=plot((OPEN+(adr_5/2)) , title="ADR High5",style=circles,color=red,linewidth=2)
adrlow5=plot((OPEN-(adr_5/2)), title="ADR LOW5",style=circles, color=green,linewidth=2)
//adrhigh4=plot((OPEN+(adr_4/2)) , title="ADR High4",style=circles,color=red,linewidth=2)
//adrlow4=plot((OPEN-(adr_4/2)), title="ADR LOW4",style=circles, color=green,linewidth=2)
//adrhigh3=plot((OPEN+(adr_3/2)) , title="ADR High3",style=circles,color=red,linewidth=2)
//adrlow3=plot((OPEN-(adr_3/2)), title="ADR LOW3",style=circles, color=green,linewidth=2)
//adrhigh2=plot((OPEN+(adr_2/2)) , title="ADR High2",style=circles,color=red,linewidth=2)
//adrlow2=plot((OPEN-(adr_2/2)), title="ADR LOW2",style=circles, color=green,linewidth=2)
//adrhigh1=plot((OPEN+(adr_1/2)) , title="ADR High1",style=circles,color=red,linewidth=2)
//adrlow1=plot((OPEN-(adr_1/2)), title="ADR LOW1",style=circles, color=green,linewidth=2)

fill(adrlow10,adrlow5,color=lime)
fill(adrhigh10,adrhigh5,color=maroon)
//fill(adrlow2,adrlow9,color=lime)
//fill(adrhigh2,adrhigh9,color=maroon)
//fill(adrlow3,adrlow8,color=lime)
//fill(adrhigh3,adrhigh8,color=maroon)
//fill(adrlow4,adrlow7,color=lime)
//fill(adrhigh4,adrhigh7,color=maroon)
//fill(adrlow6,adrlow2,color=lime)
//fill(adrhigh6,adrhigh2,color=maroon)
```
@CD_CD Thanks for gifting,
I wanted to know detailed calculation ,need to be created scanner, when touches High low ,pls its humble request,
ตอบกลับ
would you be able to assist with script for weekly and monthly???
ตอบกลับ
Is this script good for Forex or only for stock indicies?
ตอบกลับ
It it possible to get this made for MT4?
ตอบกลับ
Will it be modified in 12-hour increments? Thank you
ตอบกลับ
@cristian.d I have to say, I've had this script on my chart now for the last 4+ weeks, and probably 75% (or even more) or the days, those highs/lows are perfect buy/sell points. I have been using on S&P 500 (SPX).

Question - If the index gaps up more than normal for example 5 points on S&P, does the script take that gap into account for the current day that I'm trading? Or would you recommend taking more caution with the ranges that the script gives, if the morning gap isn't your typical morning gap?

I haven't tracked whether it's more or less accurate on "gap days", but just wondering.

Now the only thing I need to know is which zone is it heading for first in the morning :-)
ตอบกลับ
stockspy
@cristian.d also for days when it breaks out above or below a range, very often it comes right back down to that range after it's done breaking out, to either test it again or even close at the range.
ตอบกลับ
stockspy
@stockspy, it takes the open into account so I guess the gap as well; when it breaks above I tend to let it go for the day or use some support/resistance levels to time any entry
ตอบกลับ
cristian.d
@cristian.d, Great, thanks. It seems to work quite often. I am just guessing, 75% of the time it seems to work :-). Here's example of today.

Thanks again!
ตอบกลับ
stockspy
@stockspy, I am glad it's helping you! If this indicator which is based on averages works on an instrument, then must be an ETF like SPX because these are more news free and the machines are working full throtle :) GL
ตอบกลับ