Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, NeoDumont), 761 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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