DEFPARAM DrawOnLastBarOnly = true
H1 = highest[26](high[26])
Bar1 = BarIndex[51]
FOR i = 51 DOWNTO 26
IF high[i] = H1 THEN
Bar1 = BarIndex[i]
break
ENDIF
NEXT
H2 = highest[26](high)
Bar2 = BarIndex[25]
FOR i = 25 DOWNTO 0
IF high[i] = H2 THEN
Bar2 = BarIndex[i]
break
ENDIF
NEXT
Pdiff = H2 - H1
Bdiff = (Bar2 - Bar1) - 1
Ptemp = Pdiff / Bdiff
Btemp = (BarIndex - Bar2)
H3 = round(H2 + (Ptemp * Btemp),5)
DrawSegment(Bar1,H1,BarIndex+1,H3) style(line,3) coloured("Blue")
//Offset = highest[52](high) + range
//DrawText("Bar1: #Bar1#",BarIndex,Offset)
//DrawText("Bar2: #Bar2#",BarIndex,Offset * 1.005)
//DrawText("Bdiff: #Bdiff#",BarIndex,Offset * 1.010)
//DrawText("H1: #H1#",BarIndex,Offset * 1.015)
//DrawText("H2: #H2#",BarIndex,Offset * 1.020)
//DrawText("Pdiff: #Pdiff#",BarIndex,Offset * 1.025)
//DrawText("H3: #H3#",BarIndex,Offset * 1.030)
RETURN