Hedging

As of version 1.1, we have added the ability to hedge a strategy through hedging actions. The idea is that a user can now place an order based on their strategy's long/short exposure, which essentially grants the ability to hedge a strategy with some asset.

Before reading ahead, make sure you have read the Stock Signals tutorial.

Hedging Actions

The two hedging actions are Hedge With Exposure(HWE) and Hedge Against Exposure(HAE), which each act as their name suggests.

Hedging Unit Types

These hedging actions can only be used with some specific hedging unit types, that each behave slightly differently.

Percent of Long Exposure (%LONGEXP)

Examples

Each strategy below examines what happens when hedging with different types of portfolios.

Note that hedging actions still support the different order types, time in force, prices, etc. that regular actions support. For the purpose of these examples, we are using simple signals.

Strategy 1 and 2 are basic cases, but please go over them briefly.

We highly recommend you read the examples under Strategy 3, so you can understand exactly how hedging is handled in APM.

Strategy 1

Suppose our current strategy contains the stocks:

AAPL (long $10,000)

IBM (long $5,000)

MSFT (short $4,000)

Now we will look at what happens with various signals:

1) Use SH (Proshares Short ETF) to hedge with our long exposure

We are long $15,000, so we would go LONG $7,500 of SH.

2) Use SH to hedge with our short exposure

We are short $4,000, so we would go SHORT $2,000 of SH

3) Use SH to hedge with our net exposure

Our net exposure is $11,000, so we would go LONG $5,500 of SH

4) Use SPY to hedge against our long exposure

We are long $15,000, so we would go SHORT $7,500 of SPY.

5) Use SPY to hedge against our short exposure

We are short $4,000, so we would go LONG $2000 of SPY

6) Use SPY to hedge against our net exposure

Our net exposure is $11,000, so we would go SHORT $5,500 of SPY

Strategy 2

Suppose our current strategy contains the stocks:

AAPL (long $1,000)

IBM (long $4,000)

MSFT (short $10,000)

1) Use SH to hedge with our net exposure

Our net exposure is -$5,000, so we would go SHORT $2,500 of SH

2) Use SPY to hedge against our net exposure

Our net exposure is -$5,000, so we would go LONG $2,500 of SPY

Strategy 3

Suppose our current strategy contains the same stocks as Strategy 1:

AAPL (long $10,000)

SH (long $5,000)

MSFT (short $4,000)

But now we will use SH to hedge:

1) Use SH to hedge with our short exposure.

Our short exposure is $4,000, so we would go SHORT $400 of SH.

Since we are currently LONG $5,000 of SH, we would SELL $5,400 of SH.

2) Use SH to hedge with our long exposure

Our long exposure is $10,000 without SH, so we would go LONG $1,000 of SH.

However, we are currently LONG $5,000 of SH, so we have to SELL $4,000 of SH.

Why do we exclude SH when calculating long exposure? We assume that we are using SH to hedge against the rest of the portfolio. It wouldn't make sense to include SH in the long exposure calculation since then we would essentially be using SH to hedge against SH.

The same is true for short and net exposure calculations.

Limitations

1) It only makes sense to hedge with one stock in most cases. For example, take the portfolio:

MSFT (long $10,000)

and try hedging with it using SH and TLT:

We process the SH signal first, so we go LONG $1,000 of SH.

Now we process the TLT signal (suppose after the SH order has been executed), but now our long exposure is $11,000, so we would go LONG $1,100 of TLT, which is $100 more than we wanted since we did not want to include SH in the calculation.

Similarly, hedging with multiple stocks using net exposure will also fail since the net exposure calculation will include the other hedges as well.

On the bright side, this issue does not occur when you hedge against long/short exposure. In this case, you are not including the stocks you are using to hedge in the actual long/short exposure calculation.

2) The other limitation is that you cannot hedge for strategies using screeners, since they don't take hedging signals.

As of version 1.1, we have added the ability to hedge a strategy through hedging actions. The idea is that a user can now place an order based on their strategy's long/short exposure, which essentially grants the ability to hedge a strategy with some asset.

Before reading ahead, make sure you have read the Stock Signals tutorial.

Hedging Actions

The two hedging actions are Hedge With Exposure(HWE) and Hedge Against Exposure(HAE), which each act as their name suggests.

Hedging Unit Types

