Margin=0 vs. Virtual Hedging Bug?

Posted By: DdlV

Margin=0 vs. Virtual Hedging Bug? - 05/04/17 01:53

Hi jcl.

I updated to 1.54 over this past weekend. The manual said trades could not be resumed, so per the manual I have 1.50 still running Z12 with Margin=0 to close out the old trades.

Per the VPS vendor, I also updated Windows which required stopping 1.50 for the reboot.

1.50 had 2 virtual long, 1 virtual short, and 2 real long USD/JPY trades that were resumed when I restarted it.

One of the virtual longs was stopped, causing both the real longs to be closed. This left 1 virtual long and 1 virtual short of exactly the same size, netting to no real trade.

Now the virtual short has been stopped, leaving the virtual long. In response, Zorro has entered a real long, despite Margin=0!

Shouldn't the logic be to see that Margin=0 and instead close the virtual long?

Thanks.
Posted By: jcl

Re: Margin=0 vs. Virtual Hedging Bug? - 05/05/17 13:46

No, since you have still open a long trade, and the real trades must always reflect the virtual trades. Wait until the last trade terminates.
Posted By: DdlV

Re: Margin=0 vs. Virtual Hedging Bug? - 05/05/17 14:31

Well...

Synchronizing real and virtual can happen either way.

What you're describing presupposes the choice of giving priority to Virtual Hedging over Margin=0.

I'm suggesting the priority should be the reverse. If I set Margin=0, I don't want any new margin (virtual or real) used, period. Which is easily accomplished by simply closing the virtual.

Thanks.
Posted By: jcl

Re: Margin=0 vs. Virtual Hedging Bug? - 05/05/17 16:34

http://manual.zorro-project.com/lots.htm

There is no "priority". Margin = 0 just means that no new trades are opened. Already open trades stay open and and real and virtual trades stay in sync, which means real trades can still be opened when virtual trades are closed.

If you want to really close trades, you use the Panic slider, not the Margin slider. But you must be aware that this would reduce the profit.
Posted By: DdlV

Re: Margin=0 vs. Virtual Hedging Bug? - 05/08/17 01:43

Well... Let's look at this from different way(s) then...

"Margin = 0 just means that no new trades are opened" is not a correct statement - I had Margin=0 and a new trade was opened.

In the manual link above it is stated "For investing a certain amount of your account balance, use Margin". This explicitly says that Margin is relative to the account balance - i.e., Real $$$ => Real trades. It also states the same as you said: "If Margin is 0 or negative, no trades are opened". Together with the above statement that Margin is relative to account balance, Margin=0 means no (new) Real trades are entered.

Re. the last paragraph, I don't want to close trades via Panic - I simply want to do what the manual says to do for an upgrade when trades can't be resumed - set Margin=0 and let the existing trades be played out by the old version without entering new trades and without using additional margin in the account. Any new trades and new margin should come solely from the new version.

Is that clearer?

Thanks.
Posted By: jcl

Re: Margin=0 vs. Virtual Hedging Bug? - 05/09/17 11:12

Not really - you seem not to understand that Margin only sets the trade volume, but does not interfere with virtual hedging. But I think we can leave it at that. Just be assured that all is fine, or at least it behaves as it should, and you can wait for the last remaining trade to close. This will then also close the last pool trade.
Posted By: DdlV

Re: Margin=0 vs. Virtual Hedging Bug? - 05/09/17 21:04

Hi jcl. I agree it's time to move on since we seem to be talking past each other. laugh

To wrap up:

I agree that Virtual Hedging seems to be correctly keeping Real Trades in sync with Virtual trades.

I also agree that Margin is not interfering with Virtual Hedging. (To me, this is the same as my earlier statement that VH has priority over Margin.)

I understand that Margin sets the trade volume.

The question is: Which trade volume? Real or Virtual? Per the above presidence, Virtual only. Which allows VH to open new Real trades as needed, even when Margin=0.

My suggestion is that it should be different. Margin should be respected at the Real level as well as Virtual. If Margin=0, the user doesn't want new trades opened, period.

Thanks.
Posted By: jcl

Re: Margin=0 vs. Virtual Hedging Bug? - 05/10/17 09:53

