"""Measure peak-to-trough percentage drawdown.

Track the running peak, not only the initial investment.
All inputs are synthetic teaching examples. Run: python 04_peak-drawdown.py
"""
from tv_math import *

d=drawdowns([100,120,90,110])
assert abs(min(d)+.25)<1e-12
print(d)
