supertrend(factor, atrlen, _id, _tf) {
        let id = this._tsid(_id, `supertrend(${factor},${atrlen})`)
        let tfs = _tf || ''
        let high = this.env.shared[`high${tfs}`]
        let low = this.env.shared[`low${tfs}`]
        let close = this.env.shared[`close${tfs}`]
        let hl2 = (high[0] + low[0]) * 0.5

        let atr = factor * this.atr(atrlen, id+'1', _tf)[0]

        let ls = this.ts(hl2 - atr, id+'2', _tf)
        let ls1 = this.nz(ls[1], ls[0])
        ls[0] = close[1] > ls1 ? Math.max(ls[0], ls1) : ls[0]

        let ss = this.ts(hl2 + atr, id+'3', _tf)
        let ss1 = this.nz(ss[1], ss)
        ss[0] = close[1] < ss1 ? Math.min(ss[0], ss1) : ss[0]

        let dir = this.ts(1, id+'4', _tf)
        dir[0] = this.nz(dir[1], dir[0])
        dir[0] = dir[0] === -1 && close[0] > ss1 ? 1 :
            (dir[0] === 1 && close[0] < ls1 ? -1 : dir[0])

        let plot = this.ts(dir[0] === 1 ? ls[0] : ss[0], id+'5', _tf)
        return [plot, this.neg(dir, id+'6')]
    }
Supertrend Indicator
@param {number} factor - ATR multiplier
@param {number} atrlen - Length of ATR
@return {TS[]} - Supertrend line and direction of trend