Gamestudio Links
Zorro Links
Newest Posts
Price of entry with OrderDelay
by Zheka. 10/18/21 23:50
Easiest way to get 1m History?
by Grant. 10/18/21 22:31
Lapsa's very own thread
by Lapsa. 10/18/21 21:09
Is it possible to find robust systems?
by Mariano. 10/18/21 20:59
Orders not found
by dpn. 10/18/21 18:09
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 10/18/21 13:49
What are you working on?
by rayp. 10/17/21 12:01
AUM Magazine
Latest Screens
Tactics of World War I
Hecknex World
Scheherazade's Journey
Paradox Vector
Who's Online Now
7 registered members (Rtttt, Quad, Dooley, AndrewAMD, Zheka, Grant, RealSerious3D), 420 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mariano, KoenC, Cuttyflame, Chiller, Avedon
18694 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: sub group backtesting [Re: Grant] #484245
09/25/21 01:46
09/25/21 01:46
Joined: Oct 2018
Posts: 56
7
7th_zorro Offline OP
Junior Member
7th_zorro  Offline OP
Junior Member
7

Joined: Oct 2018
Posts: 56
Yes, I aleady know what assets to trade.
Backtesting the whole assets take forever.
What do you mean "run those blocks between date"?
How can we divide it into blocks?

Code
                   ... 2001 2002 2003 2004 2005 2006  2007 2008 2009 2010 ...
asset 1       --------------                  ------------       ---------------       

asset 2       -------------            -------------          -----------------

asset 3                           ---------                                   -------------
.
.
.
asset 1,000                        ---------------------           ------




Last edited by 7th_zorro; 09/25/21 02:28.
Re: sub group backtesting [Re: 7th_zorro] #484247
09/25/21 09:25
09/25/21 09:25
Joined: Aug 2017
Posts: 56
Netherlands
G
Grant Online
Junior Member
Grant  Online
Junior Member
G

Joined: Aug 2017
Posts: 56
Netherlands
With a block I mean a group of assets, 100 in your case. So the idea is to change the 'dow()' condition in your script by a time/date condition, for example like:

Code
if(year(Bar) == 2001)
{	
asset("A");
vars price1 = series(priceClose());
asset("B");
vars price2 = series(priceClose());
asset("C");
vars price3 = series(priceClose());
}
else if(year(Bar) == 2002)
//Call another block, etc..

Last edited by Grant; 09/25/21 09:26.
Re: sub group backtesting [Re: Grant] #484248
09/25/21 12:09
09/25/21 12:09
Joined: Oct 2018
Posts: 56
7
7th_zorro Offline OP
Junior Member
7th_zorro  Offline OP
Junior Member
7

Joined: Oct 2018
Posts: 56
As mentioned above, that codes doesn't work because series function is buried.

Re: sub group backtesting [Re: 7th_zorro] #484249
09/25/21 12:23
09/25/21 12:23
Joined: Aug 2017
Posts: 56
Netherlands
G
Grant Online
Junior Member
Grant  Online
Junior Member
G

Joined: Aug 2017
Posts: 56
Netherlands
I haven't tested it myself, but if it's impossible to call the series() function only during specified periods, then there's probably no way to speed your process up.

Re: sub group backtesting [Re: Grant] #484250
09/25/21 13:00
09/25/21 13:00
Joined: Oct 2018
Posts: 56
7
7th_zorro Offline OP
Junior Member
7th_zorro  Offline OP
Junior Member
7

Joined: Oct 2018
Posts: 56
Zorro won't give up. This is basic function. There must be a way.

Re: sub group backtesting [Re: 7th_zorro] #484251
09/25/21 13:11
09/25/21 13:11
Joined: Feb 2017
Posts: 1,329
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,329
Chicago
Originally Posted by 7th_zorro
So, my question is how to handle assets with sub-groups if I have 1,000 assets?
Need to calculate every assets at every bar even though some of them only used?
Depends on your strategy. At 1,000 assets, I'd start to become more concerned about scalability problems, especially while running a 32-bit Zorro instance.

That aside, create every possible needed series needed for every asset in every run call. You can make an array of series, like this (pseudocode):

vars Prices[NUMBER_OF_ASSETS];
vars EMAs[NUMBER_OF_ASSETS];

for every asset{
Prices[ASSET_NUMBER] = series(price());
EMAs[ASSET_NUMBER] = series(EMA(Prices[ASSET_NUMBER],14));
}

Then your trading logic comes after this loop. You can retrieve the series by an assigned asset number, from 0 through (NUMBER_OF_ASSETS - 1).

Like this:

vars aPrice = Prices[ASSET_NUMBER];
vars aEMA = EMAs[ASSET_NUMBER];

Page 2 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1