I wish you a wonderfull day,
I want to compare two points on a moving average from another time frame,(example: (MVA 50) I want to compare ma.DATA[ma.DATA:size() - 1] and ma.DATA[ma.DATA:size() - 10)] in order to know if moving average follos the trend of the first 40 points of the MVA) to show the result from DRAW
I can access just the first three of them, it works perfect, BUT, beyond ma.DATA[ma.DATA:size() - 3) there is SPECIFIED INDEX IS OUT OF RANGE
src = core.host:execute("getSyncHistory", source:instrument(), TF, source:isBid(), math.min(300, first), 1000, 2000);
function AsyncOperationFinished(cookie, success, error)
if cookie == 200 then
loading = true;
elseif cookie == 100 then
loading = false;
end
local FLAG = false;
if loading then
FLAG = true;
end
if cookie == 1 and (not FLAG) then
MA:update(core.UpdateLast);
txt = MA.DATA[ma.DATA:size() - 10];
end
if FLAG then
core.host:execute("setStatus", "Loading");
else
instance:updateFrom(0);
end
return core.ASYNC_REDRAW;
end