https://www.notion.so/Hedging-Trades-1d6b97def6bd8093a063c4197e7beb7e?pvs=4
Parameters
Spot Gold Symbol
Spot Future Symbol
Initial Lot Size
Hedge Distance
Lot Sequence
TP for Initial Trade
TP Sequence For Hedge
TP = Difference of all buy qty and all sell qty * pips
Include Spread/swap/commission in all transactions
Trigger pairs
Trade Closure
Parallel trades
Initial Lot - 0.02; Hedge distance: 2
| Price | Buy | Sell |
|---|---|---|
| 100 | 0.02 |
| Price | Buy | Sell |
|---|---|---|
| 100 | 0.02 | |
| 98 | 0.04 |
| Price | Buy | Sell |
|---|---|---|
| 100 | 0.02 0.08 | |
| 98 | 0.04 |
| Price | Buy | Sell |
|---|---|---|
| 100 | 0.02 0.08 | |
| 98 | 0.12 | 0.04 0.16 |
Case 1: Now check for the TP of all three trades based on the TP sequence. When the price goes above 100
Case 2: Close the 0.08 Buy and 0.16 Sell at 0 profit/loss when the price goes below 98 and trigger another pair trade if the trade count is not equal to the last trade position count.
| Price | Buy | Sell |
|---|---|---|
| 100 | 0.02 0.08 | |
| 98 | 0.12 | 0.04 0.16 |
| 96 | 0.18 | 0.24 |
Case 1: Now check for the TP of all three trades based on the TP sequence. When the price goes above 98
Case 2: Close the 0.12 Buy and 0.24 Sell at 0 profit/loss when the price goes below 96 and trigger another pair trade if the trade count is not equal to the last trade position count.
Keep looping this until the last trade position is hit
If last trade position count is hit
If Add Futures as last trade is ON
Example here, close the buy and sell pairs and the last buy will be active, and to the same qty of the buy trigger, a gold futures at the same instance when closing the pairs.
| Price | Buy | Sell |
|---|---|---|
| 100 | 0.02 0.08 | |
| 98 | 0.12 | 0.04 0.16 |
| 96 | 0.18 | 0.24 |
| 94 |
After closing 0.12 and 0.24 we have 0.18 Buy will open 0.18 Futures sell.
Now check the Sum of Spot buy and futures sell = Futures TP is so close it or wait till that.
If Close last trade is ON
| Price | Buy | Sell |
|---|---|---|
| 100 | 0.02 0.08 | |
| 98 | 0.12 | 0.04 0.16 |
| 96 | 0.18 | 0.24 |
| 94 |
Parallel trades
If Add Futures as last trade is ON
and it gets hedged with a futures
Restart a new cycle.
Based on the max cycles, we can keep adding new cycles.