We can not use Margin for pool trades. The net position must be used for pool trades, otherwise virtual hedging would not work. When you want no more pool trades, just close the virtual trades with the panic slider when the net sum is zero. This is then at the cost of giving up potential profit.
Posted By: DdlV

Re: Margin=0 vs. Virtual Hedging Bug? - 05/10/17 12:12

Thanks jcl.

A few other wrap-up thoughts:

I haven't thought it completely through yet, but conceptually there's no reason why Margin couldn't be applied and Virtual trades (possibly partially) closed rather than opening new Real trades.

In the limit case of Margin=0, this is certainly possible - closing the Virtual rather than opening a new Real.

The Panic slider won't work as it would close other trades as well, not just the one in question.

"giving up potential profit" - for the record, the Real trade that was opened in this situation has closed for a (small) loss...

Thanks.
Posted By: jcl

Re: Margin=0 vs. Virtual Hedging Bug? - 05/10/17 13:36

Ok, my last attempt to explain the matter:

When you let a system terminate, you set Margin to 0, but continue already open trades. The purpose of continuing them is not giving up potential profit that would otherwise be made by the system. This means of course that pool trades still can open and close all the time, in order to match the virtual positions. If you just look into your log and compare the virtual and real positions, you'll probably see that exactly that happens.

If you do not want this, you must close the virtual trades. It is as simple as that. Preventing the opening of pool trades, but keeping virtual trades open, makes no sense.
Posted By: DdlV

Re: Margin=0 vs. Virtual Hedging Bug? - 05/11/17 11:24

Thanks jcl. I believe I understand all. I also believe the crux of our misunderstanding is your last sentence: "Preventing the opening of pool trades, but keeping virtual trades open ...". This is NOT what I suggested. I suggested rather than open new Real trades to instead close Virtual trades. This would also keep everything in sync.

If Virtual Hedging is not being used, then at the time one wishes to let a system terminate all (Real) trades are in place and all margin has already been committed at the broker. Margin=0 prevents any new (Real) trades and margin commitment.

My suggestion is it should be the same at the Real level even when using Virtual Hedging.

Might closing the Virtual trades rather than opening new Real ones give up some potential profit? Possibly. But perhaps not if the system has been running a while and might be at or near to expiring. It might actually prevent potential losses. Plus, this potential profit would need to be balanced against the additional margin used by new Real trades, the effect of that on the new version's execution against the same account, the (old) version continuing to run longer than it otherwise would have, & whatever else.

Please note also that closing the virtual trades is not really an option since the only way to do that is nuclear - Panic and close them all. There is no granular way to close only the ones that might have this problem.

The choice is of course yours. If you choose to leave the system as is, please at least add to the documentation something about this interaction to the effect that when Virtual Hedging is being used new Real trades can still be opened even when Margin=0.

Thanks.
Posted By: jcl

Re: Margin=0 vs. Virtual Hedging Bug? - 05/11/17 16:12

No, it would not keep it in sync, as you can see with your own trades. Imagine that real trade you're complaining about had not opened. Then you had a difference of virtual and real positions with all its evil consequences.
Posted By: DdlV

Re: Margin=0 vs. Virtual Hedging Bug? - 05/12/17 12:57

Please don't forget part 2 of the suggestion!

Part 1 is, as you noted above, to not open the Real trade.

Part 2 is to instead respect Margin=0 and close the Virtual trade!

There is thereby no Virtual/Real difference, and therefore none of those evil consequences.

Thanks. Have a great weekend!
Posted By: jcl

Re: Margin=0 vs. Virtual Hedging Bug? - 05/18/17 08:51

Closing not all, but only some virtual trades would work for matching the positions. But I am not really convinced of that solution.
Posted By: DdlV

Re: Margin=0 vs. Virtual Hedging Bug? - 05/24/17 03:10

Well, the solution should follow the intent...

If the intent is Margin=0 takes a back seat to Virtual Hedging and VH can open Real trades and use Real margin even when Margin=0, then the solution would seem to be to update the Manual to include that intent and possible result.

If the intent is Margin=0 means no new Real trades, period, then the Manual seems OK as it is and the solution would be to change how Zorro works.

Thanks.
© 2024 lite-C Forums