#Скрипт ищет только что пробитые базы из 4 последних свечей, на уровнях 50 и 100 центов. #Cнять галочку Include Extended Session #www.nyser.ru © def iDiff = 0.01; # задайте максимальное отклонение для базы в центах def iDiff2 = 0.40; # задайте максимальное отклонение для пробития в центах def iLowest = lowest(low[1],4); def iHighest = highest(high[1],4); def iLow0 = low[0]; def iLow1 = low[1]; def iLow2 = low[2]; def iLow3 = low[3]; def iLow4 = low[4]; def iHigh0 = high[0]; def iHigh1 = high[1]; def iHigh2 = high[2]; def iHigh3 = high[3]; def iHigh4 = high[4]; def bBaseLow = if ((iLow4-iLowest)<=iDiff) and ((iLow1-iLowest)<=iDiff) and ((iLow2-iLowest)<=iDiff) and ((iLow3-iLowest)<=iDiff) then 1 else 0; def bBaseHigh = if ((iHighest-iHigh4)<=iDiff) and ((iHighest-iHigh1)<=iDiff) and ((iHighest-iHigh2)<=iDiff) and ((iHighest-iHigh3)<=iDiff) then 1 else 0; def bFigureLow = if (iLow1 == (Floor(iLow1*2))/2) or (iLow2 == (Floor(iLow2*2))/2) or (iLow3 == (Floor(iLow3*2))/2) or (iLow4 == (Floor(iLow4*2))/2) then 1 else 0; def bFigureHigh = if (iHigh1 == (Ceil(iHigh1*2))/2) or (iHigh2 == (Ceil(iHigh2*2))/2) or (iHigh3 == (Ceil(iHigh3*2))/2) or (iHigh4 == (Ceil(iHigh4*2))/2) then 1 else 0; def bBreakoutLow = if ((iLowest - close) <= iDiff2 and (iLowest - close) >0 ) then 1 else 0; def bBreakoutHigh = if ((close - iHighest) <= iDiff2 and (close - iHighest)>0) then 1 else 0; plot bBase = if (bBaseLow and bFigureLow and bBreakoutLow) then 1 else if (bBaseHigh and bFigureHigh and bBreakoutHigh) then 2 else 100; AssignBackgroundColor (if (bBase == 2) then Color.LIGHT_GREEN else if (bBase == 1) then Color.LIGHT_RED else Color.black); bBase.AssignValueColor (if (bBase == 100) then Color.white else Color.black);