Блог им. MarconiNN
Settings=
{
Name = "*VMA",
step=100,
line = {{
Name = «Линия 1»,
Type = TYPE_LINE,
Color = RGB(6, 50, 250)
},
{
Name = «Линия 2»,
Type = TYPE_LINE,
Color = RGB(0, 0, 0),
Width = 2
}
}
}
function Init()
func=aver()
return #Settings.line
end
function OnCalculate(Index)
return func(Index, Settings)
end
function aver()
local vol={}
return function (I)
if I>0 then
vol[0]=0
if O(I-1)==C(I-1) then
k=0
else
k=O(I-1)<C(I-1) and 1 or -1
end
end
vol[I]=vol[I-1]+V(I-1)*k
return vol[I], 0
end
end