麻烦老师写个箱体判断的代码

如果连续14根K线的最高价和最低价介于(14根中最后一根K线(即最新K线)的收盘价 ± 1.5×ATR(14))之间,构成箱体。并在K线图上绘制出箱体。请老师写个代码,谢

谢谢老师

Params Numeric Length(14); Numeric ATRMult(1.5); Vars NumericSeries ATR; Numeric UpBand; Numeric LowBand; BoolSeries Condition; Numeric i; Events onBar(ArrayRef<Integer> indexs) { ATR = AvgTrueRange(Length); If (CurrentBar >= Length) { UpBand = Close + ATRMult * ATR; LowBand = Close - ATRMult * ATR; } }