The point of the code is to get an alert when the mark crosses below the 1.8 standard deviation but it doesn't seem to be working once the alert is added.

Eventually I want to change it a bit more to become a scanner for stocks crossing below the 1.8 standard deviation, but that's once I get this kink worked out.

Code:

```
input price = close;
input deviation2 = 2.0;
input deviation1 = 1.8;
input fullRange = Yes;
input length = 21;
def regression;
def stdDeviation;
if (fullRange) {
regression = InertiaAll(price);
stdDeviation = StDevAll(price);
} else {
regression = InertiaAll(price, length);
stdDeviation = StDevAll(price, length);
}
plot UpperLine = regression + deviation2 * stdDeviation;
plot MiddleLine = regression;
plot LowerLine = regression - deviation2 * stdDeviation;
UpperLine.SetDefaultColor(GetColor(8));
MiddleLine.SetDefaultColor(GetColor(8));
LowerLine.SetDefaultColor(GetColor(8));
def regression1;
def stdDeviation1;
if (fullRange) {
regression1 = InertiaAll(price);
stdDeviation1 = StDevAll(price);
} else {
regression1 = InertiaAll(price, length);
stdDeviation1 = StDevAll(price, length);
}
plot UpperLine1 = regression1 + deviation1 * stdDeviation1;
plot MiddleLine1 = regression1;
plot LowerLine1 = regression1 - deviation1 * stdDeviation1;
Alert(pricetype.mark < UpperLine1, "BEARISH!", Alert.BAR, Sound.Bell);
```