Rs
Module 12Marks & PnLLesson 2 of 720 min

Daily PnL

PnL from mark-to-mark moves.

Formula

PnL = Σ q_i (m_i^t - m_i^{t-1})

Attribution

Per-name PnL vector shows winners/losers.

Challenge

Return Vec of per-position PnL and print the best.

Tips
  • Short profits when price falls
  • Align vectors
  • Fees/funding later

Try it live

Daily PnLRust 2021
Loading editor…
Output
Press Run to compile and execute.