Dear fellow traders,
first I apologize for my bad english, since I'm not an english native speaker.
I'm posting here a spreadsheet that we use in our company (an european company) to hedge currency risk (mainly against US Dollar).
You can use the .xls freely. It can help you to understand how to do a good dynamic hedging and eventually propose it to a company.
It would be nice to create an EA that can monitor the market and adjust the position hands free. For this pouposis I'm asking your help. It should not be very hard because the spreadsheet is pretty simple.
The following example can illustrate what we do and why:
on 30 Jan we conclude a contract to pay 1.000.000 USD when we receive the goods we purchased. It is programmed to receive the good 5 weeks ahead, since good came from far east.
on Jan 30 the goods cost us, say, 800.000 euros (EURUSD 1,2500), but five weeks after the value of EURUSD will be probably be different, making for us a loss or a gain.
So we decided to dynamic hedge our exposure taking a partial short position on EURUSD based on volatilty (risk for us) and a trailing sell stop for remainder part of the exposure. We rewieved the position once a day and update the sell stop. In this way we can have a fixed maximum loss (say 2% of the value of the contract) that we can manage without problems.
This dynamic hedging strat has work great for years, expecially because the EURUSD has been on the rise, but also becuase volatility was low and very constant (around 8%-11%).
In the last 3-4 months things have changed, volatilty has skyrocketed and seems that not want to came down to more normal values. We think that in this environment it should be better to reduce the fime frame of the hedging and the 4h should do the trick. But to do so we need to automate the spreadsheet and I'm here to ask your help.
Here is what the EA should do (in the parentesis are the corresponding cell of the spreadsheet):
when it's put on the chart the trader must indicate in the imput value:
1. the value of the contract (C3)
2. the relevant EURUSD change (C4)
3. the max loss allowed (C5)
then the EA will calculate
4. the contract value in Euros (C7)
5. the number of minilots to cover all the exposure (C8)
6. the volatilty at current bar (E372)
7. the Delta (G372) - this is the amount of short minilots that we want to have based on current volatility and max loss.
8. verify how much minilots we have, compare to the actual Delta and if different trade accordingly to have the exact amount of short minilots (H372)
9. calculate the price at which we put the sell stop (K372) - this is indeed a trailing sell stop, so it will be based on the Highest close of the relevant time frame (F372)
10. calculate the amount of minilots of the sell stop (L372) - this is the simple difference of the all exposure and the current delta
11. amend the old trailing sell stop accordingly to point 9. and 10.
Now if the Trailing sell stop is hit stop all calculation, the EA will not do other operation (see Example 2 sheet). This condition indeed should be preliminar to the 6. point, so the EA should not perform point 6. - 11. if the current position is equal to the total exposure (C8) - this event will happen if from the close of the bar and the next the trailing stop is hit, but also if I manually sell the quantity to have the total exposure cover.
Hope to have been clear, and also that someone would be spend a bit of time coding a good hedging strategy that can use himself.
Thanks
first I apologize for my bad english, since I'm not an english native speaker.
I'm posting here a spreadsheet that we use in our company (an european company) to hedge currency risk (mainly against US Dollar).
You can use the .xls freely. It can help you to understand how to do a good dynamic hedging and eventually propose it to a company.
It would be nice to create an EA that can monitor the market and adjust the position hands free. For this pouposis I'm asking your help. It should not be very hard because the spreadsheet is pretty simple.
The following example can illustrate what we do and why:
on 30 Jan we conclude a contract to pay 1.000.000 USD when we receive the goods we purchased. It is programmed to receive the good 5 weeks ahead, since good came from far east.
on Jan 30 the goods cost us, say, 800.000 euros (EURUSD 1,2500), but five weeks after the value of EURUSD will be probably be different, making for us a loss or a gain.
So we decided to dynamic hedge our exposure taking a partial short position on EURUSD based on volatilty (risk for us) and a trailing sell stop for remainder part of the exposure. We rewieved the position once a day and update the sell stop. In this way we can have a fixed maximum loss (say 2% of the value of the contract) that we can manage without problems.
This dynamic hedging strat has work great for years, expecially because the EURUSD has been on the rise, but also becuase volatility was low and very constant (around 8%-11%).
In the last 3-4 months things have changed, volatilty has skyrocketed and seems that not want to came down to more normal values. We think that in this environment it should be better to reduce the fime frame of the hedging and the 4h should do the trick. But to do so we need to automate the spreadsheet and I'm here to ask your help.
Here is what the EA should do (in the parentesis are the corresponding cell of the spreadsheet):
when it's put on the chart the trader must indicate in the imput value:
1. the value of the contract (C3)
2. the relevant EURUSD change (C4)
3. the max loss allowed (C5)
then the EA will calculate
4. the contract value in Euros (C7)
5. the number of minilots to cover all the exposure (C8)
6. the volatilty at current bar (E372)
7. the Delta (G372) - this is the amount of short minilots that we want to have based on current volatility and max loss.
8. verify how much minilots we have, compare to the actual Delta and if different trade accordingly to have the exact amount of short minilots (H372)
9. calculate the price at which we put the sell stop (K372) - this is indeed a trailing sell stop, so it will be based on the Highest close of the relevant time frame (F372)
10. calculate the amount of minilots of the sell stop (L372) - this is the simple difference of the all exposure and the current delta
11. amend the old trailing sell stop accordingly to point 9. and 10.
Now if the Trailing sell stop is hit stop all calculation, the EA will not do other operation (see Example 2 sheet). This condition indeed should be preliminar to the 6. point, so the EA should not perform point 6. - 11. if the current position is equal to the total exposure (C8) - this event will happen if from the close of the bar and the next the trailing stop is hit, but also if I manually sell the quantity to have the total exposure cover.
Hope to have been clear, and also that someone would be spend a bit of time coding a good hedging strategy that can use himself.
Thanks
Attached File(s)
IMPORT DYNAMIC HEDGE.xls
460 KB
|
1,309 downloads