function which is running longer than 30 seconds detected

Moderator: admin

function which is running longer than 30 seconds detected

Postby jetaro » Sat Nov 05, 2016 5:31 pm

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
jetaro
 
Posts: 28
Joined: Wed Aug 24, 2016 8:45 am

Re: function which is running longer than 30 seconds detecte

Postby jetaro » Mon Nov 07, 2016 3:06 pm

I figured it out, there was an infinite loop that for some reason didn't show up in the debugger.
jetaro
 
Posts: 28
Joined: Wed Aug 24, 2016 8:45 am


Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 7 guests