Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Edgar_Herrera, VoroneTZ, Akow), 973 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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: 82
7
7th_zorro Offline OP
Junior Member
7th_zorro  Offline OP
Junior Member
7

Joined: Oct 2018
Posts: 82
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: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
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: 82
7
7th_zorro Offline OP
Junior Member
7th_zorro  Offline OP
Junior Member
7

Joined: Oct 2018
Posts: 82
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: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
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: 82
7
7th_zorro Offline OP
Junior Member
7th_zorro  Offline OP
Junior Member
7

Joined: Oct 2018
Posts: 82
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,718
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,718
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