Gamestudio Links
Zorro Links
Newest Posts
How does Zorro handle new strategy/asset?
by jcl
0 seconds ago
Intercept Friday Daily Close
by Dalla
27 minutes 22 seconds ago
Montecarlo statistical mode parameter optimization
by brax
Today at 14:14
New Zorro v1.99.2
by jcl
Today at 14:03
automation
by MINER
Today at 13:37
What are you working on?
by CocaCola
Today at 02:42
About 1M entities!
by txesmi
Yesterday at 14:16
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
13 registered (AndrewAMD, Dalla, kvm, Realspawn, Hredot, mabro41, jenGs, brax, 3 invisible), 193 Guests and 9 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
Thomas_Thornton, rssflc, mahomed, bondz, Neil_G
18119 Registered Users
Topic Options
Rate This Topic
#474328 - 10/06/18 19:21 Delay Opening trades
MatPed Offline
User

Registered: 02/28/15
Posts: 506
Loc: Milano, Italy
If I want to randomly open trades from 1 to 5 minute later than bar closing period (as z7) with Hedge active how can I do?

May I change BarOffset during trading?

This script works in test, I do not logically correct.
Changing BarOffset every bar am I loosing price info in the bar?

Thank You

Code:
void run()
{
	set(LOGFILE); 	
	MaxLong	= 100;
	MaxShort	= 1;
	
	BarPeriod =60;
	
	if (TrainMode) BarOffset = 0;
	else BarOffset = random(6);
	
	enterLong();
	
}


Top
#474331 - 10/07/18 08:27 Re: Delay Opening trades [Re: MatPed]
Spirit Offline
Moderator

Registered: 09/02/03
Posts: 791
You can see in the log if this works, but i think not, baroffset probably cannot change. How about Entrydelay?

Top
#474332 - 10/07/18 12:01 Re: Delay Opening trades [Re: Spirit]
MatPed Offline
User

Registered: 02/28/15
Posts: 506
Loc: Milano, Italy
Thank You Spirit, in the log it works, but is not logically sound.

EntryDelay seems to be a suitable solution but is not compatible with Hedge = 5, accordingly with the Manual.

In z7 Hedge is not used and the delay is fixed for each bar.
I could test it live, but it will take a lot of time. Maybe somebody as already a solution


Edited by MatPed (10/07/18 12:01)

Top
#474373 - 10/10/18 12:13 Re: Delay Opening trades [Re: MatPed]
MatPed Offline
User

Registered: 02/28/15
Posts: 506
Loc: Milano, Italy
Up

Top
#474384 - 10/11/18 08:35 Re: Delay Opening trades [Re: MatPed]
jcl Online

Chief Engineer

Registered: 07/22/00
Posts: 26658
Loc: Frankfurt
It`s OrderDelay, not EntryDelay.

Top
#474389 - 10/11/18 10:09 Re: Delay Opening trades [Re: jcl]
MatPed Offline
User

Registered: 02/28/15
Posts: 506
Loc: Milano, Italy
Thank you JCL
The manual state "OrderDelay is not recommended in combination with Virtual Hedging. As it opens and closes trades not at bar boundaries, it can cause trades to be opened and closed shortly afterwards by another trade in opposite direction after the given delay. This causes loss of spread and commission."

2 questions:
- It si not recomended for loss in commission?, but it works?
- There is another method? more compatible with VH?

Thank you

Top
#474390 - 10/11/18 10:21 Re: Delay Opening trades [Re: MatPed]
jcl Online

Chief Engineer

Registered: 07/22/00
Posts: 26658
Loc: Frankfurt
Yes, it is not recommended because it does not make much sense for saving trading costs, but technically you can do it.

Top
#474391 - 10/11/18 10:25 Re: Delay Opening trades [Re: jcl]
MatPed Offline
User

Registered: 02/28/15
Posts: 506
Loc: Milano, Italy
ok, thank you

Top



Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de