for some reason I get this error while backtesting in marketscope, but it runs fine and very fast in the indicore SDK. Any idea how to fix this?
the error says .lua:540, which I assume means line 540, if so this is what it's doing at that point. Thanks in advance!
function Update()
if instance.bid:size() > 0 then
_gLastTime = instance.bid:date(instance.bid:size() - 1);
end
for k, v in pairs(_gSubscription) do
if v.loaded and v.stream:size() > 1 then
local s = v.stream:serial(v.stream:size() - 1);
local p;
if s ~= v.lastSerial then
if v.tick then
p = v.stream:size() - 1; -- the last tick
else
p = v.stream:size() - 2; -- the previous candle
end
ExtUpdate(k, v.stream, p); -- THIS IS LINE 540
v.lastSerial = s;
end
end
end
end