72 lines
2.6 KiB
Plaintext
72 lines
2.6 KiB
Plaintext
|
|
P&L UI Test
|
|
|
|
Turn merge with md off since we want to control the md
|
|
|
|
ExchangeSim {
|
|
value {merge_with_md:false}
|
|
}
|
|
|
|
clear your fills database:
|
|
rm ~/.bts/data/databases/fills/*
|
|
|
|
and you may also want to clear your orders for a clean slate:
|
|
rm ~/.bts/data/databases/orders/*
|
|
|
|
Throughout the test we'll refert to accounts BTS1 and BTS2. These specific accouts aren't necessary, but rather that we have
|
|
fills in multiple distinct accounts.
|
|
|
|
Bring up the pnl form (empty).
|
|
Bring up a ladder form. It should be completely empty since we're controlling the md. For this exercise we'll be using ES.
|
|
Bring up an order ticket for your corresponding ladder
|
|
place a buy order with price 2500 and qty 100
|
|
your ladder should populate now
|
|
Sell a 1 lot at your bid
|
|
The Start of Day (SOD) position should be 0
|
|
Buy qty and Sell qty should be 1 (we crossed our own bid)
|
|
Net Pos should be 0 (buy 1 - sell 1)
|
|
PnL should be 0 (since we have a 0 net position)
|
|
PnL Price should be the level of your bid.
|
|
AvgBuy and Avg Sell should both represent the level at which you entered the buy and sell order
|
|
Improve the bid
|
|
Under BTS2 account (this is important for the next step), enter a 100 lot bid at 2500.25
|
|
Observe the PnL Price reflect the current bid
|
|
Switch back to BTS1
|
|
Sell a 1 lot at the current bid
|
|
You should now have rows for both the BTS1 and BTS2 account
|
|
BTS1
|
|
Sell Qty 2
|
|
Net Pos -1
|
|
PnL 0
|
|
Avg Buy 2500.0
|
|
Avg Sell 2500.13
|
|
Improve the Bid
|
|
Enter a 100 lot bid at 2500.50
|
|
The PnL Price should reflect the current Bid (2500.5)
|
|
The PnL for BTS1 account should show -12.5
|
|
Fill 1: 25 = (2500.5 - 2500) * 1 * 50
|
|
Fill 2: -25 = (2500 - 2500.5) * 1 * 50
|
|
Fill 3: -12.5 = (2500.25 - 2500.5) * 1 * 50
|
|
The PnL for BTS2 account should show 12.5 by a similar calculation as above (but there is only 1 fill)
|
|
Go to bed and wake up the next day
|
|
The SOD for BTS1 should show a -1
|
|
The SOD for BTS2 should show a 1
|
|
Buy Qty for all should show 0
|
|
Sell Qty for all should show 0
|
|
Net Pos should be the same as SOD at the moment
|
|
The simulator might not work for orders left up overnight
|
|
If your ladder shows no working orders, place a buy order with price 2500 and qty 100
|
|
Sell a 1 lot as the current bid
|
|
The SOD should still show -1
|
|
The Buy and Sell Qty should show 1 (we crossed ourself)
|
|
The net position will still say -1
|
|
Now switch to BTS2
|
|
Sell a 5 lot at the current bid
|
|
The SOD should still show -1
|
|
BTS1 Buy qty should show 5
|
|
BTS1 Sell Qty should show 1
|
|
Net Pos should show 3 (-1 (SOD) + 5 (Buys) -1 (Sells))
|
|
BTS1 PnL should show 12.5
|
|
|
|
Test sorting and filtering
|