Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Nymphodora, Quad), 919 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 5 of 7 1 2 3 4 5 6 7
Re: Precise AssetMarketStart/End [Re: Zheka] #485787
04/21/22 14:56
04/21/22 14:56
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
When you let market hours begin at 7:30, the price at 7:30 is a valid price and the series get shifted. Won't you agree?

Re: Precise AssetMarketStart/End [Re: Zheka] #485789
04/21/22 15:14
04/21/22 15:14
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
The bar covering 715-729.59999 is outside of market hours - so series should not get shifted.
And changing AssetMarketStart forward to 745 is not a convenient solution - this then needs to be done explicitly in each script depending on BarPeriod (rather than be set once and for all in an Asset file).

Re: Precise AssetMarketStart/End [Re: Zheka] #485790
04/21/22 15:29
04/21/22 15:29
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Bars are explained here: https://zorro-project.com/manual/en/bars.htm

A 7:30 bar includes the 7:30 price. If you would not shift the series, the market opening price would be lost. Your series would then begin with the 7:45 price. That is probably not what most users want.


Re: Precise AssetMarketStart/End [Re: jcl] #485792
04/21/22 15:42
04/21/22 15:42
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
Originally Posted by jcl
If you would not shift the series, the market opening price would be lost. The market would then begin with the 7:45 price.
If someone wants to trade at the open, then one can just check if(ltod()==AssetMarketStart)...The market will begin with the candle starting/opening exactly at MarketStart.... but it is unreasonable to shift series(=create/include a candle) prior to the market open in all the price/indicator calculations...Probably no big deal with 5-min bars, but is significant with 60+ min bars...

Trading with BarPeriod=60, why would you want to feed a 630-730 high/low in the ATR calculation?

Last edited by Zheka; 04/21/22 15:46.
Re: Precise AssetMarketStart/End [Re: Zheka] #485793
04/21/22 15:50
04/21/22 15:50
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
You're of course entitled to that opinion, but Zorro handled market times in this way all the time. They are always compared with the bar end timestamp. If you don't want to include the opening price, you can just set the market start at 7:31.

Re: Precise AssetMarketStart/End [Re: Zheka] #485794
04/21/22 15:57
04/21/22 15:57
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
If its just a matter of setting it to 731 - then so be it.

How about the issue demoed in first bit of the log?

Re: Precise AssetMarketStart/End [Re: Zheka] #485795
04/21/22 16:14
04/21/22 16:14
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Same thing. The 19:15 bar is still shifted because it had a valid 19:01 price. If any part of the bar falls in market hours, it is shifted.

If you don't want this, set the market end at 19:00 sharp, not at 19:01.



Re: Precise AssetMarketStart/End [Re: Zheka] #485800
04/21/22 17:47
04/21/22 17:47
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
Brr...This is inconsistent with 1) how e.g. EndWeek works - you have to set it to 51701 to ensure the bar 1600-1700 gets created 2) how BR_ASSET used to work until now and
3) your own message at the beginning of this very thread on 19/02/22 11:23 AM
Quote
That would be indeed an inconsistency. - Update: Time periods usually go from start up to, but not including the end. So there is no such inconsistency,
https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=485280#Post485287
Following our argument, I changed AssetMarketEnd to +1min past market close time and used it like this in all examples/logs.

By the way, for EUR/USD, the series start shifting PAST AssetMarketStart time, unlike with SPY

[99: Tue 22-01-04 00:00] 1.12994/1.13020\1.12982/1.13020 -0.00004 opn1=1.12994,cls1=1.13020,Mark1Start=2000,mark1end=1901, market=1,susp=0,noshift=0
[100: Tue 22-01-04 00:15c] 1.13020/1.13066\1.13014/1.13064 -0.00004 opn1=1.13020,cls1=1.13064,Mark1Start=2000,mark1end=1901, market=0,susp=8,noshift=0
[101: Tue 22-01-04 00:30c] 1.13064/1.13069\1.13039/1.13041 -0.00004 opn1=1.13020,cls1=1.13064,Mark1Start=2000,mark1end=1901, market=0,susp=8,noshift=1
[102: Tue 22-01-04 00:45c] 1.13041/1.13055\1.13040/1.13048 -0.00004 opn1=1.13020,cls1=1.13064,Mark1Start=2000,mark1end=1901, market=0,susp=8,noshift=1
[103: Tue 22-01-04 01:00c] 1.13048/1.13064\1.13040/1.13057 -0.00004 opn1=1.13020,cls1=1.13064,Mark1Start=2000,mark1end=1901, market=0,susp=8,noshift=1 < -noshift=1 here?

[104: Tue 22-01-04 01:15] 1.13057/1.13089\1.13055/1.13085 -0.00004 opn1=1.13057,cls1=1.13085,Mark1Start=2000,mark1end=1901, market=1,susp=0,noshift=0

Last edited by Zheka; 04/21/22 17:53.
Re: Precise AssetMarketStart/End [Re: Zheka] #485804
04/22/22 08:41
04/22/22 08:41
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Normally, time periods such as market hours include their begin, but not their end. Bars are a special case because their timestamp is at their end. So they include the end, but not the begin. And if time periods are negative, such as the EUR/USD in your example, their begin and end are swapped, so you got the noshift at 20:00.

I must agree that this last point is not what you would normally expect, so we will change that. As to the other issues, I'm open for suggestions as long as they only affect the new beta features and don't break existing code.

Re: Precise AssetMarketStart/End [Re: Zheka] #485805
04/22/22 10:27
04/22/22 10:27
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
So, AssetMarketEnd will follow the EndWeek convention, oder? both for BR_NOSHIFT and BR_LOCAL..?

Last edited by Zheka; 04/22/22 10:30.
Page 5 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