Okay.
We just saw how we compute the average price of traded assets, and the accumulation thereof:
... how many entries do you read contain the word 'thereof' unironically, huh?
Now:
1. given a set of assets, prices, amounts
2. compute PnL* of a trade
*PnL: 'profit and loss'
The start-state of assets is here.
You can test-run PnL against mini-me.csv.
And then do a full-blown run against trades.csv.
BONUS
Besides printing each trade and its PnL, ...
Given the current assets and the trades for a day, print the total profit (or loss) and then the new set of assets at the end of the trading day.
- (answer)
No comments:
Post a Comment