Skip to Content
Learn Algorithmic Trading
book

Learn Algorithmic Trading

by Sebastien Donadio, Sourav Ghosh
November 2019
Beginner content levelBeginner
394 pages
10h 31m
English
Packt Publishing
Content preview from Learn Algorithmic Trading

Variance of PnLs

We need to measure how much the PnLs can vary from day to day or even week to week. This is an important measure of risk because if a trading strategy has large swings in PnLs, the account value is very volatile and it is hard to run a trading strategy with such a profile. Often, we compute the Standard Deviation of returns over different days or weeks or whatever timeframe we choose to use as our investment time horizon. Most optimization methods try to find optimal trading performance as a balance between PnLs and the Standard Deviation of returns.

Computing the standard deviation of returns is easy. Let's compute the standard deviation of weekly returns, as shown in the following code:

last_week = 0weekly_pnls = []for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

High-Frequency Trading: A Practical Guide to Algorithmic Strategies and Trading Systems

High-Frequency Trading: A Practical Guide to Algorithmic Strategies and Trading Systems

Irene Aldridge
Developing High-Frequency Trading Systems

Developing High-Frequency Trading Systems

Sebastien Donadio, Sourav Ghosh, Romain Rossier

Publisher Resources

ISBN: 9781789348347Supplemental Content