Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (EternallyCurious, AndrewAMD, TipmyPip, Quad), 902 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
StartDate of LookBack period with YYYYMMDD #485284
02/16/22 18:32
02/16/22 18:32
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
jcl,

Currenly, StartDate has two input methods: YYYY, and YYYYMMDD.

From the manual:
Quote
- A 4-digit number (f.i. 2006) gives the number of the historical data file with which the simulation begins (f.i. EURUSD_2006.t6). If the data file has no year number (f.i. MSFT.t6), the simulation starts with the earliest record in the file.
- A date in yyyymmdd format starts the simulation at a certain date (f.i. 20090401 = April 1st, 2009). The LookBack period is added in front of the date and begins accordingly earlier. Due to the lookback period, StartDate = 2006 is not the same as StartDate = 20060101.
For YYYYMMDD, can there be a mode where StartDate defines the beginning of the lookback period rather than the first bar after lookback? (In other words, "the simulation starts with the earliest record in the file.") Maybe input a negative YYYYMMDD to enable it?

This can be useful if I know how much historical data I have and I want the Lookback period to end as early as possible.

Re: StartDate of LookBack period with YYYYMMDD [Re: AndrewAMD] #485286
02/17/22 07:28
02/17/22 07:28
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
In that case use the YYYY method. The lookback period will then start with the earliest record in the file.

Re: StartDate of LookBack period with YYYYMMDD [Re: AndrewAMD] #485291
02/17/22 13:56
02/17/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
Just to confirm my understanding, which of the following are correct?
1) Intraday data is in format MSFT.t6. StartDate is defined as 2022. Therefore, the first bar is at the very beginning of 2022 and will be within the lookback period (if there is lookback).
2) Intraday data is in format MSFT_YYYY.t6 and includes 2020, 2021, and 2022. StartDate is defined as 2022. Therefore, the first bar is at the very beginning of 2022 and will be within the lookback period (if there is lookback).
3) Daily data is in format MSFT.t6. StartDate is defined as 2022. Therefore, the first bar is at the very beginning of 2022 and will be within the lookback period (if there is lookback).

Re: StartDate of LookBack period with YYYYMMDD [Re: AndrewAMD] #485298
02/19/22 12:12
02/19/22 12:12
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria
All but 2) is wrong. The first lookback bar is just the first bar in the file. With limited data, enter YYYY and the lookback period then ends as early as possible.

Re: StartDate of LookBack period with YYYYMMDD [Re: AndrewAMD] #485303
02/19/22 21:48
02/19/22 21:48
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
I was puzzled by this response, so I ran the test myself. Below are the results.

Based on this, I would re-word the manual a bit. I think the phrase "If the data file has no year number (f.i. MSFT.t6)" is misleading, since the first record in the t6 file (in November of 1999) is completely ignored.

Code
//#define INTRADAY
#define EXACTDATE

function run() {
#ifdef INTRADAY
	LogNumber = BarPeriod = 1;
#else
	LogNumber = BarPeriod = 1440;
#endif
#ifdef EXACTDATE
	LogNumber += 10000;
	StartDate = 20210712;
#else
	StartDate = 2021;
#endif

	set(LOGFILE);
	LookBack = 5;
	
	EndDate = 2022;
	assetList("AssetsIB");
#ifdef INTRADAY
	asset("EUR/USD"); // EURUSD_YYYY.t6, 2005 thru Feb 2022
#else
	asset("DIS"); // DIS.t6,  Nov 1999 thru Feb 2022
#endif
}

