Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 552 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Intercept Friday Daily Close #475476
12/12/18 20:40
12/12/18 20:40
Joined: Feb 2018
Posts: 236
Italy
tradingest Offline OP
Member
tradingest  Offline OP
Member

Joined: Feb 2018
Posts: 236
Italy
Hi guys,

I use the code below for the Close and Open of the previous day.
Monday I have a problem to identify correctly the close on friday.
The code below consider the close on sunday. Why?
How Can I make intercept the right close on friday without consider sunday?

Code:
function run()
{
	
	var open; var close; 
	StartDate = 20181101;
	EndDate = 20181130;
	#define H24 (1440/BarPeriod)
	#define H4 (240/BarPeriod)
	#define H1 (60/BarPeriod)
	
	StartWeek = 10000;
	EndWeek = 52300;

	BarPeriod = 60; // 1 hour (60 minutes) bars

	// create a 4-hour price series ///////////////////////////////////
	TimeFrame = H4;
	vars PriceH4 = series(priceClose());
	 
	// create a 24-hour price series /////////////////////////////////
	TimeFrame = frameSync(H24);
	vars CloseH24 = series(priceClose());
	vars OpenH24  = series(priceOpen());

	close=CloseH24[0];
	open=OpenH24[0];
}



thanks

Last edited by tradingest; 12/12/18 20:41.
Re: Intercept Friday Daily Close [Re: tradingest] #475490
12/14/18 15:41
12/14/18 15:41
Joined: Feb 2017
Posts: 369
D
Dalla Offline
Senior Member
Dalla  Offline
Senior Member
D

Joined: Feb 2017
Posts: 369
Check out startweek and endweek
https://zorro-project.com/manual/en/date.htm

Default startweek is Sunday 23 utc

Re: Intercept Friday Daily Close [Re: Dalla] #475513
12/17/18 21:42
12/17/18 21:42
Joined: Feb 2018
Posts: 236
Italy
tradingest Offline OP
Member
tradingest  Offline OP
Member

Joined: Feb 2018
Posts: 236
Italy
Originally Posted By: Dalla
Check out startweek and endweek
https://zorro-project.com/manual/en/date.htm

Default startweek is Sunday 23 utc


Hi Dalla,

I try it but I can't recover the friday close.

Re: Intercept Friday Daily Close [Re: tradingest] #475527
12/18/18 18:25
12/18/18 18:25
Joined: Aug 2018
Posts: 98
O
OptimusPrime Offline
Junior Member
OptimusPrime  Offline
Junior Member
O

Joined: Aug 2018
Posts: 98
Hi TradingEst:

Did you take a look at the Weekend variable specifically? "Weekend affects the sampling of price data and thus must be set before any asset calls."


Thanks so much,

OptimusPrime


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