From 0ff2fbc4ffa385b03b0c963c578bf3ff61c6ecd5 Mon Sep 17 00:00:00 2001 From: Taha Afzal Date: Wed, 28 Aug 2019 22:24:54 -0400 Subject: [PATCH] Modifying tests according to the limit changes --- src/lib/orderman/actors/SODPosition.cpp | 5 +++++ testing/manual/admin/product_position_limits.txt | 11 +++++++---- testing/manual/admin/spread_position_limits.txt | 14 ++++++++------ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/lib/orderman/actors/SODPosition.cpp b/src/lib/orderman/actors/SODPosition.cpp index 4d5884cce..f962b119e 100644 --- a/src/lib/orderman/actors/SODPosition.cpp +++ b/src/lib/orderman/actors/SODPosition.cpp @@ -27,6 +27,11 @@ _sod_time(sod_time){ // returns the timeval for today's hh,mm,ss (in local machine terms) // (timeval is the microseconds from epoch) timeval SODPosition::to_timeval(uint16_t hh, uint16_t mm, uint16_t ss) { + // function does the conversion the following way: + // 1. gets the now secs from epoch using time + // 2. converts it into local time (so we have now local time) + // 3. overrides the hh, mm, ss passed + // 4. converts it back into secs from epoch using mktime bts_assert(hh < 24); bts_assert(mm < 60); bts_assert(ss < 60); diff --git a/testing/manual/admin/product_position_limits.txt b/testing/manual/admin/product_position_limits.txt index c47774106..b43baabc1 100644 --- a/testing/manual/admin/product_position_limits.txt +++ b/testing/manual/admin/product_position_limits.txt @@ -1,6 +1,4 @@ -This test verifies that product position limits are enforced correctly. (Position limits are -enforced at both the security and account level) - +This test verifies that product position limits are enforced correctly. Use SIM for all steps of the test 0. Clear up your orders, fills and admin db so we don't have any lingering positions @@ -17,11 +15,16 @@ and enter a big clip, say 500000, so that clip limits don't interfere with this 5. Enter a rule for SIM, Future, SI, 60, 120. -6. Send 3 10 lot buys for both the futures. Make sure they go through. +6. Send 3 20 lot buys for both the futures. Make sure they go through. 7. Send a 1 lot on SIU8. The limit of 60 should not allow it. Make sure the rejection message is clear. +8. Cross 2 of the 20 lots enterred in 6 so that they fill. + +9. Send a 1 lot on SIU8. The limit of 60 should not allow it. Make sure the rejection +message is clear. + 8. Change the max to 70, and try a 10 lot again. This order should be allowed. Try another 10 lot and it should be stopped. diff --git a/testing/manual/admin/spread_position_limits.txt b/testing/manual/admin/spread_position_limits.txt index 994f71c19..ee5a65bc8 100644 --- a/testing/manual/admin/spread_position_limits.txt +++ b/testing/manual/admin/spread_position_limits.txt @@ -4,17 +4,19 @@ ii. spread legs fills (and working orders) are applied toward enforcing the position limits for the legs iii. leg limits are checked when entering spread orders -i: - 1. Pick a 2 legged spread (lets say SIU8-SIZ8). Set the clip limits high for both spreads and futures so that they don't interfere. 2. For the Position Limits, set Max Long and Max Short of 100 and 110 for the SI futures and 20 and 30 for the SI spreads respectively. -3. Verify that the limits set in 2 work for futures(remember working orders count toward limit enforcement so you dont need -fills). Cancel all the orders. +3. Make sure "Ignore Spread Position Limits" is not checked -4. Verify that the limits set in 2. work for spreads. Cancel all the orders. +4. Verify that the limits set in 2 work for futures. Accrue future "positions" through a +combination of working orders and fills. Cancel all the orders. -5. Make these position limits 1,000,000 to make them irrelevant +5. Verify that the limits set in 2. work for spreads. Cancel all the orders. + +6. Check "gnore Spread Position Limits" and make sure this disables spread limits. + +7. Make these position limits 1,000,000 to make them irrelevant