Добрый день. Подскажите пожалуйста, как получить из таблице всех сделок дату со временем а также какая была совершена операция (покупка или продажа)?
Делаю вот так:
но почему то значения datetime и operation равны nil, хотя все остальные поля -нормальные.
Делаю вот так:
| Код |
|---|
function to_log(a_msg)
p_file:write(os.date().." "..a_msg.."\n")
end
function fn(datetime,sec_code, price, qty, operation)
to_log(tostring(sec_code).." "..tostring(price).." "..tostring(datetime).." "..tostring(qty).." "..tostring(operation));
if sec_code==p_seccode then
return true
else
return false
end
end
function robot()
--message("robot",1)
to_log("sdfsdfDS")
local NO=getNumberOf("ALL_TRADES")
t_trades = SearchItems("ALL_TRADES", 0, NO-1, fn, "datetime, sec_code, price, qty, operation")
if t_trades ~= nil then
for i=1,#t_trades,1 do
t_trades_item=getItem("ALL_TRADES", t_trades[i])
--message(t_trades_item["datetime"],1)
end
end
end |
но почему то значения datetime и operation равны nil, хотя все остальные поля -нормальные.