Last Two Highest High and Lowest Low Lines - Yearly Quarterly, Monthly, Weekly, Daily, 4 Hour and 1 Hour

Category: Indicators By: Vonasi Created: April 11, 2019, 11:48 AM
April 11, 2019, 11:48 AM
Indicators
14 Comments

At the start of a new period this indicator draws lines connecting the previous two periods highest highs and previous two lowest lows. It then projects these lines forward throughout the latest period.

It can find the last two yearly, quarterly, monthly, weekly, daily, 4 hourly and 1 hourly highest highs and lowest lows and draw lines connecting them and projected forward until the start of a new year, quarter, month, week, day, 4 hour period, 1 hour period when new lines are drawn.

You can turn on or off the lines connecting the highs and lows and also turn off the projected lines using the settings ‘Lines’ and ProjectedLines’.

The indicator can be used on any time frame chart but if there is not enough data to provide two HH or two LL then it won’t draw any lines for that time period. You can only draw slower time frame lines on a faster time frame chart so for example you obviously cannot draw H1 lines a daily chart

For daily calculations Sunday candles are included in Fridays data so the projected lines on a Monday are from the Thursday daily HH and daily LL and the daily HH and daily LL of Friday and Sunday combined. Weeks start at the open of the Sunday candle.

Each line is labelled at its end. If projected lines are shown then the label is at the end of the projected line if not then it is at the end of the line connecting HH’s and LL’s. Because it is not possible to draw something and then delete it there are no labels on the last  projected lines shown on the chart. To overcome this issue you can add my other ‘Last Two Highest High and Lowest Low as Horizontal Lines – Yearly Quarterly, Monthly, Weekly, Daily, 4 Hour and 1 Hour’ indicator to your price chart and turn off the values and lines in that indicator. This will give you up to date labels.

The projected lines can go a little wobbly on very fast time frames which I assume is due to missing candles messing up the barindex value used in the projection calculations.

Apply only to the price chart

The lines can be used as support and resistance or for breakout trading – however you wish.

It will be slow to draw if you want every line drawn on a lot of historical bars.

I suggest downloading and importing the indicator to get full functionality.

//Last Two HH LL Lines
//Coded by Vonasi
//Date 20190411

//Lines = 1
//ProjectedLines = 1
//Y = 0
//Q = 0
//M = 0
//W = 0
//D = 0
//H4 = 0
//H1 = 0


//Year
if y then
once yhi1 = low
once yhi2 = low
once yhiindex1 = barindex
once yhiindex2 = barindex

once ylo1 = high
once ylo2 = high
once yloindex1 = barindex
once yloindex2 = barindex

if high >= yhi1 then
yhi1 = high
yhiindex1 = barindex
endif

if low <= ylo1 then
ylo1 = low
yloindex1 = barindex
endif

