Hi Nicolas.. i have tried hard to add these point distance… please can you check what im doing wrong.. it doesn’t do anything???
defparam drawonlastbaronly=true
// --- parameters
ATRperiod = 14
// ---
dTR = 0
for i = 0 to ATRperiod
dTR=dTR+max(abs(Dhigh(i)-Dlow(i)),max(abs(Dhigh(i)-Dclose(i+1)),abs(Dlow(i)-Dclose(i+1))))
next
avg = dTR/ATRperiod
converted = round(avg/pointsize*10)/10
htr = Dlow(0)+avg[1]
ltr = Dhigh(0)-avg[1]
if intradaybarindex=0 then
begin=barindex
endif
// --- parameters
//EP = 20
// ---
drawsegment(begin,htr,barindex,htr) coloured(200,100,0)
drawsegment(begin,htr-20*pointsize,barindex,htr-20*pointsize) coloured(255,0,0) //EP
drawtext("#htr# - (D1atr: #converted#)",barindex,htr+10*pointsize,Dialog,Bold,10) coloured(200,100,0)
drawsegment(begin,ltr,barindex,ltr) coloured(200,100,0)
drawsegment(begin,ltr+20*pointsize,barindex,ltr+20*pointsize) coloured(0,255,0)//EP
drawtext("#ltr# - (D1atr: #converted#)",barindex,ltr-10*pointsize,Dialog,Bold,10) coloured(200,100,0)
drawsegment(begin,Dopen(0),barindex,Dopen(0)) coloured(255,250,250)
return