//--------------------Paramettre de Base
//Paramettre de Cadrage
if close > open then
signalC = 1
else
signalC = 0
endif
if signalC = 1 then
drawcandle(1.5,1.5,1.5,1.5)coloured(0,0,0,0)
endif
if signalC = 0 then
drawcandle(0.5,0.5,0.5,0.5)coloured(0,0,0,0)
endif
if (barindex*5) > 1*5 then
HAClose = (open+high+low+close)/4
HAOpen = (HAOpen[1] + HAClose[1])/2
HAHigh = MAX(high,MAX(HAOpen,HAClose))
HALow = MIN(low,MIN(HAOpen,HAClose))
HAatr1 = abs(HAHigh - HAClose[1])
HAatr2 = abs(HAClose[1] - HALow)
HAatr3 = abs(HAHigh - HALow)
HAatr = max(HAatr1, max(HAatr2,HAatr3))
endif
NormalupperBB = average[20](close) + 2*Std[20](close)
NormallowerBB = average[20](close) - 2*Std[20](close)
OptiupperBB = average[20](HAclose) + 2*Std[20](HAclose)
OptilowerBB = average[20](HAclose) - 2*Std[20](HAclose)
NormalupperKC = average[16](close) + average[16](AverageTrueRange[16])*1.4
NormallowerKC = average[16](close) - average[16](AverageTrueRange[16])*1.4
OptiupperKC = average[16](HAclose) + average[16](HAatr[16])*1.4
OptilowerKC = average[16](HAclose) - average[16](HAatr[16])*1.4
NormalsqzOn = (NormallowerBB > NormallowerKC) AND (NormalupperBB < NormalupperKC)
NormalsqzOff = (NormallowerBB < NormallowerKC) AND (NormalupperBB > NormalupperKC)
NormalnoSqz = (NOT NormalsqzOn) AND (NOT NormalsqzOff)
OptisqzOn = (OptilowerBB > OptilowerKC) AND (OptiupperBB < OptiupperKC)
OptisqzOff = (OptilowerBB < OptilowerKC) AND (OptiupperBB > OptiupperKC)
OptinoSqz = (NOT OptisqzOn) AND (NOT OptisqzOff)
if NormalnoSqz or NormalsqzOn then
if OptisqzOff or OptinoSqz then
elsif OptisqzOn or OptisqzOff then
endif
DRAWTEXT("•",barindex,1,monospaced,standard,11) coloured(200,27,27)
endif
if NormalsqzOff then
if OptinoSqz then
elsif OptisqzOn then
endif
DRAWTEXT("•",barindex,1,monospaced,standard,11) coloured(27,200,35)
endif
return