Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, dBc), 18,430 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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