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
2 registered members (Quad, aliswee), 835 guests, and 5 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 6 of 7 1 2 3 4 5 6 7
Re: Precise AssetMarketStart/End [Re: Zheka] #485806
04/22/22 12:15
04/22/22 12:15
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Yes, all time periods are treated in the same way. Only BR_NOSHIFT still shifts bars when not only the timestamp, but any part falls in market hours.

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

Joined: Jul 2017
Posts: 783
Sorry, this did not make it clearer.

If I want to use historical data for 930-1600 in strategy calculations AND trading be restricted to that period (i.e. BarMode=BR_NOSHIFT+BR_LOCAL+BR_LEISURE), what should AssetMarketStart/End be set to?


Last edited by Zheka; 04/22/22 13:00.
Re: Precise AssetMarketStart/End [Re: Zheka] #485808
04/22/22 15:34
04/22/22 15:34
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
If you want to exclude the 9:30 bar: 931-1600. Otherwise, 930-1600.

Re: Precise AssetMarketStart/End [Re: Zheka] #485809
04/22/22 16:06
04/22/22 16:06
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
So, bar 1600-1630 will be excluded and the last trade of the 'day' be allowed at (but not past) 1600, correct?

Re: Precise AssetMarketStart/End [Re: Zheka] #485810
04/23/22 07:55
04/23/22 07:55
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Yes, the 16:30 bar will be excluded anyway. The 16:00 bar at the market end will be excluded from trading - remember, the market time period does not include its end - but will still shift because a part of that bar is inside market hours.

If you want to allow trading at the 16:00 market end, set AssetMarketEnd to 16:01.

I think all this is relatively easy to understand.

Re: Precise AssetMarketStart/End [Re: Zheka] #485811
04/23/22 11:09
04/23/22 11:09
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
But setting AssetMarketEnd to 1601 will then include the 1600-1630 bar (because open at 1600 will be within market hours)!?

BR_NOSHIFT and BR_LOCAL treating AssetMarketEnd differently makes them unusable together (+ BR_LEISURE) - which is the most common use case.

The market "ends" at 1600 - so i don't want to include the 1600-1630 bar into any calculations AND i would like to trade at market close, at 1600.

I understand the difference in treating time borders between bar timestamps and other 'time periods". Inconsistent, but changing might break prior code. Get that.

But BR_NOSHIFT is just a recently introduced functionality, just a flag; can be set/unset at will without any regard to legacy limitations.

PLEASE make BR_NOSHIFT AND BR_LOCAL interoperable. Or suggest a workable alternative.

Thank you!

Re: Precise AssetMarketStart/End [Re: Zheka] #485812
04/23/22 11:28
04/23/22 11:28
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
You have a point here. We will remove the special handling of BR_NOSHIFT for the next update. It will then behave like BR_LEISURE.

Re: Precise AssetMarketStart/End [Re: Zheka] #485813
04/23/22 11:44
04/23/22 11:44
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
Thank you!

Re: Precise AssetMarketStart/End [Re: Zheka] #485826
04/26/22 11:49
04/26/22 11:49
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
I just tested v2.47.8 - all good.

Re: Precise AssetMarketStart/End [Re: Zheka] #486034
06/02/22 14:19
06/02/22 14:19
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
In 2.49.3 (and probably prior), BR_LOCAL+BR_LEISURE do no work in Train for closing trades:
Code
function run() {
	
	set(LOGFILE);
	NumYears=1;
	
        BarPeriod=15;
	
	BarZone=ET;
		
	StartWeek=71800;
	EndWeek=51701;
	
	set(PARAMETERS);
	
BarMode = BR_WEEKEND+BR_NOSHIFT+BR_LOCAL+BR_LEISURE;

MaxLong=-1;

	asset("EUR/USD");
		
	  AssetMarketZone=ET; 
	  AssetMarketStart = 1800;
	  AssetMarketEnd = 1701;

int i=optimize(5,5,6,1);
	
	int etTod = ltod(ET,0);
	
	if(etTod==1500) enterLong();
	
	if (etTod>AssetMarketEnd-1 and etTod<AssetMarketStart)
		exitLong();		
}
In Test, the script opens 1 trade and never closes it - as expected.

But in Train, it opens/closes 105 trades.
Quote
Parameter 1 step 1: 5.00 => 0.07 24/81
Parameter 1 step 2: 6.00 => 0.07 24/81
Selected p1[1] = +5.50 => 0.05


2) Also, the manual states for BR_LOCAL: " ...This also affects bar generation when set before the first asset call."
This doesn't seem to work:
Quote
[92: Mon 22-01-03 22:00] -0.0920 -0.0920 0/1 1.12981/1.12993\1.12969/1.12974 -0.00004
[93: Mon 22-01-03 22:30c] -0.40 -0.40 0/1 1.12975/1.12977\1.12943/1.12943 -0.00004
Can't exit [EUR/USD::L08401] outside market hours

[94: Mon 22-01-03 22:45c] -0.29 -0.29 0/1 1.12943/1.12962\1.12943/1.12954 -0.00004
Can't exit [EUR/USD::L08401] outside market hours

[95: Mon 22-01-03 23:00] -0.28 -0.28 0/1 1.12954/1.12965\1.12951/1.12955 -0.00004
[96: Mon 22-01-03 23:15] -0.0620 -0.0620 0/1 1.12955/1.12978\1.12955/1.12977 -0.00004


3) If trade closing happens to fall 'outside market hours' -what will happen in Live? Will a trade be closed at 'market open'?
If yes, it makes sense to make this consistent across Train-Test-Live. OR mention this nuance explicitly in the manual.


Please also check if BR_NOSHIFT works in Train.




Last edited by Zheka; 06/02/22 15:41.
Page 6 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