Gamestudio Links
Zorro Links
Newest Posts
Lapsa's very own thread
by Lapsa. 06/20/26 18:18
Ranger by Robert Pardo - now for Zorro
by Smallz. 06/20/26 11:23
Z12 live performance
by jcl. 06/19/26 11:21
Z9 getting Error 058
by jcl. 06/16/26 09:51
How to select between IB accounts by script?
by AndrewAMD. 06/13/26 15:44
Zorro tutorial ideas?
by AndrewAMD. 06/13/26 15:01
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (Grant, TipmyPip, monarch, Lapsa), 4,668 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Entry when market is closed #441719
05/31/14 20:58
05/31/14 20:58
Joined: Oct 2012
Posts: 48
C
Chaosfreak Offline OP
Newbie
Chaosfreak  Offline OP
Newbie
C

Joined: Oct 2012
Posts: 48
Hi,

I often have the problem with "Can't open" messages from Zorro because market is closed, especially on GER30 and UK100. I'm currently coding a strategy with BarPeriod 1440, so signals occur at midnight where those markets are closed.

I set "Entry = 10 * PIP" and wrote a TMF function which returns 2 to enter pending trades as I thought the TMF is executed only when ticks arrive and so when the market is open, but I still get these message and Zorro doesn't open the trade.

@jcl: Can you tell us how the Z strategies enter trades? As I see in the log it is always entered with a pending trade (Entry limit). With the Z strategies I never get a "Can't open" message. Can you post a piece of code how the Z's enter trades?

Re: Entry when market is closed [Re: Chaosfreak] #441766
06/02/14 06:33
06/02/14 06:33
Joined: Jul 2000
Posts: 28,110
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,110
Frankfurt
Arriving ticks does not mean that you can trade. "Can't open" can also happen within market hours and also with the Z systems, but rarely because they trade inside market hours. With BarPeriod 1440, use a bar offset for trading when the market is open.

The Z systems use a function like this for determining market hours:

Code:
bool isMarketOpen()
{
	int h = hour()+dst(0); // Greenwich local time
	
	if(Asset == "GER30") {
		if(h+CET < 9 || h+CET > 16)
			return false;
	}
	else if(Asset == "UK100") {
		if(h < 9 || h > 16) 
			return false;
	}
	else if...
	...
	return true;
}


Re: Entry when market is closed [Re: jcl] #441773
06/02/14 11:56
06/02/14 11:56
Joined: Oct 2012
Posts: 48
C
Chaosfreak Offline OP
Newbie
Chaosfreak  Offline OP
Newbie
C

Joined: Oct 2012
Posts: 48
Okay, thanks. It would be nice if Zorro would automatically retry to open these trade like it is with closing trades. Can you set this on the todo?

Re: Entry when market is closed [Re: Chaosfreak] #441829
06/04/14 06:37
06/04/14 06:37
Joined: Jul 2000
Posts: 28,110
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,110
Frankfurt
Doing that automatically would be dangerous. If a trade is rejected because the market is closed, the strategy must decide if the conditions for the trade are still valid when the market opens again.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1