Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 689 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
lorikob361, LucasJoshua, Baklazhan, Hanky27, firatv
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
lookback setting performance issue #488186
04/15/24 10:15
04/15/24 10:15
Joined: Oct 2018
Posts: 96
7
7th_zorro Offline OP
Junior Member
7th_zorro  Offline OP
Junior Member
7

Joined: Oct 2018
Posts: 96
If I develop a mix of several assets and algorithms, lookback settings greatly affect the backtesting performance. Can you tell me why?

Re: lookback setting performance issue [Re: 7th_zorro] #488188
04/15/24 16:59
04/15/24 16:59
Joined: Feb 2017
Posts: 1,731
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,731
Chicago
There can be many reasons. Post code.

Re: lookback setting performance issue [Re: AndrewAMD] #488189
04/16/24 03:08
04/16/24 03:08
Joined: Oct 2018
Posts: 96
7
7th_zorro Offline OP
Junior Member
7th_zorro  Offline OP
Junior Member
7

Joined: Oct 2018
Posts: 96
When using a mix of assets and algos, the manual suggests the following.
Select asset first, then algo.

Code
// initial settings
...
LookBack = max((1440 / BarPeriod) * MANUAL_LOOKBACK_DAY_SETTING, LookBackNeeded);
...

while(asset(loop(Assets))
{
    algo("trend"); trendAlgo();
    algo("reversion"); reversionAlgo();
}


However, it is often convenient to choose algo first.
For example, if you write an algo that you want to trade selectively from multiple assets.

Code
// initial settings
...
LookBack = max((1440 / BarPeriod) * MANUAL_LOOKBACK_DAY_SETTING, LookBackNeeded);
...

for(auto it : myAlgoContainerMap)
{
    algo(it.first);  // name of algo

    while(asset(loop(Assets))
    {
        it.second->run();  // process function of algo
    }
}


In this case, the number of times the asset is switched will also increase in proportion to the increase in algo.
When the asset is switched, lookback data may also need to be moved(or copied).
I'm asking you to review whether this can be a factor in performance degradation.


Last edited by 7th_zorro; 04/16/24 05:58.

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1