Merge pull request #2 from bartosh/master

Code cleanups. Improving code readability.
Add code for brute force grid search method
Replace numpy median with L1 median
Use scipy.optimize.minimize_scalar

Replace brute force method with one that uses scipy.optimize.minimize_scalar to find L1 norm by minimizing sum of Euclidean distances
Cleanup of l1_median

Removed trailing whitespaces.
Fixed docstring indentation.

Signed-off-by: Ed Bartosh <bartosh@gmail.com>
Reimplement l1_median

Reimplemented l1_median using scipy.optimize.minimize_scalar

Signed-off-by: Ed Bartosh <bartosh@gmail.com>
Implement support for daily timeframe

Used Anony Mole's implementation of Trade at the Open
custom slippage model for daily time frame:
https://www.quantopian.com/posts/trade-at-the-open-slippage-model

Switching between daily and minute time frames is done by
setting context.timeframe variable to 'Daily' or 'Minute'.

Note: Quantopian backend produces this error in daily mode:
   Error history() is only supported in 'Minute' mode.
   To use the history() function, switch the backtest from 'Daily' to 'Minute'.
Call of the 'history' function is commented out to make the algo
to work in daily mode. It has to be uncommented for minute mode to work.

Signed-off-by: Ed Bartosh <bartosh@gmail.com>