Optimization, Trading Strategy, Fmz Quant, Cryptocurrency, Trends.
valpha = 2 / (length2 + 1) vud1 = src2 > src2[1] ? src2 - src2[1] : 0 vdd1 = src2 < src2[1] ? src2[1] - src2 : 0 vUD = math.sum(vud1, 9) vDD = math.sum(vdd1, 9) vCMO = nz((vUD - vDD) / (vUD + vDD)) VAR2 = 0.0 VAR2 := nz(valpha * math.abs(vCMO) * src2) + (1 - valpha * math.abs(vCMO)) * nz(VAR2[1])