These hedging actions can only be used with some specific hedging unit types, that each behave slightly differently.

Percent of Long Exposure (%LONGEXP)

- Open a position based on only the long exposure of your strategy (i.e. sum of the exposure of all your long stocks)

- Note that in this case, HWE means you will be going long, and HAE means you will be going short

- Open a position based on only the short exposure of your strategy (i.e. sum of the exposure of all your short stocks)

- Note that in this case, HWE means you will be going short, and HAE means you will be going long

- Open a position based on the net exposure of your strategy (i.e. long exposure - short exposure)

- Note that in this case, HWE and HAE don't necessarily mean you will go long or short (see below for examples)

- Open a position based on only the long exposure of all your strategies (i.e. sum of the exposure of all your long stocks)

- Note that in this case, HWE means you will be going long, and HAE means you will be going short

- Open a position based on only the short exposure of all your strategies (i.e. sum of the exposure of all your short stocks)

- Note that in this case, HWE means you will be going short, and HAE means you will be going long

- Open a position based on the net exposure of all your strategies (i.e. long exposure - short exposure)

- Note that in this case, HWE and HAE don't necessarily mean you will go long or short (see below for examples)

Examples

Each strategy below examines what happens when hedging with different types of portfolios.

Note that hedging actions still support the different order types, time in force, prices, etc. that regular actions support. For the purpose of these examples, we are using simple signals.

Strategy 1 and 2 are basic cases, but please go over them briefly.

We highly recommend you read the examples under Strategy 3, so you can understand exactly how hedging is handled in APM.

Strategy 1

Suppose our current strategy contains the stocks:

AAPL (long $10,000)

IBM (long $5,000)

MSFT (short $4,000)

Now we will look at what happens with various signals:

1) Use SH (Proshares Short ETF) to hedge with our long exposure

`HWE SH 50 %LONGEXP`

2) Use SH to hedge with our short exposure

`HWE SH 50 %SHORTEXP`

3) Use SH to hedge with our net exposure

`HWE SH 50 %NETEXP`

4) Use SPY to hedge against our long exposure

`HAE SPY 50 %LONGEXP`

5) Use SPY to hedge against our short exposure

`HAE SPY 50 %SHORTEXP`

6) Use SPY to hedge against our net exposure

`HAE SPY 50 %NETEXP`

Strategy 2

Suppose our current strategy contains the stocks:

AAPL (long $1,000)

IBM (long $4,000)

MSFT (short $10,000)

1) Use SH to hedge with our net exposure

`HWE SH 50 %NETEXP`

2) Use SPY to hedge against our net exposure

`HAE SPY 50 %NETEXP`

Strategy 3

Suppose our current strategy contains the same stocks as Strategy 1:

AAPL (long $10,000)

SH (long $5,000)

MSFT (short $4,000)

But now we will use SH to hedge:

1) Use SH to hedge with our short exposure.

`HWE SH 10 %SHORTEXP`

Since we are currently LONG $5,000 of SH, we would SELL $5,400 of SH.

2) Use SH to hedge with our long exposure

`HWE SH 10 %LONGEXP`

However, we are currently LONG $5,000 of SH, so we have to SELL $4,000 of SH.

Why do we exclude SH when calculating long exposure? We assume that we are using SH to hedge against the rest of the portfolio. It wouldn't make sense to include SH in the long exposure calculation since then we would essentially be using SH to hedge against SH.

The same is true for short and net exposure calculations.

Limitations

1) It only makes sense to hedge with one stock in most cases. For example, take the portfolio:

MSFT (long $10,000)

and try hedging with it using SH and TLT:

` HWE SH 10 %LONGEXP`

HWE TLT 10 %LONGEXP

We process the SH signal first, so we go LONG $1,000 of SH.

Now we process the TLT signal (suppose after the SH order has been executed), but now our long exposure is $11,000, so we would go LONG $1,100 of TLT, which is $100 more than we wanted since we did not want to include SH in the calculation.

Similarly, hedging with multiple stocks using net exposure will also fail since the net exposure calculation will include the other hedges as well.

On the bright side, this issue does not occur when you hedge against long/short exposure. In this case, you are not including the stocks you are using to hedge in the actual long/short exposure calculation.

2) The other limitation is that you cannot hedge for strategies using screeners, since they don't take hedging signals.