Page 3 of 3

Re: How to Backtest and Optimize Parameters using SDK 2.0?

PostPosted: Wed May 23, 2012 12:34 pm
by mcarr005
Please update CodeBase Price Archive FXCM 1-Min Data

Re: How to Backtest and Optimize Parameters using SDK 2.0?

PostPosted: Tue Jan 01, 2013 5:00 am
by guangho
Happy New Year。。。 :D :D
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?

Thanks a million!

Re: How to Backtest and Optimize Parameters using SDK 2.0?

PostPosted: Tue Jan 01, 2013 6:32 am
by Apprentice
If I understand you.
You want to store minimum and maximum price at the opening,
for all active positions.

Re: How to Backtest and Optimize Parameters using SDK 2.0?

PostPosted: Tue Jan 01, 2013 11:54 am
by guangho
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.

Excuse me, how should I write this command? Thank you.

Re: How to Backtest and Optimize Parameters using SDK 2.0?

PostPosted: Tue Jan 01, 2013 1:20 pm
by guangho
Apprentice wrote:If I understand you.
You want to store minimum and maximum price at the opening,
for all active positions.


Yes, just as what you said. That should be how to write this command? Please help me. Thank you!