Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,227 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Results with and without optimize function #439426
04/02/14 17:38
04/02/14 17:38
Joined: Aug 2013
Posts: 8
California
R
ron17 Offline OP
Newbie
ron17  Offline OP
Newbie
R

Joined: Aug 2013
Posts: 8
California
Following is the code I am using.
-------------------
function run()
{
set(PARAMETERS);
StartDate = 20080101;
EndDate = 20131231;
//BarPeriod = optimize(15,5,20,1); //after optimize, value for BarPeriod is 18
//Test shows annual loss of -219p
BarPeriod = 18; //Test without any optimization, test shows +257p
LookBack = 100*5;

vars Price = series(price());
vars Trend = series(LowPass(Price,1000));

if(valley(Trend))
enterLong();
else if(peak(Trend))
enterShort();
}
-------------------

Following are steps for testing it
1) Executed the script in Train mode and found the value for BarPeriod is 18 stored in abc_EURUSD.par file
2) Ran Test, results showed annual loss of -219p
3) Commented the line to optimize BarPeriod, and hard-coded BarPeriod = 18, and saved the file
4) Removed abc_EURUSD.par from Data directory
5) Ran Test, results showed annual profit of +257p

I am confused why the results are different when I used the value provided by optimize function. Any thoughts ?.

Re: Results with and without optimize function [Re: ron17] #439459
04/03/14 08:41
04/03/14 08:41
Joined: Jul 2000
Posts: 27,987
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,987
Frankfurt
Your -219p loss was with a bar period of 15, not 18.

Parameters such as Barperiod, which are already needed for price loading at script start, must be optimized in a special way, if at all. Look here (under "Remarks"): http://manual.zorro-trader.com/optimize.htm

Re: Results with and without optimize function [Re: jcl] #439504
04/04/14 03:19
04/04/14 03:19
Joined: Aug 2013
Posts: 8
California
R
ron17 Offline OP
Newbie
ron17  Offline OP
Newbie
R

Joined: Aug 2013
Posts: 8
California
Thanks JCL. Yes indeed the manual has details for BarPeriod. Lot more to learn and try. Appreciate your help.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1