48 lines
2.4 KiB
Plaintext
48 lines
2.4 KiB
Plaintext
This test verifies that fractional hedges work. That is, when a fill in a quoting leg does
|
|
not equate to one full contract in the hedging leg, we accumulate the unhedged
|
|
delta, until we can send one or more hedging contracts.
|
|
|
|
0. This needs sim with replay turned off (see step 0 in common_setup_1), so we can create our own markets.
|
|
|
|
1. Create a new synthetic spread. For the legs choose SIF1 and SIH1 (if you don't
|
|
have these contracts, other contracts can be chosen too) and for the quantities choose 1 and -1.5
|
|
respectively (and same for the Price multiplier).
|
|
Enable quoting for SIH1, and disable all quoting, pre-hedge and post-hedge parameters.
|
|
Name the synthetic SIF1-1.5SIH1.
|
|
|
|
1. Bring up the ladder for the synthetic and for the 2 legs.
|
|
|
|
2. Enter a 10 lot sell order at 20.0 for SIF1 (If the ladder is showing blanks use the market view
|
|
to enter orders). The quoting order will lean against this.
|
|
|
|
3. Enter a 10 lot buy order for the synthetic at -9.900.
|
|
|
|
4. Verify that a 15 lot quoting order is sent for SIH1 at 19.935.
|
|
|
|
5. Now we will start filling the quoting order and verify the hedges. A 1 lot fill in the
|
|
quoting leg means a 2/3 contract in the hedging leg. Since we can not send 2/3 contracts,
|
|
we will add it to the "unhedged delta" till the unhedged delta > 1, and then we will send one
|
|
or more orders to get the unhedged delta < 1.
|
|
|
|
Force quoting fills based on the left most column (by lifting the quoting offer)
|
|
and verify that hedge orders of size "hedge_order_sent" (3rd column) are sent as a result.
|
|
Compare the cumulative qty (cum) to the quote and hedge badges for easy visual inspection.
|
|
|
|
(The "unhedged_delta" column shows the unhedged delta immediately after the quoting fill
|
|
and the "remaining_unhedged_delta" column is the unhedged delta after the hedge order
|
|
has been sent)
|
|
|
|
------------------------------------------------------------------------------
|
|
quoting fill(cum) unhedged_delta hedge_order_sent (cum) remaining_unhedged_delta
|
|
------------------------------------------------------------------------------
|
|
1(1/15) 2/3 0(0/10) 2/3
|
|
1(2/15) 4/3 1(1/10) 1/3
|
|
1(3/15) 1 1(2/10) 0
|
|
4(7/17) 8/3 2(4/10) 2/3
|
|
5(12/15) 4 4(8/10) 0
|
|
2(14/15) 4/3 1(9/10) 1/3
|
|
1(15/15) 1 1(10/10) 0
|
|
|
|
6. At the end of this, the whole order should be filled. Check the order book
|
|
to make sure the fill price is -9.900, there are 10 total fills in SIF1 and
|
|
15 fills in SIH1. |