l_s=[];% test a trade
for i=1:21 if abs(stock_t(3).price(i)-stock_t(5).price(i))>top5(1,4) for ii=i:21 if stock_t(3).price(i)>stock_t(5).price(i) l_s(i,1)=-1*stock_t(3).price(i); l_s(i,2)=1*stock_t(5).price(i); else l_s(i,1)=-1*stock_t(3).price(i); l_s(i,2)=1*stock_t(5).price(i); end
MATLAB: I get an error in the for statement it says i need to add and end and i did
errorfor
Best Answer