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
2 registered members (AndrewAMD, Nymphodora), 972 guests, and 8 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
Generate bars whenever there is data #484411
10/23/21 16:35
10/23/21 16:35
Joined: Oct 2018
Posts: 72
J
JamesHH Offline OP
Junior Member
JamesHH  Offline OP
Junior Member
J

Joined: Oct 2018
Posts: 72
I want to backtest a strategy, generating bars for whenever there is data for that bar.

Following the BarMode documentation, e.g. "For trading assets even at weekends, such as cryptocurrencies, reset BR_WEEKEND before sampling bars", I put this at the beginning of my script:

Code
	if (is(INITRUN)) {
		features = malloc(num_features * sizeof(var));
		set(BR_MARKET | OFF);
		set(BR_WEEKEND | OFF);
	}


However, comparing with an export from the ZHistoryEditor, I see that the script is skipping thousands of bars (I presume on the weekend but I have not carefully checked yet).

Also, according to the docs, after resetting BR_WEEKEND, I would expect StartWeek and EndWeek to have no effect, yet changing these does affect the number of bars generated.

What am I misunderstanding, or is there possibly a bug here?

Re: Generate bars whenever there is data [Re: JamesHH] #484413
10/23/21 18:04
10/23/21 18:04
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
set() does not configure BarMode. And don’t use OFF. Use the setf and resf macros on the BarMode int.

Re: Generate bars whenever there is data [Re: AndrewAMD] #484424
10/24/21 11:24
10/24/21 11:24
Joined: Oct 2018
Posts: 72
J
JamesHH Offline OP
Junior Member
JamesHH  Offline OP
Junior Member
J

Joined: Oct 2018
Posts: 72
You are right, it does say to use setf and resf in the BarMode documentation. However, it gave me the exact same result.

I will double-check my input .t6 file...

Re: Generate bars whenever there is data [Re: JamesHH] #484429
10/24/21 18:28
10/24/21 18:28
Joined: Oct 2018
Posts: 72
J
JamesHH Offline OP
Junior Member
JamesHH  Offline OP
Junior Member
J

Joined: Oct 2018
Posts: 72
It was an issue with an incorrect StartDate, btw. So it was in fact generating all bars.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1