Hi everybody! I'm writing an automated trading system that sometimes ends up into the hedge that carries losses. Wanted to know if there is a good way to come out of this hedge. Hedge consists of 8 ES (short) futures and 8 YM (long) futures. Assuming that the correlation between these two markets is perfect (1.0) for simplicity reasons. Unrealized loss carried by this hedge is 400 dollars. To make this even simpler, lets have 8 YM (long) and 8 YM (short) if you need to put out some calculations in points from one market instead of 2 markets. My problem is that I don't see any mathematical solution that I can use to try to come out of the hedge clean (or with minimal losses). Any reasonable suggestion would be appreciated. I know there is no easy way to come out of this without taking some risks, however want to consider different solutions, because ones that I use don't work well.

Once the loss has achieved, the only way to breakeven on the position is to add contracts to one side of the hedge and turn it into a directional trade. Then simply pray the trades goes in your favour. Of course, this defeats the point of being hedged in the first place. So the real answer is that there is no way to do what you want to do without taking on significant risk of further loss. Just close out both sides and wear the loss.

I'm not sure I understand. Can you elaborate as to how hedging on 2 accounts can help me come out of loser hedge?

Close both positions at once. They are liquid so you should have no problem. Hen ask yourself if your system should be putting you in these positions and if it does than is it risk you want? For example lose on initial delta and then cover to make a relative value trade.

The system earns money and then sometimes it doesn't and when it doesn't it goes into 8x8 hedge..... So basically I'm trying to minimize the losses and try to come out of 8x8 hedge that carries unrealized loss of let's say -400 between 2 positions on 2 different markets. I guess I'm looking for a more of a mathematical solution where I can close let's say 2 YMs (+100) and 1 ES (-80) lets say and then slowly downsize the number of positions where at the end I can exit with -100 total loss let's say instead of -400.... Something along these lines. BTW, not sure i understand what you said regarding loosing delta and then cover... Did you mean by loosing ES position (-$100) and then wait YM position to earn +$100 and release YM as well? Can you please elaborate more on your proposal? Thanks.