Gamestudio Links
Zorro Links
Newest Posts
Series within loop
by Spirit
Today at 03:38
ein Truetype wie ein Bitmap Font laden?
by tagimbul
Yesterday at 21:46
'you' and c_scan
by 3run
Yesterday at 17:24
rayp's old school fast zombie FPS project
by 3run
Yesterday at 11:01
No Trades Using Workshop 6
by peterhw
Yesterday at 10:59
Actual PIP Cost for backtesting
by tradingest
10/14/18 16:36
Rigid Force Alpha - Classic side-scrolling shoot'em up
by Turrican
10/14/18 11:44
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
5 registered (kvm, Ayumi, jenGs, PSA, jumpman), 463 Guests and 4 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
BazGen, pallab1964, wOrlD21, peterhw, 7th_zorro
18076 Registered Users
Topic Options
Rate This Topic
#474328 - 10/06/18 19:21 Delay Opening trades
MatPed Offline
Senior Member

Registered: 02/28/15
Posts: 485
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: 779
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
Senior Member

Registered: 02/28/15
Posts: 485
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
Senior Member

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

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

Chief Engineer

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

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

Registered: 02/28/15
Posts: 485
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 Offline

Chief Engineer

Registered: 07/22/00
Posts: 26529
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
Senior Member

Registered: 02/28/15
Posts: 485
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