Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 552 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Check Lookback on a per-asset basis #486676
09/16/22 15:17
09/16/22 15:17
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
On many stock portfolio trading systems, when backtesting daily data, different stocks have different start dates. For example, MSFT started much earlier than META.

It would help to know if the lookback period has been satisfied on a per-asset basis. It can be like this:

LookBack = AssetLookback = 100;

Then loop through the assets and check for (!is(ASSETLOOKBACK) && !is(LOOKBACK) && !Init) before trading on any given asset.

Re: Check Lookback on a per-asset basis [Re: AndrewAMD] #486702
09/19/22 13:52
09/19/22 13:52
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
You can use the AssetFirstBar variable from the new beta version. If AssetFirstBar+LookBack < Bar, the current asset is still inside its Lookback period.

Re: Check Lookback on a per-asset basis [Re: AndrewAMD] #486703
09/19/22 13:56
09/19/22 13:56
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
That should work, thanks!

Re: Check Lookback on a per-asset basis [Re: AndrewAMD] #486722
09/22/22 13:41
09/22/22 13:41
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
By the way, the manual's description of AssetFirstBar is incomplete:
Quote
AssetFirstBar
Number of the first valid bar of the selected asset. Can be different when asset histories start after the
https://zorro-project.com/manual/en/numbars.htm


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