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 local OrderPL=row.PL; if row.AccountID == Account and row.OfferID == Offer then local MaxB=0; local MinS=100000000; if row.BS == 'B' then MaxB=math.max(MaxB,row.Open); elseif row.BS == 'S' then MinS=math.min(MinS,row.Open); end

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?

Apprentice wrote:If I understand you.You want to store minimum and maximum price at the opening,for all active positions.

HI Apprentice：I just want to have the highest bid opening price and sell the lowest opening price assigned to " MaxB " and " MinS ", and then use the two numerical limit after the opening price not higher (or lower ) the standard.

Who is online

FXCodeBase. The Ultimate source of the indicators and signals for the FXCM Trading Station and Marketscope applications

Forex Capital Markets, LLC. ("FXCM LLC") is an independent legal entity and is not affiliated with Gehtsoft USA LLC.http://fxcodebase.com is not owned, controlled, or operated by FXCM LLC. FXCM does not endorse any product or service of Gehtsoft USA LLC. Nothing associated with this promotion shall be considered a solicitation to buy or an offer to sell any product or service to any person in any jurisdiction where such offer, solicitation, purchase or sale would be unlawful under the laws or regulations of such jurisdiction.