- Code: Select all
if (not haveTrades(nil)) then
function haveTrades(BuySell)
local enum, row;
local found = false;
enum = core.host:findTable("trades"):enumerator();
row = enum:next();
while (not found) and (row ~= nil) do
if row.AccountID == account and
row.OfferID == offer and
row.QTXT == "perry" and
(row.BS == BuySell or BuySell == nil) then
found = true;
end
row = enum:next();
end
return found;
end
I suspect the trade tables have not been updated when the trade is closed. This code works in the strategy tester.
I would like to understand what I can do to implement some code that will work in the strategy tester and also live.
Thank you.
Jim Barker