2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Precise AssetMarketStart/End
#485280
02/16/22 13:47
02/16/22 13:47
|
Joined: Jul 2017
Posts: 785
Zheka
OP
User
|
OP
User
Joined: Jul 2017
Posts: 785
|
It is a reality that the market in MT4/5 closes at 16:59 EST each day (at 16:55 on Fri); + spreads widen towards market close (in fx)- so I want to "close" the hour 3-5 min earlier.
Yet, using AssetMarketEnd=1657, Zorro "rounds" the time to the nearest BarPeriod and takes the tick of 17:00 as the close for the last candle.
I find value in using the bars ending at normal hour boundaries and don't want to use BarOffset.
So, it would be great if candle prices were limited precisely by the time specified as AssetMarketEnd - both in Test and in Live, and no trades were allowed past the time specified.
Thank you.
Last edited by Zheka; 02/16/22 14:24.
|
|
|
Re: Precise AssetMarketStart/End
[Re: Zheka]
#485285
02/16/22 23:09
02/16/22 23:09
|
Joined: Jul 2017
Posts: 785
Zheka
OP
User
|
OP
User
Joined: Jul 2017
Posts: 785
|
When using several assets: function run() {
set(LOGFILE);
NumYears=1;
BarPeriod=30;
BarMode = BR_ASSET;
asset("EUR/USD");
vars prcI= series(priceC(0));
printf("# FXcls=%.5f,markend=%i",prcI[0],AssetMarketEnd);
asset("WS30");
vars prc= series(priceC(0));
printf("# WScls=%.2f,markend=%i",prc[0],AssetMarketEnd);
asset("XAUUSD");
vars prc= series(priceC(0)); vars Opn = series(priceO(0));
printf("# XAU_cls =%.2f,opn=%.2f,markend=%i",prc[0],Opn[0],AssetMarketEnd);
} i see the following output: [189: Thu 22-01-06 21:00] (1788.20) FXcls=1.12912,markend=1656 WScls=36254.00,markend=1658 XAUcls =1788.20,opn=1789.34,markend=1657
[190: Thu 22-01-06 21:30] (1789.81) FXcls=1.12926,markend=1656 WScls=36279.00,markend=1658 XAUcls =1789.81,opn=1788.20,markend=1657
[191: Thu 22-01-06 22:00] (1790.81) FXcls=1.12985,markend=1656 WScls=36279.00,markend=1658 XAUcls =1789.81,opn=1788.20,markend=1657
[192: Thu 22-01-06 22:30] (1790.81) FXcls=1.12970,markend=1656 WScls=36279.00,markend=1658 XAUcls =1789.81,opn=1788.20,markend=1657
[193: Thu 22-01-06 23:00] (1790.81) FXcls=1.12963,markend=1656 WScls=36279.00,markend=1658 XAUcls =1789.81,opn=1788.20,markend=1657
[194: Thu 22-01-06 23:30] (1791.17) FXcls=1.12975,markend=1656 WScls=36313.00,markend=1658 XAUcls =1791.17,opn=1789.30,markend=1657 The last candle of the day on EUR/USD has a close price from the tick at 1700 EST (with AssetMarketEnd=1656), BUT on WS30 and XAU - it is from 1630EST (2130 UTC) - while AssetMarketEnd are 1658 and 1657.
|
|
|
Re: Precise AssetMarketStart/End
[Re: Zheka]
#485302
02/19/22 17:44
02/19/22 17:44
|
Joined: Jul 2017
Posts: 785
Zheka
OP
User
|
OP
User
Joined: Jul 2017
Posts: 785
|
What's the benefit or necessity of treating 00:00 as "inclusive of" for bars, but "exclusive of" for market hours/days, etc? Why would day(0) return "next day" for a bar spanning 2000-0000? As for BR_ASSET: 1) can you pls explain the log in OP, specifically, the price series for EUR/USD. 2) this script: function run() {
set(LOGFILE);
NumYears=1;
BarPeriod=15;
BarZone=ET;
BarMode = BR_ASSET;
MaxLong=1;
asset("EUR/USD");
AssetMarketZone=ET;
AssetMarketStart = 0930;
AssetMarketEnd = 1601;
vars prcI= series(priceC(0));
printf("# cls1=%.5f,mark1end=%i",prcI[0],AssetMarketEnd);
asset("SPY");
AssetMarketZone=ET;
AssetMarketStart = 0930;
AssetMarketEnd = 1601;
vars prc= series(priceC(0));
printf("# cls2=%.2f,mark2end=%i",prc[0],AssetMarketEnd);
LifeTime=10;
if (ltod(ET,0)>AssetMarketEnd)
if (prc[0]>prc[1])
enterLong();
} gives this output: [565: Mon 22-01-10 21:00] (465.55) FXcls=1.13263,markend=1601 WScls=465.55,markend=1601
[566: Mon 22-01-10 21:15] (465.42) FXcls=1.13263,markend=1601 WScls=465.55,markend=1601 [SPY::L56606] Long 1@465.47 x at 21:15:00
[567: Mon 22-01-10 21:30] 0.0850 +0.0850 1/0 (465.61) FXcls=1.13263,markend=1601 WScls=465.55,markend=1601 The trades can also expire outside market hours.
|
|
|
Re: Precise AssetMarketStart/End
[Re: Zheka]
#485508
03/18/22 15:30
03/18/22 15:30
|
Joined: Jul 2017
Posts: 785
Zheka
OP
User
|
OP
User
Joined: Jul 2017
Posts: 785
|
The log above shows a trade taken at 1615ET - past AssetMarketEnd=1601. The manual says that BR_ASSET prevents series shifting AND trade signals outside market hours.
BR_ASSET also does not prevent trade expiry (from LifeTime or TradeExitDate) outside market hours.
Can this pls be looked at?
Last edited by Zheka; 03/18/22 15:31.
|
|
|
Re: Precise AssetMarketStart/End
[Re: Zheka]
#485509
03/18/22 17:15
03/18/22 17:15
|
Joined: Apr 2008
Posts: 586 Austria
Petra
Support
|
Support
Joined: Apr 2008
Posts: 586
Austria
|
|
|
|
|