Happy New Year。。。
I'm very sorry, because I can not open a new post questions, so only here to ask questions.
I think through reference to existing positions opening to limit the next opening when the opening price. My strategy for the preparation of a problem, I would like to ask how to write.
local trades = core.host:findTable("trades");
local haveTrades = (trades:find('AccountID', Account) ~= nil)
if (haveTrades) then
local enum = trades:enumerator();
while true do
local row = enum:next();
if row == nil then break end
if row.AccountID == Account and row.OfferID == Offer then
if row.BS == 'B' then
elseif row.BS == 'S' then
My goal is to refer to the existing largest and smallest positions opening price opening price and assigned to " MaxB " and " MinS ". Ask how to modify?
Thanks a million！