#Ищет базу, на уровнях 10-20-30 и так далее #Cнять галочку Include Extended Session #www.nyser.ru © def iDiff = 0.01; #максимальное отклонение в центах def iBars = 4; #число баров для просмотра def iLowest = lowest(low,iBars); def iHighest = highest(high,iBars); def bBaseLow = fold Lbar = 0 to iBars with Lsumm=1 do if ((low[Lbar]-iLowest)<=iDiff) then Lsumm*1 else Lsumm*0; def bBaseHigh = fold Hbar = 0 to iBars with Hsumm=1 do if ((iHighest-high[Hbar])<=iDiff) then Hsumm*1 else Hsumm*0; def iLevelLow = fold LLbar = 0 to iBars with LLsumm do if (low[LLbar] == roundDown(low[LLbar],1)) then LLsumm+1 else LLsumm; def iLevelHigh = fold LHbar = 0 to iBars with LHsumm do if (high[LHbar] == roundUp(High[LHbar],1)) then LHsumm+1 else LHsumm; plot bBase = if (bBaseLow and iLevelLow ) then 1 else if (bBaseHigh and iLevelHigh ) then 2 else 100; AssignBackgroundColor (if (bBase == 1) then Color.LIGHT_GREEN else if (bBase == 2) then Color.LIGHT_RED else Color.black);