Skip to content

Instantly share code, notes, and snippets.

@josephdunn
Last active August 29, 2015 13:58
Show Gist options
  • Save josephdunn/9997544 to your computer and use it in GitHub Desktop.
Save josephdunn/9997544 to your computer and use it in GitHub Desktop.
import numpy as np
ndays = int(1e5)
ntradesday = 7*60*10
pl = np.sum((np.random.binomial(1, 0.525, (ndays, ntradesday))-0.5)*2, 1)
1.0 / (len(pl[pl < 0]) / float(ndays) * 252)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment