//WWMA variable : WWMA($data); n = inparam("Период средней", 1, 100, 14) ; n2 = inparam("Цена (1-o/2-h/3-l/4-c/5-med)", 1, 5, 4); if n2=1 then price = o; if n2=2 then price = h; if n2=3 then price = l; if n2=4 then price = c; if n2=5 then price = (h+l)/2; if (cum(1)<=n) then WWMA=mov(price,n,s); else WWMA = (ref(WWMA,-1)*(n-1)+price)/n; WWMA;