Tag Archives: programming

Stochastic matrix of the FUD states

This entry is part 7 of 17 in the series Numpy Strategies

Numpy Strategies 0.1.2
So we are now in Sprint 12 of Project “NumPy Strategies”. Last week you finished the task of determining states and defining a Markov chain model. This took you ten minutes even though the estimate was 2 days. [...]

Share
Posted in programming | Tagged , , | Leave a comment

What is the optimal holding period for shares?

This entry is part of 17 in the series Numpy Strategies

Numpy Strategies 0.1.0
Happy New Year! So I was collecting evidence for my prediction of the gold bubble bursting early in 2011 and I found this article. Very short summary – 14 June 2011. What do I think? I think this [...]

Share
Posted in programming | Tagged , , | Leave a comment

How to optimize maximum drawdowns of stock returns

This entry is part of 17 in the series Numpy Strategies

Numpy Strategies 0.0.9
Merry Xmas everybody. If you don’t celebrate Xmas, don’t worry, you are not missing that much. Maximum drawdown is defined as the maximum decline from a historical peak. Obviously, this is a measure of risk as well. So [...]

Share
Posted in programming | Tagged , , | Leave a comment

Stock returns entropy, the CAPM and target practice

This entry is part of 17 in the series Numpy Strategies

Numpy Strategies 0.0.8
Entropy is a measure of uncertainty and therefore risk. So I attempted to replace the variance of stock returns in the CAPM with entropy. I also tried to save some pennies by “shooting” below the open price on [...]

Share
Posted in programming | Tagged , , | Leave a comment

How skewed are the prices of stocks?

This entry is part of 17 in the series Numpy Strategies

Numpy Strategies 0.0.7
The 3 moment CAPM takes into account the mean, variance and skewness of asset returns. An investor prefers high positive skewness and low risk, because this corresponds to higher returns. I also did an experiment with fractional Brownian [...]

Share
Posted in programming | Tagged , , | Leave a comment

Random walks get you nowhere

This entry is part of 17 in the series Numpy Strategies

Numpy Strategies 0.0.6
Well, you might bump into a wall repeatedly or get hit by a car. The best you can do is get pretty close to your desired destination. So I made some random walk simulations using a trinomial model [...]

Share
Posted in programming | Tagged , , | Leave a comment

Stock selection with the mad CAPM and liquidity filtering

This entry is part of 17 in the series Numpy Strategies

Numpy Strategies 0.0.5
The Capital Asset Pricing Model ( CAPM ) usually uses variance or standard deviation as a risk metric. I invented a slight modification of the model, which I call the mad CAPM ( well OK maybe I did [...]

Share
Posted in programming | Tagged , , | Leave a comment

Portfolio analysis with Pandas for the win

This entry is part of 17 in the series Numpy Strategies

Numpy Strategies 0.0.2
I saw a PyCon presentation about pandas. Pandas is a data analysis Python library, which works with timeseries data and handles missing data automatically. It is based on NumPy and should work well together with for instance scikits.statsmodels. [...]

Share
Posted in programming | Tagged , , | Leave a comment

There is more than one way to get data

This entry is part of 17 in the series Numpy Strategies

Numpy Strategies 0.0.1
Happy Halloween, everybody! So the plan for today is

Get as much historical data as possible.
Filter the data with a market scanner.
Profit!!!

Data retrieval
This week I had fun retrieving data with Perl. The script I made, reads a file with [...]

Share
Posted in programming | Tagged , , , | Leave a comment

Stock mechanics and the simple harmonic oscillator

This entry is part of 15 in the series Grails Finance

Grails Finance 1.5
The simple harmonic oscillator models an ideal physical system, without friction, for which a constant force/acceleration results in a constant displacement or the other way around. A typical example would be a mass on a spring. Anyway this [...]

Share
Posted in programming | Tagged , , , | Leave a comment