Блог им. autotrade
--[[
MA volumn
--]]
Settings=
{
Name = "MAV", -- indicator name
per=10, -- period
line=
{
{
Name = "MA",
Type =TYPE_LINE,
Width = 1,
Color = RGB(0,0,0)
}
}
}
function Init()
mav = {}
return 1
end
function OnCalculate(index)
per = Settings.per
if index > 1 then
mav[index] = mav[index-1] + V(index)
else
mav[index] = V(index)
end
if index > per then
vv = mav[index] - mav[index-per]
else
vv = 0
end
return vv
end