Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, 7th_zorro, VoroneTZ, Quad), 901 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Can Hedge mode be flipped on and off in multi-asset strategy? #432319
11/04/13 19:40
11/04/13 19:40
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
I am wondering if I can flip between Hedge=0 and Hedge=4 in a multi-asset strategy?

Depending on the asset, different parameters are set and I'm wondering if Hedge can also be safely changed after the asset is set. Some assets in the loop will use Hedge=0 while others will use Hedge=4 mode.

Thanks

Re: Can Hedge mode be flipped on and off in multi-asset strategy? [Re: dusktrader] #432325
11/04/13 20:23
11/04/13 20:23
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
In doing a little testing, it seems that:
* Hedge mode cannot be set after the asset() command
* Hedge mode can be set before asset(), but further mode sets inside the asset() loop are ignored

As a feature request then, if not impossible to do, please consider making it possible to change Hedge on a per-asset basis. Some assets perform better with Hedge=0 while others Hedge=4. It seems on Zorro 1.16 that you can only set it once per strategy.

Thanks

Re: Can Hedge mode be flipped on and off in multi-asset strategy? [Re: dusktrader] #432362
11/05/13 11:51
11/05/13 11:51
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Hedge affects opening and closing of trades, and has nothing to with asset(). I also see nothing to the contrary in the documentation, so it should not be a problem to set Hedge anytime.

Re: Can Hedge mode be flipped on and off in multi-asset strategy? [Re: jcl] #432377
11/05/13 15:55
11/05/13 15:55
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
I hear what you are saying, but it doesn't seem to work that way. If you like I can provide an example demonstrating this. It would be great if Hedge could be changed (throughout a multi-asset strategy, for example) but if not that's fine too.

Re: Can Hedge mode be flipped on and off in multi-asset strategy? [Re: dusktrader] #432382
11/05/13 17:25
11/05/13 17:25
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Can you explain more about your example? In which way does Hedge not seem to work?

Re: Can Hedge mode be flipped on and off in multi-asset strategy? [Re: jcl] #432389
11/05/13 18:53
11/05/13 18:53
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
In a multi-asset strategy, I would like to switch between Hedge=0 and Hedge=4, depending on which asset is chosen.

I have measured the values of what each Hedge mode yields, and that is why I think it is not switching the way I expect. I don't mind putting together a sample code to demonstrate this ... after all, maybe I'm doing something wrong on my end. (Once I get finished with my current task, I'll put together a simple example so you can see what I mean)

Re: Can Hedge mode be flipped on and off in multi-asset strategy? [Re: dusktrader] #432442
11/06/13 11:34
11/06/13 11:34
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Ok, if I get this example in the next 2 days, we can still fix it for 1.20 if it's indeed a bug. So far I can not see any problem with different Hedge settings depending on assets. Check the log - there you can easily see if Hedge works correctly or not. Phantom trades are in winged brackets.

Re: Can Hedge mode be flipped on and off in multi-asset strategy? [Re: jcl] #432444
11/06/13 11:42
11/06/13 11:42
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
I'll have something for you today. I think it's hard to simulate a Hedge issue, but I happened to stumble across one in a tradebot I'm working on. It may not be the most simple example, but its obvious something is not working as expected (ability to switch modes as assets switch, for example)

Re: Can Hedge mode be flipped on and off in multi-asset strategy? [Re: dusktrader] #432465
11/06/13 15:03
11/06/13 15:03
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
At this point, I'm unable to reproduce the issue I saw before. That means it could very well have been something I was doing wrong in the code. The code I'm working on has gone through a lot of improvements since I originally posted about this.

I am going to move forward and utilize the Hedge switching in my strategy, and keep an eye on it. I no longer think this is an issue.

Thanks

Re: Can Hedge mode be flipped on and off in multi-asset strategy? [Re: dusktrader] #432473
11/06/13 16:07
11/06/13 16:07
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
jcl, there is still a possible issue with flipping Hedge mode on and off. I've gone ahead and posted the strategy I'm working on in this thread so you can take a look. Sorry in advance for it not being a simple example.

The issue is that AUDUSD works better with Hedge=4 in my testing. But if I attempt to enable that (code line 179) while leaving the other 2 assets on Hedge=0, I get a Zorro crash during Test.

I have been able to get the Hedge mode to switch back and forth, but sometimes it does this and crashes. Therefore, it seems that it could be an (intermittent) bug.

Page 1 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1