/*   ********* LOG OUTPUTS *********

BARPERIOD = 1440 (DAILY, YYYY)

V 2.464 on Sat 22-02-19 16:04:01 (Zorro S Subscription)
Test: test_startdate DIS 2021..2022
Assets AssetsIB

[1: Tue 21-01-05 15:40] (178.44)
[2: Wed 21-01-06 15:40] (179.12)
[3: Thu 21-01-07 15:40] (178.58)
[4: Fri 21-01-08 15:40] (178.69)
End of lookback period

[5: Mon 21-01-11 15:40] (179.09)
[6: Tue 21-01-12 15:40] (175.99)
[7: Wed 21-01-13 15:40] (176.12)
[8: Thu 21-01-14 15:40] (173.43)
...

BARPERIOD = 1440 (DAILY, YYYYMMDD)

V 2.464 on Sat 22-02-19 16:14:43 (Zorro S Subscription)
Test: test_startdate DIS 2021..2022
Assets AssetsIB

[1: Tue 21-07-06 15:40] (173.69)
[2: Wed 21-07-07 15:40] (172.82)
[3: Thu 21-07-08 15:40] (172.80)
[4: Fri 21-07-09 15:40] (177.04)
End of lookback period

[5: Mon 21-07-12 15:40] (184.38)
[6: Tue 21-07-13 15:40] (183.65)
[7: Wed 21-07-14 15:40] (183.42)
[8: Thu 21-07-15 15:40] (184.15)

BARPERIOD = 1 (INTRADAY, YYYY)

V 2.464 on Sat 22-02-19 16:04:01 (Zorro S Subscription)
Test: test_startdate EUR/USD 2021..2022
Assets AssetsIB

[1: Sun 21-01-03 23:01] (1.22375)
[2: Sun 21-01-03 23:02] (1.22344)
[3: Sun 21-01-03 23:03] (1.22358)
[4: Sun 21-01-03 23:04] (1.22364)
End of lookback period

[5: Sun 21-01-03 23:05] (1.22342)
[6: Sun 21-01-03 23:06] (1.22334)
[7: Sun 21-01-03 23:07] (1.22342)
[8: Sun 21-01-03 23:08] (1.22379)
...

BARPERIOD = 1 (INTRADAY, YYYYMMDD)

V 2.464 on Sat 22-02-19 16:13:30 (Zorro S Subscription)
Test: test_startdate EUR/USD 2021..2022
Assets AssetsIB

[1288: Sun 21-07-11 23:55] (1.18720)
[1289: Sun 21-07-11 23:56] (1.18726)
[1290: Sun 21-07-11 23:57] (1.18735)
[1291: Sun 21-07-11 23:58] (1.18734)
[1292: Sun 21-07-11 23:59] (1.18735)
End of lookback period

[1293: Mon 21-07-12 00:00] (1.18731)
[1294: Mon 21-07-12 00:01] (1.18731)
[1295: Mon 21-07-12 00:02] (1.18726)
[1296: Mon 21-07-12 00:03] (1.18734)
...

*/

Re: StartDate of LookBack period with YYYYMMDD [Re: AndrewAMD] #485305
02/20/22 09:14
02/20/22 09:14
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria
Hmm, in the DIS / YYYY case I would expect that the first bar is 1999, at least that's what my documentation says. Does it change when you set a different startdate, like 2000? Is DIS.t6 the only DIS history or have you maybe additionally DIS_YYYY.t6 files?

Re: StartDate of LookBack period with YYYYMMDD [Re: Petra] #485306
02/21/22 12:25
02/21/22 12:25
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Originally Posted by Petra
Is DIS.t6 the only DIS history or have you maybe additionally DIS_YYYY.t6 files?
I don't happen to have DIS_YYYY.t6 files, so I used EUR/USD instead for intraday.

I attached the DIS.t6 file for your reference.

Attached Files
DIS.t6.zip (35 downloads)
Re: StartDate of LookBack period with YYYYMMDD [Re: AndrewAMD] #485343
02/26/22 10:12
02/26/22 10:12
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria
I learned that the documentation was wrong. You must set the year number to the earliest year in your history for starting with the earliest record.

The corrected manual text:

"- A 4-digit year number (f.i. 2006) gives the number of the historical data file with which the simulation begins (f.i. EURUSD_2006.t6). If the data file has no year number (f.i. MSFT.t6), the simulation starts with the earliest record in the file that matches the year number. "

Re: StartDate of LookBack period with YYYYMMDD [Re: AndrewAMD] #485345
02/26/22 12:01
02/26/22 12:01
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
I concur. Thank you!


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