Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, EternallyCurious, Petra, 1 invisible), 788 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 7 1 2 3 4 5 6 7
Re: Precise AssetMarketStart/End [Re: Spirit] #485532
03/19/22 17:54
03/19/22 17:54
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
Originally Posted by Spirit
I don't think they are deprecated..
I suggested to deprecate them.

Actually, BR_LEISURE seems to work with AssetMarketStart/End.

Re: Precise AssetMarketStart/End [Re: Zheka] #485583
03/26/22 13:18
03/26/22 13:18
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
I was mistaken: BR_LEISURE does not work with AssetMarketStart/End out of the box.

The problem with setting StartMarket=AssetMarketStart is with BarZone -which is set once per script.

So, AssetMarketTimes need to be translated from AssetMarketZone to BarZone; doing this correctly in the general case isn't trivial.

Please make our lives simpler - make BR_LEISURE work with the new AssetMarketxxx variables.

Thank you.

Re: Precise AssetMarketStart/End [Re: Zheka] #485634
04/04/22 12:04
04/04/22 12:04
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
It would be very helpful if a snippet of code showing correct usage of AssetMarketXXX with BR_ASSET+BR_LEISURE with 2+ assets be added to the Tips+Tricks/ manual.

Re: Precise AssetMarketStart/End [Re: Zheka] #485636
04/05/22 13:45
04/05/22 13:45
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
"For using asset-dependent market hours with BR_MARKET or BR_LEISURE, copy the AssetMarket... variables to StartMarket, EndMarket, BarZone after selecting the asset." (from the BarMode description)

As to your suggestion to print local time to the log, instead of UTC, that raises the question which local time. When you set BarZone to different asset zones as above suggested, any bar could have a different local time. I think this would cause more confusion than help.

Re: Precise AssetMarketStart/End [Re: jcl] #485638
04/05/22 14:25
04/05/22 14:25
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
Originally Posted by jcl
"For using asset-dependent market hours with BR_MARKET or BR_LEISURE, copy the AssetMarket... variables to StartMarket, EndMarket, BarZone after selecting the asset." (from the BarMode description)
Setting BarZone AFTER selecting asset generates Error 030 - check order of settings (as BarZone affects generation of bars).
Originally Posted by jcl
As to your suggestion to print local time to the log, instead of UTC, that raises the question which local time. When you set BarZone to different asset zones as above suggested, any bar could have a different local time.
The very first used BarZone - which is prior to asset() and which affects generation of bars - should be the time zone of the log....UTC times ARE causing confusion.

Re: Precise AssetMarketStart/End [Re: Zheka] #485661
04/10/22 16:20
04/10/22 16:20
Joined: Apr 2008
Posts: 586
Austria
Petra Online
Support
Petra  Online
Support

Joined: Apr 2008
Posts: 586
Austria
Variables that affect bar loading must be set before loading bars, setting them afterwars wont work obviously.

You can probably set BarZone when you only want to use BR_LEISURE because it has no effect on loading bars. But you must then set it back afterwards for avoiding error 030.

I think it is not really needed, because when BR_ASSET is set, you normally wont get trade signals anyway.

It would probably make sense when you explain what your strategy is doing and which flags or zones you need for which purpose, then it can be better understood what the problem is.

Re: Precise AssetMarketStart/End [Re: Zheka] #485665
04/11/22 10:34
04/11/22 10:34
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
Setting BarZone back to the very first value (ET) at the end of the script fixes Error 030 but does not really change internal Zorro 'market hours' - they are still in the ET timezone, and therefore trades for GDAXI are allowed from 930 to 1600 ET, not WET.

