StartDate setting leads to 'Warning 047'

Posted By: Grant

StartDate setting leads to 'Warning 047' - 03/08/22 17:34

I've recently upgraded Zorro to 2.44 and I've noticed an issue with the StartDate. It works well when I set this to the beginning of the year, but I get a 047 warning once I adjust it to a later date. As a result, Zorro starts reading my .t6 data for the following year.

Quote
function run()
{
History = ".t6";
BarPeriod = 1;
//StartDate = 20200101;//OK
StartDate = 20200201;//Warning 047: EUR/USD first bar on 2021-01-03...

if(Bar > 0)
{
//returns: 'Date: 210103 23:01:00 | Price: 1.22375' when StartDate = 20200201
printf("\nDate: %s | Price: %.5f",strdate(YMDHMS,ldate(UTC,0)), priceClose());
quit();
}
}
Posted By: jcl

Re: StartDate setting leads to 'Warning 047' - 03/09/22 10:09

Maybe some gap in your historical data? When I test your script with the latest Zorro version, FXCM Assets, and EUR/USD, I get:

20200201: Date: 200131 18:39:00 | Price: 1.10787
20200101: Date: 191231 09:19:00 | Price: 1.12083

That's what I would expect.
Posted By: Grant

Re: StartDate setting leads to 'Warning 047' - 03/09/22 14:03

I wrote my data to a CSV file for further inspection (I can't run ZHistoryEditor.exe under Wine).

For 2020 this starts at StartDate = 20200102.

As you can see there's no gap between the Jan 2 and Jan 3 2020:

200102 23:59:00,1.11715
200103 00:00:00,1.11715

However, once I change StartDate to 20200103, Zorro's screen output becomes:

Warning 047: EUR/USD first bar on 2021-01-03
Test: TestStartBar EUR/USD 2020..2022
Assets AssetsIG
Date: 210103 23:01:00 | Price: 1.22375

I've added 'LookBack = 0;' to my test code, to make sure it was printing the first bar, based on the given StartDate.
Posted By: Grant

Re: StartDate setting leads to 'Warning 047' - 03/09/22 16:59

Update, I've downgraded to Zorro 2.40 and now it returns the correct data: '200103 00:01:00 | Price: 1.11706' when 'StartDate = 20200103' & 'LookBack = 0'

Since you don't have this issue, maybe there's a problem with how Wine handles Zorro 2.44?
From what I remember, that there was a date issue with Wine.

Edit: found that thread -> https://bugs.winehq.org/show_bug.cgi?id=47221
Posted By: jcl

Re: StartDate setting leads to 'Warning 047' - 03/10/22 17:17

Hmm, that bug has meanwhile a workaround in Zorro. I would also assume that a Wine bug affects also 2.40.

Can you test it on a Windows PC?
Posted By: Grant

Re: StartDate setting leads to 'Warning 047' - 03/10/22 21:06

Under Windows 10 only Zorro 2.40 returns the correct date, but Zorro 2.44 returns the bar from 1 year later.

[Linked Image]

Without using 'LookBack = 0' it does return the correct date with Zorro 2.44. Is this expected behavior?
Posted By: Petra

Re: StartDate setting leads to 'Warning 047' - 03/10/22 21:38

Looks ok, unless the error message is wrong. Have you checked the 2022 and 2020 history?
Posted By: Grant

Re: StartDate setting leads to 'Warning 047' - 03/10/22 21:42

Only the 2022 history is missing, but that's not the issue because it switches from 2020 to 2021 when 'StartDate = 20200103' & 'LookBack = 0'
2020 & 2021 sets are OK, I've used those many times before without any issues with Zorro 2.40
Posted By: Petra

Re: StartDate setting leads to 'Warning 047' - 03/11/22 08:50

The reason for switching is that the 2019 file is used when you dont set lookback = 0. But the 2020 problem is not clear. It does not happen here. Can you test it with the latest version 2.46? Does it happen with other start dates or only with 2020? You can also contact support, they will work with you to sort that out.
Posted By: Grant

Re: StartDate setting leads to 'Warning 047' - 03/17/22 18:20

Sorry for my late response.

I've removed the LookBack setting, but there's still a different date output. When I install Zorro 2.44 in the same directory as Zorro 2.40, it returns 'Date 200102...' when 'StartDate = 20200102', but when I install Zorro 2.46 beta under a new directory, it returns 'Date: 191231...' with the same script.

I thought, let's check the .t6 files and I've noticed that the 2.40 version for 'EURUSD_2020.t6' was 11,638 kb v.s. 11,465 kb for the Zorro 2.46 version (and probably Zorro 2.44 under a fresh directory as well), so I've replaced this one in my formal 2.40 directory (where's 2.44 is installed) by the newer (and smaller!) one, but there's still an output difference after restarting Zorro 2.44.

[Linked Image]
Posted By: jcl

Re: StartDate setting leads to 'Warning 047' - 03/18/22 09:36

Ok, but is the date correct? Startdate minus lookback? Or do you still get warning 47?

The date of the first bar should be the first timestamp of the 2020 file minus the number of bars for the lookback period, with considering gaps and weekends.
Posted By: Grant

Re: StartDate setting leads to 'Warning 047' - 03/18/22 12:07

The trade date 200102 is correct, since this was the first trading day of 2020.
No, I don't receive that 047 warning anymore (I forgot to mention this, sorry).
The issue is that my Zorro versions return different date outputs with the same code and the same .t6 files. You can see this on my last screenshot.

Code
function run()
	{
	History = ".t6";
	BarPeriod = 1;
	StartDate = 20200102;

	if(Bar > 0)
		{
		printf("\nDate: %s | Price: %.5f",strdate(YMDHMS,ldate(UTC,0)), priceClose());
		quit();
		}
	}		
			
Posted By: Petra

Re: StartDate setting leads to 'Warning 047' - 03/18/22 17:17

For 200102 you must set Lookback = 0. The default lookback is 80 bars and can go back to 2019 depending on history.
Posted By: Grant

Re: StartDate setting leads to 'Warning 047' - 03/18/22 18:04

With the same .t6 files and LookBack = 0 both outputs are more identical.

Zorro 2.44 (which was installed in a formal 2.40 directory) returns 'Date 200102 07:02:00..'
Zorro 2.46 (and probably Zorro 2.44 in a fresh directory as well) returns 'Date 200102 07:01:00..'.

I'm wondering what's causing this.
© 2024 lite-C Forums