if openyear <> openyear[1] then
if projectedlines then
DRAWTEXT("Y", barindex-1, yhiend[2], SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("Y", barindex-1, yloend[2], SansSerif, standard, 10) coloured(128,0,0)
endif

if lines then
drawsegment(yloindex2,ylo2,yloindex1,ylo1) coloured(128,0,0)
drawsegment(yhiindex2,yhi2,yhiindex1,yhi1) coloured(0,128,0)
if not projectedlines then
DRAWTEXT("Y", yhiindex1, yhi1, SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("Y", yloindex1, ylo1, SansSerif, standard, 10) coloured(128,0,0)
endif
endif

yhistart = yhi1
yhistartindex = yhiindex1

if yhi1 >= yhi2 then
yhiadj = (yhi1 - yhi2) / (yhiindex1 - yhiindex2)
yhiend = (yhistart + (yhiadj * (barindex - yhistartindex)))
yhidir = 1
endif

if yhi1 < yhi2 then
yhiadj = (yhi2 - yhi1) / (yhiindex1 - yhiindex2)
yhiend = (yhistart - (yhiadj * (barindex - yhistartindex)))
yhidir = -1
endif

ylostart = ylo1
ylostartindex = yloindex1

if ylo1 >= ylo2 then
yloadj = (ylo1 - ylo2) / (yloindex1 - yloindex2)
yloend = (ylostart + (yloadj * (barindex - ylostartindex)))
ylodir = 1
endif

if ylo1 < ylo2 then
yloadj = (ylo2 - ylo1) / (yloindex1 - yloindex2)
yloend = (ylostart - (yloadj * (barindex - ylostartindex)))
ylodir = -1
endif

yhi2 = yhi1
yhiindex2 = yhiindex1
yhi1 = low
yhiindex1 = barindex
ylo2 = ylo1
yloindex2 = yloindex1
ylo1 = high
yhiindex1 = barindex
endif

if projectedlines then
if yhidir = 1 then
drawsegment(yhistartindex,yhistart,barindex,yhiend) coloured (0,128,0)
yhistartindex = barindex
yhistart = yhiend
yhiend = (yhistart + (yhiadj * ((barindex+1) - yhistartindex)))
endif

if yhidir = -1 then
drawsegment(yhistartindex,yhistart,barindex,yhiend) coloured (0,128,0)
yhistartindex = barindex
yhistart = yhiend
yhiend = (yhistart - (yhiadj * ((barindex+1) - yhistartindex)))
endif

if ylodir = 1 then
drawsegment(ylostartindex,ylostart,barindex,yloend) coloured (128,0,0)
ylostartindex = barindex
ylostart = yloend
yloend = (ylostart + (yloadj * ((barindex+1) - ylostartindex)))
endif

if ylodir = -1 then
drawsegment(ylostartindex,ylostart,barindex,yloend) coloured (128,0,0)
ylostartindex = barindex
ylostart = yloend
yloend = (ylostart - (yloadj * ((barindex+1) - ylostartindex)))
endif
endif
endif


//Quarter
if q then
once qhi1 = low
once qhi2 = low
once qhiindex1 = barindex
once qhiindex2 = barindex

once qlo1 = high
once qlo2 = high
once qloindex1 = barindex
once qloindex2 = barindex

if high >= qhi1 then
qhi1 = high
qhiindex1 = barindex
endif

if low <= qlo1 then
qlo1 = low
qloindex1 = barindex
endif

if openmonth <> openmonth[1] and (openmonth = 1 or openmonth = 4 or openmonth = 7 or openmonth = 10) then
if projectedlines then
DRAWTEXT("Q", barindex-1, qhiend[2], SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("Q", barindex-1, qloend[2], SansSerif, standard, 10) coloured(128,0,0)
endif

if lines then
drawsegment(qloindex2,qlo2,qloindex1,qlo1) coloured(128,0,0)
drawsegment(qhiindex2,qhi2,qhiindex1,qhi1) coloured(0,128,0)
if not projectedlines then
DRAWTEXT("Q", qhiindex1, qhi1, SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("Q", qloindex1, qlo1, SansSerif, standard, 10) coloured(128,0,0)
endif
endif

qhistart = qhi1
qhistartindex = qhiindex1

if qhi1 >= qhi2 then
qhiadj = (qhi1 - qhi2) / (qhiindex1 - qhiindex2)
qhiend = (qhistart + (qhiadj * (barindex - qhistartindex)))
qhidir = 1
endif

if qhi1 < qhi2 then
qhiadj = (qhi2 - qhi1) / (qhiindex1 - qhiindex2)
qhiend = (qhistart - (qhiadj * (barindex - qhistartindex)))
qhidir = -1
endif

qlostart = qlo1
qlostartindex = qloindex1

if qlo1 >= qlo2 then
qloadj = (qlo1 - qlo2) / (qloindex1 - qloindex2)
qloend = (qlostart + (qloadj * (barindex - qlostartindex)))
qlodir = 1
endif

if qlo1 < qlo2 then
qloadj = (qlo2 - qlo1) / (qloindex1 - qloindex2)
qloend = (qlostart - (qloadj * (barindex - qlostartindex)))
qlodir = -1
endif

qhi2 = qhi1
qhiindex2 = qhiindex1
qhi1 = low
qhiindex1 = barindex
qlo2 = qlo1
qloindex2 = qloindex1
qlo1 = high
qhiindex1 = barindex
endif

if projectedlines then
if qhidir = 1 then
drawsegment(qhistartindex,qhistart,barindex,qhiend) coloured (0,128,0)
qhistartindex = barindex
qhistart = qhiend
qhiend = (qhistart + (qhiadj * ((barindex+1) - qhistartindex)))
endif

if qhidir = -1 then
drawsegment(qhistartindex,qhistart,barindex,qhiend) coloured (0,128,0)
qhistartindex = barindex
qhistart = qhiend
qhiend = (qhistart - (qhiadj * ((barindex+1) - qhistartindex)))
endif

if qlodir = 1 then
drawsegment(qlostartindex,qlostart,barindex,qloend) coloured (128,0,0)
qlostartindex = barindex
qlostart = qloend
qloend = (qlostart + (qloadj * ((barindex+1) - qlostartindex)))
endif

if qlodir = -1 then
drawsegment(qlostartindex,qlostart,barindex,qloend) coloured (128,0,0)
qlostartindex = barindex
qlostart = qloend
qloend = (qlostart - (qloadj * ((barindex+1) - qlostartindex)))
endif
endif
endif


//Month
if m then
once mhi1 = low
once mhi2 = low
once mhiindex1 = barindex
once mhiindex2 = barindex

once mlo1 = high
once mlo2 = high
once mloindex1 = barindex
once mloindex2 = barindex

if high >= mhi1 then
mhi1 = high
mhiindex1 = barindex
endif

if low <= mlo1 then
mlo1 = low
mloindex1 = barindex
endif

if openmonth <> openmonth[1] then
if projectedlines then
DRAWTEXT("M", barindex-1, mhiend[2], SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("M", barindex-1, mloend[2], SansSerif, standard, 10) coloured(128,0,0)
endif

if lines then
drawsegment(mloindex2,mlo2,mloindex1,mlo1) coloured(128,0,0)
drawsegment(mhiindex2,mhi2,mhiindex1,mhi1) coloured(0,128,0)
if not projectedlines then
DRAWTEXT("M", mhiindex1, mhi1, SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("M", mloindex1, mlo1, SansSerif, standard, 10) coloured(128,0,0)
endif
endif

mhistart = mhi1
mhistartindex = mhiindex1

if mhi1 >= mhi2 then
mhiadj = (mhi1 - mhi2) / (mhiindex1 - mhiindex2)
mhiend = (mhistart + (mhiadj * (barindex - mhistartindex)))
mhidir = 1
endif

if mhi1 < mhi2 then
mhiadj = (mhi2 - mhi1) / (mhiindex1 - mhiindex2)
mhiend = (mhistart - (mhiadj * (barindex - mhistartindex)))
mhidir = -1
endif

mlostart = mlo1
mlostartindex = mloindex1

if mlo1 >= mlo2 then
mloadj = (mlo1 - mlo2) / (mloindex1 - mloindex2)
mloend = (mlostart + (mloadj * (barindex - mlostartindex)))
mlodir = 1
endif

if mlo1 < mlo2 then
mloadj = (mlo2 - mlo1) / (mloindex1 - mloindex2)
mloend = (mlostart - (mloadj * (barindex - mlostartindex)))
mlodir = -1
endif

mhi2 = mhi1
mhiindex2 = mhiindex1
mhi1 = low
mhiindex1 = barindex
mlo2 = mlo1
mloindex2 = mloindex1
mlo1 = high
mhiindex1 = barindex
endif

if projectedlines then
if mhidir = 1 then
drawsegment(mhistartindex,mhistart,barindex,mhiend) coloured (0,128,0)
mhistartindex = barindex
mhistart = mhiend
mhiend = (mhistart + (mhiadj * ((barindex+1) - mhistartindex)))
endif

if mhidir = -1 then
drawsegment(mhistartindex,mhistart,barindex,mhiend) coloured (0,128,0)
mhistartindex = barindex
mhistart = mhiend
mhiend = (mhistart - (mhiadj * ((barindex+1) - mhistartindex)))
endif

if mlodir = 1 then
drawsegment(mlostartindex,mlostart,barindex,mloend) coloured (128,0,0)
mlostartindex = barindex
mlostart = mloend
mloend = (mlostart + (mloadj * ((barindex+1) - mlostartindex)))
endif

if mlodir = -1 then
drawsegment(mlostartindex,mlostart,barindex,mloend) coloured (128,0,0)
mlostartindex = barindex
mlostart = mloend
mloend = (mlostart - (mloadj * ((barindex+1) - mlostartindex)))
endif
endif
endif


//Week
if w then
once whi1 = low
once whi2 = low
once whiindex1 = barindex
once whiindex2 = barindex

once wlo1 = high
once wlo2 = high
once wloindex1 = barindex
once wloindex2 = barindex

if high >= whi1 then
whi1 = high
whiindex1 = barindex
endif

if low <= wlo1 then
wlo1 = low
wloindex1 = barindex
endif

if opendayofweek < opendayofweek[1] then
if projectedlines then
DRAWTEXT("W", barindex-1, whiend[2], SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("W", barindex-1, wloend[2], SansSerif, standard, 10) coloured(128,0,0)
endif

if lines then
drawsegment(wloindex2,wlo2,wloindex1,wlo1) coloured(128,0,0)
drawsegment(whiindex2,whi2,whiindex1,whi1) coloured(0,128,0)
if not projectedlines then
DRAWTEXT("W", whiindex1, whi1, SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("W", wloindex1, wlo1, SansSerif, standard, 10) coloured(128,0,0)
endif
endif

whistart = whi1
whistartindex = whiindex1

if whi1 >= whi2 then
whiadj = (whi1 - whi2) / (whiindex1 - whiindex2)
whiend = (whistart + (whiadj * (barindex - whistartindex)))
whidir = 1
endif

if whi1 < whi2 then
whiadj = (whi2 - whi1) / (whiindex1 - whiindex2)
whiend = (whistart - (whiadj * (barindex - whistartindex)))
whidir = -1
endif

wlostart = wlo1
wlostartindex = wloindex1

if wlo1 >= wlo2 then
wloadj = (wlo1 - wlo2) / (wloindex1 - wloindex2)
wloend = (wlostart + (wloadj * (barindex - wlostartindex)))
wlodir = 1
endif

if wlo1 < wlo2 then
wloadj = (wlo2 - wlo1) / (wloindex1 - wloindex2)
wloend = (wlostart - (wloadj * (barindex - wlostartindex)))
wlodir = -1
endif

whi2 = whi1
whiindex2 = whiindex1
whi1 = low
whiindex1 = barindex
wlo2 = wlo1
wloindex2 = wloindex1
wlo1 = high
whiindex1 = barindex
endif

if projectedlines then
if whidir = 1 then
drawsegment(whistartindex,whistart,barindex,whiend) coloured (0,128,0)
whistartindex = barindex
whistart = whiend
whiend = (whistart + (whiadj * ((barindex+1) - whistartindex)))
endif

if whidir = -1 then
drawsegment(whistartindex,whistart,barindex,whiend) coloured (0,128,0)
whistartindex = barindex
whistart = whiend
whiend = (whistart - (whiadj * ((barindex+1) - whistartindex)))
endif

if wlodir = 1 then
drawsegment(wlostartindex,wlostart,barindex,wloend) coloured (128,0,0)
wlostartindex = barindex
wlostart = wloend
wloend = (wlostart + (wloadj * ((barindex+1) - wlostartindex)))
endif

if wlodir = -1 then
drawsegment(wlostartindex,wlostart,barindex,wloend) coloured (128,0,0)
wlostartindex = barindex
wlostart = wloend
wloend = (wlostart - (wloadj * ((barindex+1) - wlostartindex)))
endif
endif
endif


//Day
if d then
once dhi1 = low
once dhi2 = low
once dhiindex1 = barindex
once dhiindex2 = barindex

once dlo1 = high
once dlo2 = high
once dloindex1 = barindex
once dloindex2 = barindex

if high >= dhi1 then
dhi1 = high
dhiindex1 = barindex
endif

if low <= dlo1 then
dlo1 = low
dloindex1 = barindex
endif

if openday <> openday[1] and openday[1] <> 7 then
if projectedlines then
DRAWTEXT("D", barindex-1, dhiend[2], SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("D", barindex-1, dloend[2], SansSerif, standard, 10) coloured(128,0,0)
endif

if lines then
drawsegment(dloindex2,dlo2,dloindex1,dlo1) coloured(128,0,0)
drawsegment(dhiindex2,dhi2,dhiindex1,dhi1) coloured(0,128,0)
if not projectedlines then
DRAWTEXT("D", Dhiindex1, Dhi1, SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("D", Dloindex1, Dlo1, SansSerif, standard, 10) coloured(128,0,0)
endif
endif

dhistart = dhi1
dhistartindex = dhiindex1

if dhi1 >= dhi2 then
dhiadj = (dhi1 - dhi2) / (dhiindex1 - dhiindex2)
dhiend = (dhistart + (dhiadj * (barindex - dhistartindex)))
dhidir = 1
endif

if dhi1 < dhi2 then
dhiadj = (dhi2 - dhi1) / (dhiindex1 - dhiindex2)
dhiend = (dhistart - (dhiadj * (barindex - dhistartindex)))
dhidir = -1
endif

dlostart = dlo1
dlostartindex = dloindex1

if dlo1 >= dlo2 then
dloadj = (dlo1 - dlo2) / (dloindex1 - dloindex2)
dloend = (dlostart + (dloadj * (barindex - dlostartindex)))
dlodir = 1
endif

if dlo1 < dlo2 then
dloadj = (dlo2 - dlo1) / (dloindex1 - dloindex2)
dloend = (dlostart - (dloadj * (barindex - dlostartindex)))
dlodir = -1
endif

dhi2 = dhi1
dhiindex2 = dhiindex1
dhi1 = low
dhiindex1 = barindex
dlo2 = dlo1
dloindex2 = dloindex1
dlo1 = high
dhiindex1 = barindex
endif

if projectedlines then
if dhidir = 1 then
drawsegment(dhistartindex,dhistart,barindex,dhiend) coloured (0,128,0)
dhistartindex = barindex
dhistart = dhiend
dhiend = (dhistart + (dhiadj * ((barindex+1) - dhistartindex)))
endif

if dhidir = -1 then
drawsegment(dhistartindex,dhistart,barindex,dhiend) coloured (0,128,0)
dhistartindex = barindex
dhistart = dhiend
dhiend = (dhistart - (dhiadj * ((barindex+1) - dhistartindex)))
endif

if dlodir = 1 then
drawsegment(dlostartindex,dlostart,barindex,dloend) coloured (128,0,0)
dlostartindex = barindex
dlostart = dloend
dloend = (dlostart + (dloadj * ((barindex+1) - dlostartindex)))
endif

if dlodir = -1 then
drawsegment(dlostartindex,dlostart,barindex,dloend) coloured (128,0,0)
dlostartindex = barindex
dlostart = dloend
dloend = (dlostart - (dloadj * ((barindex+1) - dlostartindex)))
endif
endif
endif


//4 Hour
if h4 then
once h4hi1 = low
once h4hi2 = low
once h4hiindex1 = barindex
once h4hiindex2 = barindex

once h4lo1 = high
once h4lo2 = high
once h4loindex1 = barindex
once h4loindex2 = barindex

if high >= h4hi1 then
h4hi1 = high
h4hiindex1 = barindex
endif

if low <= h4lo1 then
h4lo1 = low
h4loindex1 = barindex
endif

if openhour <> openhour[1] and (openhour = 1 or openhour = 5 or openhour = 9 or openhour = 13 or openhour = 17 or openhour = 21) then
if projectedlines then
DRAWTEXT("H4", barindex-1, h4hiend[2], SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("H4", barindex-1, h4loend[2], SansSerif, standard, 10) coloured(128,0,0)
endif

if lines then
drawsegment(h4loindex2,h4lo2,h4loindex1,h4lo1) coloured(128,0,0)
drawsegment(h4hiindex2,h4hi2,h4hiindex1,h4hi1) coloured(0,128,0)
if not projectedlines then
DRAWTEXT("H4", h4hiindex1, h4hi1, SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("H4", h4loindex1, h4lo1, SansSerif, standard, 10) coloured(128,0,0)
endif
endif

h4histart = h4hi1
h4histartindex = h4hiindex1

if h4hi1 >= h4hi2 then
h4hiadj = (h4hi1 - h4hi2) / (h4hiindex1 - h4hiindex2)
h4hiend = (h4histart + (h4hiadj * (barindex - h4histartindex)))
h4hidir = 1
endif

if h4hi1 < h4hi2 then
h4hiadj = (h4hi2 - h4hi1) / (h4hiindex1 - h4hiindex2)
h4hiend = (h4histart - (h4hiadj * (barindex - h4histartindex)))
h4hidir = -1
endif

h4lostart = h4lo1
h4lostartindex = h4loindex1

if h4lo1 >= h4lo2 then
h4loadj = (h4lo1 - h4lo2) / (h4loindex1 - h4loindex2)
h4loend = (h4lostart + (h4loadj * (barindex - h4lostartindex)))
h4lodir = 1
endif

if h4lo1 < h4lo2 then
h4loadj = (h4lo2 - h4lo1) / (h4loindex1 - h4loindex2)
h4loend = (h4lostart - (h4loadj * (barindex - h4lostartindex)))
h4lodir = -1
endif

h4hi2 = h4hi1
h4hiindex2 = h4hiindex1
h4hi1 = low
h4hiindex1 = barindex
h4lo2 = h4lo1
h4loindex2 = h4loindex1
h4lo1 = high
h4hiindex1 = barindex
endif

if projectedlines then
if h4hidir = 1 then
drawsegment(h4histartindex,h4histart,barindex,h4hiend) coloured (0,128,0)
h4histartindex = barindex
h4histart = h4hiend
h4hiend = (h4histart + (h4hiadj * ((barindex+1) - h4histartindex)))
endif

if h4hidir = -1 then
drawsegment(h4histartindex,h4histart,barindex,h4hiend) coloured (0,128,0)
h4histartindex = barindex
h4histart = h4hiend
h4hiend = (h4histart - (h4hiadj * ((barindex+1) - h4histartindex)))
endif

if h4lodir = 1 then
drawsegment(h4lostartindex,h4lostart,barindex,h4loend) coloured (128,0,0)
h4lostartindex = barindex
h4lostart = h4loend
h4loend = (h4lostart + (h4loadj * ((barindex+1) - h4lostartindex)))
endif

if h4lodir = -1 then
drawsegment(h4lostartindex,h4lostart,barindex,h4loend) coloured (128,0,0)
h4lostartindex = barindex
h4lostart = h4loend
h4loend = (h4lostart - (h4loadj * ((barindex+1) - h4lostartindex)))
endif
endif
endif


//1 Hour
if h1 then
once h1hi1 = low
once h1hi2 = low
once h1hiindex1 = barindex
once h1hiindex2 = barindex

once h1lo1 = high
once h1lo2 = high
once h1loindex1 = barindex
once h1loindex2 = barindex

if high >= h1hi1 then
h1hi1 = high
h1hiindex1 = barindex
endif

if low <= h1lo1 then
h1lo1 = low
h1loindex1 = barindex
endif

if openhour <> openhour[1] then
if projectedlines then
DRAWTEXT("H1", barindex-1, h1hiend[2], SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("H1", barindex-1, h1loend[2], SansSerif, standard, 10) coloured(128,0,0)
endif

if lines then
drawsegment(h1loindex2,h1lo2,h1loindex1,h1lo1) coloured(128,0,0)
drawsegment(h1hiindex2,h1hi2,h1hiindex1,h1hi1) coloured(0,128,0)
if not projectedlines then
DRAWTEXT("H1", h1hiindex1, h1hi1, SansSerif, standard, 10) coloured(0,128,0)
DRAWTEXT("H1", h1loindex1, h1lo1, SansSerif, standard, 10) coloured(128,0,0)
endif
endif

h1histart = h1hi1
h1histartindex = h1hiindex1

if h1hi1 >= h1hi2 then
h1hiadj = (h1hi1 - h1hi2) / (h1hiindex1 - h1hiindex2)
h1hiend = (h1histart + (h1hiadj * (barindex - h1histartindex)))
h1hidir = 1
endif

if h1hi1 < h1hi2 then
h1hiadj = (h1hi2 - h1hi1) / (h1hiindex1 - h1hiindex2)
h1hiend = (h1histart - (h1hiadj * (barindex - h1histartindex)))
h1hidir = -1
endif

h1lostart = h1lo1
h1lostartindex = h1loindex1

if h1lo1 >= h1lo2 then
h1loadj = (h1lo1 - h1lo2) / (h1loindex1 - h1loindex2)
h1loend = (h1lostart + (h1loadj * (barindex - h1lostartindex)))
h1lodir = 1
endif

if h1lo1 < h1lo2 then
h1loadj = (h1lo2 - h1lo1) / (h1loindex1 - h1loindex2)
h1loend = (h1lostart - (h1loadj * (barindex - h1lostartindex)))
h1lodir = -1
endif

h1hi2 = h1hi1
h1hiindex2 = h1hiindex1
h1hi1 = low
h1hiindex1 = barindex
h1lo2 = h1lo1
h1loindex2 = h1loindex1
h1lo1 = high
h1hiindex1 = barindex
endif

if projectedlines then
if h1hidir = 1 then
drawsegment(h1histartindex,h1histart,barindex,h1hiend) coloured (0,128,0)
h1histartindex = barindex
h1histart = h1hiend
h1hiend = (h1histart + (h1hiadj * ((barindex+1) - h1histartindex)))
endif

if h1hidir = -1 then
drawsegment(h1histartindex,h1histart,barindex,h1hiend) coloured (0,128,0)
h1histartindex = barindex
h1histart = h1hiend
h1hiend = (h1histart - (h1hiadj * ((barindex+1) - h1histartindex)))
endif

if h1lodir = 1 then
drawsegment(h1lostartindex,h1lostart,barindex,h1loend) coloured (128,0,0)
h1lostartindex = barindex
h1lostart = h1loend
h1loend = (h1lostart + (h1loadj * ((barindex+1) - h1lostartindex)))
endif

if h1lodir = -1 then
drawsegment(h1lostartindex,h1lostart,barindex,h1loend) coloured (128,0,0)
h1lostartindex = barindex
h1lostart = h1loend
h1loend = (h1lostart - (h1loadj * ((barindex+1) - h1lostartindex)))
endif
endif
endif

return

Download
Filename: Last-Two-HH-LL-Lines-v1.1.itf
Downloads: 424
Vonasi Master
V-oyaging ON A S-mall I-ncome
Author’s Profile

Comments

Logo Logo
Loading...