Здравствуйте, подскажите пожалуйста, прописываю вот такой код:
firmid = «XXXXXXXXX»;
client_code = XXXX;
limit_kind = 2;
cena = getPortfolioInfoEx (firmid,client_code,limit_kind, portfolio_value)
message (""..cena)
Но выдает ошибку:
attempt to concatenate a nil value (global 'cena')
Подскажите в чем проблема
function main() local Trades = {} local comission = 0 SearchItems('trades', 0, getNumberOf('trades')-1, function (class_code, trade_num, flags, exchange_comission) if class_code == 'SPBFUT' or class_code == 'SPBOPT' then -- Учитываем только сделки на срочной секции comission = comission + exchange_comission local t = {flags & 0x4, exchange_comission} if Trades[class_code] then Trades[class_code][trade_num] = t else Trades[class_code] = {[trade_num] = t} end end return false end, 'class_code,trade_num,flags,exchange_comission') local total = 0 local maker = 0 local taker = 0 local comission2 = 0 SearchItems('all_trades', 0, getNumberOf('all_trades')-1, function (class_code, trade_num, flags, sec_code) if Trades[class_code] then local t = Trades[class_code][trade_num] if t then total = total + 1 if flags & 0x1 ~= 0 then if t[1] == 0 then maker = maker + 1 else taker = taker + 1 comission2 = comission2 + t[2] end elseif flags & 0x2 ~= 0 then if t[1] == 0 then taker = taker + 1 comission2 = comission2 + t[2] else maker = maker + 1 end else comission2 = comission2 + t[2] end end end return false end, 'class_code,trade_num,flags,sec_code') message(string.format('total: %u\nmaker: %u\ntaker: %u\n\ncomission\nсейчас: %.2f\nскальпинг: %.2f\nстанет: %.2f', total, maker, taker, comission, comission / 2, comission2 * 3)) end