Thanks very much, Apprentice . The error has been fixed after adding your code.
Could you help on another problem which trouble me very long time. In the Strategy Builder.lua, if i want to combine two indicators(Two indicators both signal sell/buy then sell/buy,). For example.
rule: When
TMACD > 0 ; in the meantime, the
CCI >0, then buy.
That means, the two indicator both signal buy (PLUS(i)), then buy (PLUS(i)), is it possible to code it?
CCI code
elseif instance.parameters:getString("IN"..i) == "CCI" then
STREAMS[0]=indicator[i]:getStream(0);
if STREAMS[0][p] > 0 then
PLUS(i);
elseif STREAMS[0][p] < 0 then
MINUS(i);
end
TMACD code
elseif instance.parameters:getString("IN"..i) == "TMACD" then
STREAMS[0]=indicator[i]:getStream(0);
if STREAMS[0][p] > 0 then
PLUS(i);
elseif STREAMS[0][p] < 0 then
MINUS(i);
end