Code
function run() {
	
	set(LOGFILE);
	NumYears=1;
		
   BarPeriod=15;
	
	BarZone=ET;
	
	Verbose=3;
	
	StartWeek=71800;
	EndWeek=51701;
		
BarMode = BR_WEEKEND+BR_ASSET+BR_LEISURE;

MaxLong=-1;

	asset("EUR/USD");	  
	  
	  AssetMarketZone=ET;
	
		AssetMarketStart = 1800;
		AssetMarketEnd = 1701;
		
		BarZone=AssetMarketZone;
	
		StartMarket=AssetMarketStart;
		EndMarket=AssetMarketEnd; 	
				
	  vars prcI= series(priceC(0));
	
	   printf("# cls1=%.5f,Assmark1end=%i, market=%i, susp=%i",prcI[0],AssetMarketEnd,market(ET,0),suspended());
             
           //tradeSys1();
	
	asset("GDAXI");	
		
	AssetMarketZone=WET;
	
	AssetMarketStart = 0930;
	AssetMarketEnd = 1601;	
	 
	BarZone=AssetMarketZone;
	
	StartMarket=AssetMarketStart;
	EndMarket=AssetMarketEnd; 
	
	vars prc= series(priceC(0));
	
	printf("# cls2=%.2f,mark2end=%i, market=%i, susp=%i",prc[0],AssetMarketEnd,market(WET,0),suspended());
	
		
	LifeTime=8;
	if (prc[0]>prc[1]) enterLong();
	
	BarZone=ET;
}

Re: Precise AssetMarketStart/End [Re: Zheka] #485676
04/13/22 11:35
04/13/22 11:35
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
That code looks ok. It should suppress enterLong outside AssetMarketStart/End in the AssetMarketZone.

Can you show the log?

Re: Precise AssetMarketStart/End [Re: Zheka] #485694
04/14/22 12:05
04/14/22 12:05
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
Both entry and expiry occur outside of market hrs (930-1601 WET).
Code
[size:8pt][638: Tue 22-01-11 [u]16:30[/u]] -35.54 +2.60 1/9  cls1=1.13620,MarkStart=1800,Assmark1end=1701, market=1, susp=0 cls2=15914.40,mark2end=1601, market=0, susp=0
(GDAXI::L) Skipped (Max = -1)
[GDAXI::L63007][u] Expired[/u] 1@15939.90: +2.48 Bid 15939.28 at 16:45:00
Opn 15917.40 Cls 15939.90 Spr 0.63 Slp 0.00 Rol -0.00 Com 0.07 Lif 9 Net 1

[639: Tue 22-01-11 16:45] -35.66 0 1/9  cls1=1.13663,MarkStart=1800,Assmark1end=1701, market=1, susp=0 cls2=15914.40,mark2end=1601, market=0, susp=0
[GDAXI::L63907] Long 1@15969.90 x at 16:45:00
Com 0.0747  Mrg 1.12  Net 0

[640: Tue 22-01-11 17:00] -36.86 -1.20 1/10  cls1=1.13620,MarkStart=1800,Assmark1end=1701, market=1, susp=0 cls2=15914.40,mark2end=1601, market=0, susp=0
(GDAXI::L) Skipped (Max = -1)

[641: Tue 22-01-11 17:15] -35.16 +0.50 2/9  cls1=1.13569,MarkStart=1800,Assmark1end=1701, market=1, susp=0 cls2=15914.40,mark2end=1601, market=0, susp=0
(GDAXI::L) Skipped (Max = -1)

[642: Tue 22-01-11 17:30] -38.09 -2.43 1/10  cls1=1.13573,MarkStart=1800,Assmark1end=1701, market=1, susp=0 cls2=15914.40,mark2end=1601, market=0, susp=0
(GDAXI::L) Skipped (Max = -1)

[643: Tue 22-01-11 17:45] -36.21 -0.56 1/10  cls1=1.13536,MarkStart=1800,Assmark1end=1701, market=1, susp=0 cls2=15914.40,mark2end=1601, market=0, susp=0
(GDAXI::L) Skipped (Max = -1)

[644: Tue 22-01-11 18:00] -35.75 -0.0894 1/10  cls1=1.13542,MarkStart=1800,Assmark1end=1701, market=1, susp=0 cls2=15914.40,mark2end=1601, market=0, susp=0
(GDAXI::L) Skipped (Max = -1)

