Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Quad, VoroneTZ, 1 invisible), 852 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Zorro 2.40.8 current date in Live mode #484224
09/22/21 15:36
09/22/21 15:36
Joined: Apr 2021
Posts: 19
S
simonkrebs Offline OP
Newbie
simonkrebs  Offline OP
Newbie
S

Joined: Apr 2021
Posts: 19
I tested Zorro 2.40.8 vs. Zorro 2.35.9, here are some observations I made:
- LookBack 0 in Live mode causes current date to jump to tomorrow as current date
- StartDate = NOW in Live mode causes current date to jump to tomorrow as current date (example: date 2021-09-22, output day() function -> 23)

I attached my testing script.

Code
function run() {
	
	// Initialize strategy parameters
	set(PLOTNOW+PRELOAD+LOGFILE);
	LookBack = 1; // 0 doesn't work -> Forces current day to jump to tomorrows date in Live mode
	BarMode = BR_WEEKEND+BR_MARKET+BR_FLAT+BR_SLEEP+BR_LOGOFF; 
	BarPeriod = 1440;
	BarOffset = 15*60 + 40; // set the bar end to 15:40, 20 minutes before NY market close
	BarZone = ET;
	StartMarket = 0930;
	EndMarket = 1610;
	NumCores = -2;	
	Hedge = 2; // Allow long/short positions at the same time -> need to check if Alpaca allowes this!
	
	Capital = slider(1,1000,0,20000,"Capital","");
	Verbose = slider(2,7,0,7,"Verbose","");
	if(!Live) StartDate = 20180101; 
	//StartDate = ifelse(Live,NOW,20180101); // Doesn't work -> Forces current day to jump to tomorrows date in Live mode
	EndDate = NOW;
	
	assetList("AssetsALP-VIX");
	asset("MTG");
	printf("\n%d-%d-%d: %s price=%.2f",year(),month(),day(),Asset,priceClose());

}

Last edited by simonkrebs; 09/22/21 15:37.
Re: Zorro 2.40.8 current date in Live mode [Re: simonkrebs] #484255
09/26/21 11:32
09/26/21 11:32
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria
I believe the time functions return the time at the end of the current bar. Not the current time. For the current time you must use day(NOW).

But will forward this to the developers. Maybe they change it in the next beta so that with StartDate=NOW the current time is also returned.

Re: Zorro 2.40.8 current date in Live mode [Re: simonkrebs] #484293
10/01/21 07:18
10/01/21 07:18
Joined: Apr 2021
Posts: 19
S
simonkrebs Offline OP
Newbie
simonkrebs  Offline OP
Newbie
S

Joined: Apr 2021
Posts: 19
Thanks, Petra.

Regarding the LookBack issue: I tested LookBack = 0 in the current Zorro Beta 2.42.2, there it works correctly like in the past and doesn’t skip dates. So what I described is a bug in the current productive version, right?

Regarding the NOW issue: Unfortunately your solution date(NOW) didn‘t work for me


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