test for prorata order
This commit is contained in:
1 parent
d8559276d0
commit
5b818bf276
3 files changed
+93
-4
No files matched your search
@@ -187,6 +187,7 @@ void ProRataAlgo::scratch(std::pair<const OrderKey, Quantity> kk)
|
||||
Price scratch_price;
|
||||
Quantity scratch_quan;
|
||||
SpreaderUtils::traverse_depth_for_quantity(me->last_book, cross_side, kk.second, scratch_price, scratch_quan);
|
||||
//Quantity scratch_quan = Price(me->book_at_inception.side(other_side)[0].price())
|
||||
scratch_price = securities::worsen_price(cross_side, scratch_price, me->chase_diff);
|
||||
|
||||
Update update;
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
Test Author: Kevin
|
||||
If it breaks: Kevin
|
||||
|
||||
When the prorata order is placed, it acts as a slightly more complex hedging algorithm than Cover.
|
||||
It will:
|
||||
- Classify each fill as a normal fill or an 'overfill' according to "Fill Limit" parameters
|
||||
- Standard fills are hedged with the "Hedge" child order
|
||||
- Over fills are hedge with the "Overfill Hedge" child order
|
||||
|
||||
The prorata order works the child until the Fill Limit is breached.
|
||||
Once the fill limit is breached, the algo will begin the 'get out process'
|
||||
Unless:
|
||||
- If "Enable Stay In" is checked, AND
|
||||
a) The opposite inside market (at inception) doesn't move against us AND
|
||||
b) The same side quantity remains ABOVE the "Stay in Threshold"
|
||||
If "Enable Stay In" is not checked, 'get out process' begins right away
|
||||
|
||||
"Get Out Process" means
|
||||
1) Cancel the child order
|
||||
2) Scratch the overfill hedges if and only if the "Enable Scratch on Overfill" is checked
|
||||
-Scratches are done "Chase Ticks" through the original opposite market
|
||||
|
||||
|
||||
0. This needs sim market data **not** to be merged with replay (or
|
||||
cert), so we can create our own markets. Use the following key to set
|
||||
market data up:
|
||||
|
||||
ExchangeSim {
|
||||
value {
|
||||
merge_with_md: false
|
||||
}
|
||||
}
|
||||
|
||||
1. Bring up a ladder, lets say in SIM:ESU9 (does not matter which security)
|
||||
|
||||
2. Create the ask side of the market by sending 50 lot sell limit orders at 2833.25 through 2832.25
|
||||
(if there are no markets use the M View and the ticket to enter, if you already had left over
|
||||
orders cancel them)
|
||||
|
||||
2. Create the bid side of the market by sending 50 lot buy limit orders at 2830.75 through 2831.50.
|
||||
You should have no orders at 2831.50, 2831.75 and 2832.
|
||||
|
||||
Basics:
|
||||
3. Enter a 20 lot buy prorata order at 2831.50 with the following parameters
|
||||
|
||||
Hedge Ticks = 1
|
||||
Chase Ticks = 1
|
||||
Fill Limit = Absolute:5
|
||||
Stay in Threshold = Absolute:21
|
||||
Enable Scratch on Overfill = true
|
||||
Enable Stay In = true
|
||||
|
||||
Verify that the Prorata order along with the Child order shows up.
|
||||
|
||||
Next put a 50 lot buy limit order on top of your prorata at 2831.50
|
||||
|
||||
|
||||
4) Using 1 lot limit sells, fill 5 of your prorata order. Verify that you see covers going in 1 tick better
|
||||
|
||||
5) Cancel the 50 lot limit at 2831.50. Nothing should happen. Put the 50 lot back.
|
||||
|
||||
6) Fill one more 1 lot.
|
||||
|
||||
7) Again cancel the 50 lot limit at 2831.50. You should see:
|
||||
- The remainder of the 20 lot should cancel
|
||||
- 1 lot of your hedges should scratch to sell at 2831.25
|
||||
- The parent order should stay in
|
||||
- You should still be working 5 sales for hedges
|
||||
|
||||
8) Fill the 5 sells, it should cancel the parent.
|
||||
|
||||
9) Repeat 3-8, but this time set Enable Scratch on Overfill = false, Enable Stay In = true
|
||||
- You should see the same results in 7, except the 1 lot scratch won't happen so you'll still have 6 working hedges
|
||||
|
||||
9) Repeat 3-6, but this time set Enable Scratch on Overfill = false, Enable Stay In = false
|
||||
- After filling your last lot in 1 you should see your working order cancel, with 6 hedges working
|
||||
- The ladder may deceive you here, check the OB
|
||||
- Cancel your hedges, this should cancel the whole chain
|
||||
|
||||
9) Repeat 3-6, but this time set Enable Scratch on Overfill = true, Enable Stay In = false
|
||||
- After filling your last lot in 1 you should see your working order cancel, one hedge scratch (at 2831.50), and 5 hedges working
|
||||
- The ladder may deceive you here, check the OB
|
||||
- Cancel your hedges, this should cancel the whole chain
|
||||
|
||||
10) Repeat all of this on the sell side
|
||||
|
||||
|
||||
@@ -27,10 +27,11 @@ You should have no orders at 2831.75 and 2832.
|
||||
|
||||
Basics:
|
||||
3. Enter a 20 lot buy scratch order at 2831.50 with the following parameters
|
||||
Scratch Threshold = Absolute:21
|
||||
Max Chase Ticks = 2
|
||||
Child = Limit
|
||||
Verify that the Lean order along with the Child order shows up
|
||||
Scratch Threshold = Absolute:21
|
||||
Max Chase Ticks = 2
|
||||
Child = Limit
|
||||
|
||||
Verify that the Scratch order along with the Child order shows up
|
||||
|
||||
4) Now cancel the 50 lot sell at 2832.25, you should see the 20 lot scratch pay 2832.50 on 20
|
||||
|
||||
|
||||
Reference in new issue
Block a user