SPARK-656, spreader tests:

This commit is contained in:
Taha Afzal committed 2018-03-19 11:54:56 -04:00
1 parent 381e277eb9
commit c3cb14a351
9 files changed
+149

No files matched your search

@@ -0,0 +1,17 @@
This is not a test, but common setup instructions that will be used for a few tests
0. This needs sim with replay turned off, so we can create our own markets.
1. Create a 2 legged spread in silver :
a. Buy SIN1 sell SIZ1
b. Price Ratio’s of 1.0 and -1.0 as well
c. Quote second leg only
d. Hedge Ratio 1 for both legs
e. Disable all Quote, Pre-Hedge, Post-Hedge Parameters for both legs
2. Make sure there is no market for these contracts. If there is, cancel those orders.
3. For the first leg (non quoting) enter 1 lot bid orders from 18.230 to 18.250 at 0.05 intervals, and 1 lot ask orders from 18.300 to 18.320.
Make sure these are reflected in the ladder market data (when the ladder has no market, we will need to enter the first order via an Order Ticket)
4. For the second leg (quoting leg) enter a 5 lot bid order at 18.5 and a 5 lot sell order at 18.525. Make sure both the markets show up.
@@ -0,0 +1,17 @@
This is not a test, but common setup instructions that will be used for a few tests
0. This needs sim with replay turned off, so we can create our own markets.
1. Create a 2 legged spread in silver :
a. Buy SIN1 sell SIZ1
b. Price Ratio’s of 1.0 and -1.0 as well
c. Quote second leg only
d. Hedge Ratio 1 for both legs
e. Disable all Quote, Pre-Hedge, Post-Hedge Parameters for both legs
2. Make sure there is no market for these contracts. If there is, cancel those orders.
3. For the first leg (non quoting) enter a 5 lot bid at 18.25 and 5 lot ask at 18.30. Make sure these are reflected in the ladder market data.
4. For the second leg (quoting leg) enter a 5 lot bid order at 18.5 and a 5 lot ask order at 18.525. Make sure both the markets show up.
+23
View File
@@ -0,0 +1,23 @@
This test assumes the user has done the test in simple_sanity.txt
0. Follow the instructions in common_setup_1.txt
1. Enter a synthetic order of 1 lot at -0.30. Verify that a quoting order of 18.60 shows up in the second leg.
Cancel the synthetic order and the quoting order should be cancelled too.
2. Change the hedge ratio of the hedging leg to 2.0. Enter a synthetic order of 1 lot at -0.30.
Verify that a quoting order of 18.605 shows up in the second leg. Cancel the synthetic order
and the quoting should be cancelled too.
3. Repeat it for a hedge ratio of 5.0, and verify that the quoting order shows at the right price
(calculation of this price is left as an exercise for the user). Cancel the synthetic order.
4. Make the hedging ratio 6.0 and enter a synthetic order of 1 lot at -0.30. You should see an
active spreader order, but since there is not enough qty in the hedging market,
no quoting order should be sent. Keep this synthetic order running.
5. Change hedging leg’s 1 lot ask @ 18.30 to a 2 lot. This should enable the hedging qty requirements
to be met, and a quoting order should be sent at 18.620. Keep this synthetic order running.
6. Changing the 2 lot @ 18.30 back to 1, and once again the hedging qty requirements are not met hence
the quoter order should be cancelled. Cancel the synthetic order.
@@ -0,0 +1,16 @@
This test assumes the user has done the test in simple_sanity.txt
0. Follow the instructions in common_setup_2.txt
1. Now we are going to force a legged hedge, ie a hedge that does not get filled.
The way to do this is to drag the quoting order to force a cross, which will in turn send a hedge
that joins the market instead of crossing it. So drag the quoting order all the way to the bid side
to cross it with 5 @ 18.50. This should cause a fill in the quoting leg at 18.50 and a hedge order
will be sent at 18.20. Verify this. This hedge order will keep working there (since we don't have
any post hedging rules right now). Now cancel the spreader order.
2. Enable the Post-Hedge Ticks Away Cross for the hedging leg. Put 25 for Ticks and 3 for the Cross Ticks. Repeat 4.
Now move the opposite inside market of the hedger (which is the ask order at 18.30) gradually away from the
hedging order to finally being 26 ticks away. The spreader moves the hedger order 3 ticks into the opposite
inside market and cause a fill. The spreader order will be filled too. Verify that the order was indeed sent
3 ticks into the opposite inside market
@@ -0,0 +1,16 @@
This test assumes the user has done the test in simple_sanity.txt
0. Follow the instructions in common_setup_2.txt
1. Now we are going to force a legged hedge, ie a hedge that does not get filled.
The way to do this is to drag the quoting order to force a cross, which will in turn send a hedge
that joins the market instead of crossing it. So drag the quoting order all the way to the bid side
to cross it with 5 @ 18.50. This should cause a fill in the quoting leg at 18.50 and a hedge order
will be sent at 18.20. Verify this. This hedge order will keep working there (since we don't have
any post hedging rules right now). Now cancel the spreader order.
2. Enable the Post-Hedge Time Away Cross for the hedging leg. Put 10,000 for Time(ms)
and 5 for the Cross Ticks. Repeat 4 and wait 10 seconds. This time the hedge order should
not wait forever, but after 10 seconds, it should cross the opposite inside market by 5 ticks.
The spreader order will be filled too. Verify that the order was indeed sent 5 ticks into
the opposite inside market
@@ -0,0 +1,15 @@
This test assumes the user has done the test in simple_sanity.txt
0. Follow the instructions in common_setup_2.txt
1. Send a buy order at -0.20. Since we are crossing the synthetic market’s bid-offer spread,
the order should get filled immediately. Verify that and that the quote and hedge prices are correct.
2. We will now test for Pay Less. This means the hedger order will be entered at an
advantageous price (ie buy lower, sell higher) if the quantity at the hedge price level is greater
than a threshold. In order to do this we will enable Pay Less for the hedging leg, enter a threshold of 1,
select the drop down to Size (ie absolute size vs a ratio) and set Payless ticks to be 15 ticks.
3. Send a buy order at -0.20. Verify that the hedger order is sent 15 ticks away from the hedging price
(since it is a buy order, it should be 15 ticks lower than the hedging price level).
This will result in the hedging order being worked on the bid side. Cancel the spreader order.
@@ -0,0 +1,14 @@
This test assumes the user has done the test in simple_sanity.txt
0. Follow the instructions in common_setup_2.txt
1. Send a buy order at -0.20. Since we are crossing the synthetic market’s bid-offer spread,
the order should get filled immediately. Verify that and that the quote and hedge prices are correct.
2. We will now test for Pay Up. This means the hedger order will be entered at a
worse price (ie buy higher, sell lower) if the quantity at the hedge price level is less than a threshold.
In order to do this we will enable Pay Up for the hedging leg, enter a threshold of 100, select
the drop down to Size (ie absolute size vs a ratio) and set Payup ticks to be 5 ticks.
3. Send a buy order at -0.20. Verify that the hedger order is sent 5 ticks away from the hedging price
(since it is a buy order, it should be 5 ticks higher than the hedging price level). Cancel the spreader order.
@@ -0,0 +1,18 @@
This test assumes the user has done the test in simple_sanity.txt
0. Follow the instructions in common_setup_2.txt
1. Enter a 1 lot spreader buy at -0.30. Verify the quoting order shows up at the right price.
2. The quoting order is using the hedging leg’s sell side to price (ie the 5 lot order at 18.30, lets call it S1).
So moving S1 should move the quoting order. Since the throttles are turned off, everytime we move S1, the quoting
order should move too. Move S1 a few times and verify that the quoting order moves to the correct price.
Cancel this synthetic order
3. Modify the synthetics throttle behaviour. For the quoting leg, enable the Throttle and set Inside Ticks to 1
and Outside Ticks to 3. What this means is that quoting orders moving toward the inside markets, have to move
beyond 1 tick for them to be sent out; and quoting orders moving away from the inside market have to move beyond
3 ticks for them to be sent out. Verify this behaviour by making suitable modifications to S1.
4. Make adjustments to the spreader price (ie move it from -0.30) and verify the throttling behaviour is correct.
+13
View File
@@ -0,0 +1,13 @@
This test makes sure the basic spreader functionality works for 2 legged synthetic spreads with one quoting leg
0. Follow the instructions from common_setup_1.txt
1. Enter a synthetic order of 1 lot at -0.30. Verify that a quoting order of 18.60 shows up in the second leg.
Cancel the synthetic order and the quoting order should be cancelled too.
2. Enter a synthetic order of 1 lot at -0.30, again. Now drag the the synthetic order down the ladder
(ie lower bid prices) to a few random prices of your choice. Verify that the quoter leg price is adjusted
accordingly and is correct.
3. Now cross the synthetic order by dragging it all the way to -0.20 (there should be a 1 lot at that price).
Verify that the synthetic order gets filled at -0.20, the quoter order at 18.50, and the hedger order at 18.30.