Gamestudio Links
Zorro Links
Newest Posts
Bug in the beta version
by jcl. 09/26/22 08:20
Renko bar and free version of Zorro
by jcl. 09/26/22 08:18
Multicurrency Currency Strength
by JJ95. 09/22/22 18:39
Interactive brokers demo trade test
by AndrewAMD. 09/22/22 17:14
Check Lookback on a per-asset basis
by AndrewAMD. 09/22/22 13:41
How's 3DGS in 2022?
by Cyndanera. 09/22/22 01:01
Avira antivirus alert with Zorro
by jcl. 09/21/22 16:09
AUM Magazine
Latest Screens
DEAD TASTE
Tactics of World War I
Hecknex World
Scheherazade's Journey
Who's Online Now
5 registered members (Quad, AndrewAMD, ozgur, Petra, 1 invisible), 390 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
lianhuaahua, sereinsand, Cyndanera, Atila_Firmino, mircomm
18847 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,554
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,554
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,892
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,892
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,554
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,554
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,554
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

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