FXCM Forex Trading

How to Backtest and Optimize Parameters using SDK 2.0?

Strategies are published here.

Moderator: admin

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

Postby mcarr005 » Wed May 23, 2012 12:34 pm

Please update CodeBase Price Archive FXCM 1-Min Data
mcarr005
 
Posts: 10
Joined: Mon Oct 25, 2010 2:56 pm

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

Postby guangho » Tue Jan 01, 2013 5:00 am

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!
guangho
 
Posts: 61
Joined: Sat Sep 29, 2012 12:16 pm

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

Postby Apprentice » Tue Jan 01, 2013 6:32 am

If I understand you.
You want to store minimum and maximum price at the opening,
for all active positions.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 14872
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

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

Postby guangho » Tue Jan 01, 2013 11:54 am

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.
guangho
 
Posts: 61
Joined: Sat Sep 29, 2012 12:16 pm

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

Postby guangho » Tue Jan 01, 2013 1:20 pm

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!
guangho
 
Posts: 61
Joined: Sat Sep 29, 2012 12:16 pm

Previous

Return to Custom Strategies

Who is online

Users browsing this forum: No registered users and 1 guest