|
Re: Precise AssetMarketStart/End
[Re: Spirit]
#485532
03/19/22 17:54
03/19/22 17:54
|
Joined: Jul 2017
Posts: 784
Zheka
OP
User
|
OP
User
Joined: Jul 2017
Posts: 784
|
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: jcl]
#485638
04/05/22 14:25
04/05/22 14:25
|
Joined: Jul 2017
Posts: 784
Zheka
OP
User
|
OP
User
Joined: Jul 2017
Posts: 784
|
"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). 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]
#485665
04/11/22 10:34
04/11/22 10:34
|
Joined: Jul 2017
Posts: 784
Zheka
OP
User
|
OP
User
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. 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]
#485694
04/14/22 12:05
04/14/22 12:05
|
Joined: Jul 2017
Posts: 784
Zheka
OP
User
|
OP
User
Joined: Jul 2017
Posts: 784
|
Both entry and expiry occur outside of market hrs (930-1601 WET). [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
Zheka
OP
User
|
OP
User
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): 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: [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.
|
|
|
|