Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 989 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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