36 lines
1.7 KiB
Plaintext
36 lines
1.7 KiB
Plaintext
This test verifies that security position limits are enforced correctly. (Position limits are
|
|
enforced at both the security and account level)
|
|
|
|
0. Clear up your orders and fills so we dont have any lingering positions
|
|
(run rm -r orders and rm -r fills from /sparkdata/data/databases). Restart your sparkd
|
|
|
|
1. Pick a future, lets say ESU8 and an account, lets say ACC A1.
|
|
|
|
2. In the risk admin, select the default account for your user, and enter big clip limits so that
|
|
clip limits dont interfare with this test.
|
|
|
|
3. Go to the Position limits and remove all entries at both the product and security level
|
|
|
|
4. Enter an ESU8 order. It should be rejected. Make sure the rejection message makes sense
|
|
|
|
5. Now enter a product level rule for GLBX, Future, ES, 1,000,000, 1,000,000 (to bypass it),
|
|
and a security level rule GLBX, Future, ES, 50, 100
|
|
|
|
6. Enter a 10 lot. This brings our 'position' to 10 (where 'positions' = fills + working orders).
|
|
Enter more orders to get it to 50. Now try to get past 50 and you should be stopped with a clear message.
|
|
Dont cancel these yet.
|
|
|
|
6. Now start selling 10 lots. Since we are already long 50, and our short limit is 100, we can go all
|
|
the way to 150 (net 100 short), but not beyond that. Verify that.
|
|
|
|
8. Cancel all your buy orders. Cancel some of your sell orders to get the net short position to 50.
|
|
Start selling again, and make sure you are stopped at 100.
|
|
|
|
9. Try another future, lets say SIU8. Since we dont have a position rule for it, it should fail.
|
|
|
|
10. Enter a new rule for the product (and use * for the symbol) and enter 10 for the long and short limits.
|
|
|
|
11. Now enter a 1 lot SIU8 again. Keep buying more and make sure you are stopped at the long limit of 10.
|
|
|
|
12. Start selling and make sure you are stopped at the short limit.
|