Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, AndrewAMD), 410 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Support PEEK for time and calendar functions #488137
02/14/24 21:27
02/14/24 21:27
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
The manual does not specify that the Time and Calendar Functions support PEEK mode.

So my proposal is that it be supported in future Zorro version. Or if it is supported, document it in the manual.

Re: Support PEEK for time and calendar functions [Re: AndrewAMD] #488138
02/14/24 22:23
02/14/24 22:23
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Update: OK, so it looks like they do support peeking after all. I think the manual should be updated.

Sample code:
Code
function run() 
{
	set(LOGFILE);
	set(PEEK);
	LookBack = 0;
	BarPeriod = 5;
	StartDate = 20210101;
	EndDate = 20210131;
	assetList("AssetsFix");
	asset("EUR/USD");
	
	if(Init || is(LOOKBACK))return;
	print(TO_LOG,"\n--------------- BAR %d ---------------",Bar);
	int i;
	for(i=-5; i<=0; i++){
		print(TO_LOG,"\n[%d] tod=%d",i,tod(i));
	}
}

Sample output:
Code
V 2.591 on Wed 24-02-14 16:19:17 (Zorro S Subscription)
LookBack set to 0 bars
Test: test_peek_tod EUR/USD 2021
[1: Sun 21-01-03 23:05] (1.22342)
--------------- BAR 1 ---------------
[-5] tod=2330
[-4] tod=2325
[-3] tod=2320
[-2] tod=2315
[-1] tod=2310
[0] tod=2305

[2: Sun 21-01-03 23:10] (1.22377)
--------------- BAR 2 ---------------
[-5] tod=2335
[-4] tod=2330
[-3] tod=2325
[-2] tod=2320
[-1] tod=2315
[0] tod=2310

[3: Sun 21-01-03 23:15] (1.22405)
--------------- BAR 3 ---------------
[-5] tod=2340
[-4] tod=2335
[-3] tod=2330
[-2] tod=2325
[-1] tod=2320
[0] tod=2315


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