Zorro 2.40.8 - BarOffset problem

Posted By: simonkrebs

Zorro 2.40.8 - BarOffset problem - 09/18/21 14:44

I have a problem with the new Zorro version 2.40.8.
BarOffset no longer works as expected.

I have set:
BarPeriod = 1440;
BarOffset = 17*60;

With Zorro 2.35.9 this worked fine and shifts the trading time, but since the update Zorro always skips several days. The issue disappears when I comment out BarOffset.

Is the error known?
Posted By: jcl

Re: Zorro 2.40.8 - BarOffset problem - 09/18/21 15:40

Sure. Bars are skipped when they have no prices, depending on your BarMode setting. Check the log and your history. But if you cannot find the reason of the problem, you can contact Support with the files and they'll look into it.
Posted By: simonkrebs

Re: Zorro 2.40.8 - BarOffset problem - 09/18/21 16:18

I have set BarMode to BR_FLAT. When executing the same code with Zorro 2.35.9 no bars are skipped. So I assume it‘s a bug.
Posted By: simonkrebs

Re: Zorro 2.40.8 - BarOffset problem - 09/18/21 17:36

Please compare the sample output from Zorro 2.35.9 vs. 2.40.8.

Zorro 2.40.8:

2021-7-19: price=34.91
2021-7-25: price=30.33
2021-7-31: price=30.21
2021-8-6: price=28.30
2021-8-12: price=26.24
2021-8-18: price=29.07
2021-8-24: price=26.71
2021-8-30: price=25.59
2021-9-5: price=24.94
2021-9-11: price=27.06
2021-9-17: price=25.18


Zorro 2.35.9:

2021-9-2: price=24.77
2021-9-3: price=24.94
2021-9-4: price=24.94
2021-9-5: price=24.94
2021-9-6: price=24.94
2021-9-7: price=25.55
2021-9-8: price=25.51
2021-9-9: price=26.05
2021-9-10: price=27.06
2021-9-11: price=27.06
2021-9-17: price=25.18

Here is my sample code:

Code
#define ASSETLIST "AssetsALP-VIX"

function run()
{
	set(PLOTNOW+PRELOAD+COMMONSTART+LOGFILE);
	LookBack = 0;
	BarMode = BR_WEEKEND+BR_FLAT+BR_MARKET+BR_SLEEP+BR_LOGOFF;
	BarPeriod = 1440;
	BarOffset = 17*60; //shift the bar begin to 17:00 server time / 19:00 local time
	StartDate = ifelse(Live,NOW,20180101); 
	EndDate = NOW;

	Capital = 10000;
	NumCores = -2;
	
	if(is(INITRUN)) assetList(ASSETLIST); 
	if(Live) brokerCommand(SET_PRICETYPE, 2);
	
	BarOffset = 17*60; //Shift bar start/end by x hours
	
	asset("VXX");
	printf("\n%d-%d-%d: price=%.2f",year(),month(),day(),priceClose());
	
	
}
Posted By: Petra

Re: Zorro 2.40.8 - BarOffset problem - 09/18/21 20:24

Bars must be inside market hours. Not outside.

Read this: https://manual.zorro-project.com/barmode.htm
© 2024 lite-C Forums