[645: Tue 22-01-11 18:15] -36.45 -0.79 1/10  cls1=1.13561,MarkStart=1800,Assmark1end=1701, market=1, susp=0 cls2=15914.40,mark2end=1601, market=0, susp=0
(GDAXI::L) Skipped (Max = -1)

[646: Tue 22-01-11 18:30] -35.75 -0.0894 1/10  cls1=1.13575,MarkStart=1800,Assmark1end=1701, market=1, susp=0 cls2=15914.40,mark2end=1601, market=0, susp=0
(GDAXI::L) Skipped (Max = -1)

[647: Tue 22-01-11 18:45] -35.39 +0.26 2/9  cls1=1.13644,MarkStart=1800,Assmark1end=1701, market=1, susp=0 cls2=15914.40,mark2end=1601, market=0, susp=0
(GDAXI::L) Skipped (Max = -1)
[GDAXI::L63907] Expired 1@15974.40: +0.38 Bid 15973.78 at 19:00:00
Opn 15969.90 Cls 15974.40 Spr 0.63 Slp 0.00 Rol -0.00 Com 0.07 Lif 9 Net 1

[648: Tue 22-01-11 19:00] -35.28 0 2/9  cls1=1.13666,MarkStart=1800,Assmark1end=1701, market=1, susp=0 cls2=15914.40,mark2end=1601, market=0, susp=0
[GDAXI::L64807] Long 1@15978.40 x at 19:00:00
Com 0.0748  Mrg 1.12  Net 0

[649: Tue 22-01-11 19:15] -36.60 -1.32 2/10  cls1=1.13727,MarkStart=1800,Assmark1end=1701, market=1, susp=0 cls2=15914.40,mark2end=1601, market=0, susp=0
(GDAXI::L) Skipped (Max = -1)[/size]

Re: Precise AssetMarketStart/End [Re: Zheka] #485695
04/14/22 12:49
04/14/22 12:49
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
Hmm..There seem to be a problem with series shifting with BR_ASSET altogether (in v 2.47.0 and 2.47.4):
Code
function run() {
	
	set(LOGFILE);
	NumYears=1;
	
	 BarPeriod=15;
	
	BarZone=ET;
	
	Verbose=3;
		
	StartWeek=71800;
	EndWeek=51701;
		
        BarMode = BR_WEEKEND+BR_ASSET;

	   asset("SPY");
	  	
	   vars prcI= series(priceC(0));
	
	   printf("# cls1=%.5f,Mark1Start=%i,mark1end=%i, market=%i, susp=%i",prcI[0],AssetMarketStart,AssetMarketEnd,market(ET,0),suspended());
	
}
produces:
Quote
[87: Tue 22-01-04 20:30] 477.88/478.32\477.71/478.25 -0.03 cls1=478.25000,Mark1Start=730,mark1end=1601, market=1, susp=0
[88: Tue 22-01-04 20:45] 478.26/478.48\477.91/478.38 -0.03 cls1=478.38000,Mark1Start=730,mark1end=1601, market=1, susp=0
[89: Tue 22-01-04 21:00c] 478.38/478.96\477.44/477.51 -0.03 cls1=477.51001,Mark1Start=730,mark1end=1601, market=0, susp=8

[90: Tue 22-01-04 21:15c] 477.51/477.65\477.25/477.34 -0.03 cls1=477.34000,Mark1Start=730,mark1end=1601, market=0, susp=8

[91: Tue 22-01-04 21:30c] 477.35/477.58\477.25/477.41 -0.03 cls1=477.41000,Mark1Start=730,mark1end=1601, market=0, susp=8
[92: Tue 22-01-04 21:45c] 477.42/477.48\477.28/477.48 -0.03 cls1=477.48001,Mark1Start=730,mark1end=1601, market=0, susp=8
[93: Tue 22-01-04 22:00c] 477.48/477.48\477.35/477.42 -0.03 cls1=477.42001,Mark1Start=730,mark1end=1601, market=0, susp=8


Update: it works for FX and IND, but not for SPY

Last edited by Zheka; 04/14/22 13:26.
Page 3 of 7 1 2 3 4 5 6 7

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