Merge pull request #1 from bartosh/master

Code cleanups, code style improvements, etc
Move strategy code into function

Created function rmr_strategy and moved code from handle_data into it.
This should increase readability and clearly show the core algo
parameters and return value.

Signed-off-by: Ed Bartosh <bartosh@gmail.com>
Trade maximum one time per day

In current implementation algo trades every minute starting from
10:01. This change fixes that by setting exact time for the trade.
rmr_strategy: simplify calculation

Made a calculation of b a bit simpler.
remove confusing commentary

Signed-off-by: Ed Bartosh <bartosh@gmail.com>
Remove unused statement
Get rid of using enumerate

It's not needed anymore as index variable 'i' is not used.
Check for all open orders at once

As we don't care which security has an open orders it doesn't make
sense to check them for each security.

Signed-off-by: Ed Bartosh <bartosh@gmail.com>
Get rid of 'cash' variable

It's more readable to use context.portfolio.cash

Signed-off-by: Ed Bartosh <bartosh@gmail.com>
Get rid of 'm' variable

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

It's better to have this check in handle_data as it's just two
lines of code and it improves code readability.

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

Code is more readable and easier to understand without
rebalance_portfolio function.

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