-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
unrealized_pnl
based on closing_price
if known
If we know the `closing_price` then it is used for updating the unrealized pnl. Note that the realized pnl is *only* set once we update it based on the closed contract. The realized pnl is not updated based on the execution price, because there is no execution guarantee.
- Loading branch information
Showing
7 changed files
with
26 additions
and
4 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
coordinator/migrations/2023-07-21-050135_closing_price_positions/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- This file should undo anything in `up.sql` | ||
ALTER TABLE | ||
"positions" DROP COLUMN "closing_price"; |
5 changes: 5 additions & 0 deletions
5
coordinator/migrations/2023-07-21-050135_closing_price_positions/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- Your SQL goes here | ||
ALTER TABLE | ||
positions | ||
ADD | ||
COLUMN "closing_price" REAL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters