#Показывает расстояние до сегодняшних Hi или Low (смотря что ближе) #www.nyser.ru © def iHighDay = high(period = "DAY")[0]; def iLowDay = Low(period = "DAY")[0]; def iDiffLow = close - iLowDay; def iDiffHigh = iHighDay - close; def bDiff = if (iDiffHigh <= iDiffLow) then 1 else if (iDiffHigh >= iDiffLow) then 2 else 100; plot iDiff = if bDiff == 1 then iDiffHigh else if bDiff == 2 then -iDiffLow else 100; AssignBackgroundColor (if bDiff == 1 then Color.LIGHT_GREEN else if bDiff == 2 then Color.LIGHT_RED else Color.current); iDiff.AssignValueColor (if bDiff == 1 or bDiff == 2 then Color.bLACK else Color.current);