function OnOrder(order)
local param = 0
if order.trans_id == opt.trans_id then
opt.order_num = order.order_num
WAIT_answer = false
if order.balance == 0 then tbl_set.flag = "Off" end
param = tbl_set.volume_opt - order.balance
message("OnOrder1:\ntbl_set.volume_opt = "..tbl_set.volume_opt.."\ntbl_set.volume_opt_ex = "..tbl_set.volume_opt_ex.."\nparam = "..param.."\n") -- tbl_set.volume_opt = 20; tbl_set.volume_opt_ex = 18; param = 18
if tbl_set.volume_opt_ex ~= param then -- несмотря на то, что tbl_set.volume_opt_ex = param = 18 скрипт входит внутрь оператора "if"
message("OnOrder2:\ntbl_set.volume_opt = "..tbl_set.volume_opt.."\ntbl_set.volume_opt_ex = "..tbl_set.volume_opt_ex.."\nparam = "..param.."\n") -- tbl_set.volume_opt = 20; tbl_set.volume_opt_ex = 18; param = 18
tbl_set.volume_opt_ex = param
FUT_Ex_flag = true
SAVE_Settings_flag = true
end
elseif order.trans_id == fut.trans_id then
fut.order_num = order.order_num
if order.balance == 0 then
tbl_set.volume_fut_ex = tbl_set.volume_fut_ex + order.qty
SAVE_Settings_flag = true
end
end
end
local param = 0
if order.trans_id == opt.trans_id then
opt.order_num = order.order_num
WAIT_answer = false
if order.balance == 0 then tbl_set.flag = "Off" end
param = tbl_set.volume_opt - order.balance
message("OnOrder1:\ntbl_set.volume_opt = "..tbl_set.volume_opt.."\ntbl_set.volume_opt_ex = "..tbl_set.volume_opt_ex.."\nparam = "..param.."\n") -- tbl_set.volume_opt = 20; tbl_set.volume_opt_ex = 18; param = 18
if tbl_set.volume_opt_ex ~= param then -- несмотря на то, что tbl_set.volume_opt_ex = param = 18 скрипт входит внутрь оператора "if"
message("OnOrder2:\ntbl_set.volume_opt = "..tbl_set.volume_opt.."\ntbl_set.volume_opt_ex = "..tbl_set.volume_opt_ex.."\nparam = "..param.."\n") -- tbl_set.volume_opt = 20; tbl_set.volume_opt_ex = 18; param = 18
tbl_set.volume_opt_ex = param
FUT_Ex_flag = true
SAVE_Settings_flag = true
end
elseif order.trans_id == fut.trans_id then
fut.order_num = order.order_num
if order.balance == 0 then
tbl_set.volume_fut_ex = tbl_set.volume_fut_ex + order.qty
SAVE_Settings_flag = true
end
end
end