Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Need help in understanding Sample Momentum Algorithm

I am fairly new to Quantopian and figured I play with SMA to understand the platform better. I am having difficulty in understanding the flow. I am running the algorithm in minute model. From what I read daily mode will place the order next day and minute mode it will be immediate.

From the logs when the algorithm runs on first day it is not placing orders for all stocks identified. For the consecutive runs most of times there are open orders and hence the re balancing logic never gets executed which will affect the correctness of the algorithm. I can't figure out why there are open orders. Please find the log below, any help is appreciated.

Thanks!

Log:

1970-01-01initialize:6INFOIn Init 2016-02-03 00:00:00+00:00
1970-01-01PRINTNo open orders
2016-02-03rebalance:41INFOmoney to start 10000.0
2016-02-03rebalance:52INFOIn rebalance 2016-02-03 14:31:00+00:00
2016-02-03PRINTcontext.current_days_counted 0
2016-02-03PRINTcontext.rebalance_days 10
2016-02-03rebalance:121INFOSHORT: DIA date 2016-02-03 14:31:00+00:00
2016-02-03rebalance:128INFOLONG: T 2016-02-03 14:31:00+00:00
2016-02-03rebalance:121INFOSHORT: SPY date 2016-02-03 14:31:00+00:00
2016-02-03rebalance:128INFOLONG: AGN 2016-02-03 14:31:00+00:00
2016-02-03rebalance:121INFOSHORT: PCLN date 2016-02-03 14:31:00+00:00
2016-02-03rebalance:128INFOLONG: QQQ 2016-02-03 14:31:00+00:00
2016-02-03rebalance:121INFOSHORT: IVV date 2016-02-03 14:31:00+00:00
2016-02-03rebalance:128INFOLONG: TLT 2016-02-03 14:31:00+00:00
2016-02-03rebalance:128INFOLONG: BIDU 2016-02-03 14:31:00+00:00
2016-02-03rebalance:121INFOSHORT: BABA date 2016-02-03 14:31:00+00:00
2016-02-03day_counter:33INFOIn day_counter 2016-02-03 20:59:00+00:00
2016-02-03day_counter:34INFOmoney left 9960.37998731
2016-02-04rebalance:41INFOmoney to start 9937.65998731
2016-02-04PRINTopen orders
2016-02-04PRINTEquity(27533 [BIDU])
2016-02-04PRINTEquity(19920 [QQQ])
2016-02-04PRINTEquity(23921 [TLT])
2016-02-04PRINTEquity(8572 [AGN])
2016-02-04PRINTEquity(6653 [T])
2016-02-04PRINTEquity(2174 [DIA])
2016-02-04day_counter:33INFOIn day_counter 2016-02-04 20:59:00+00:00
2016-02-04day_counter:34INFOmoney left 9880.92998731
2016-02-05rebalance:41INFOmoney to start 9899.89998731
2016-02-05PRINTopen orders
2016-02-05PRINTEquity(27533 [BIDU])
2016-02-05PRINTEquity(19920 [QQQ])
2016-02-05PRINTEquity(23921 [TLT])
2016-02-05PRINTEquity(8572 [AGN])
2016-02-05PRINTEquity(6653 [T])
2016-02-05PRINTEquity(2174 [DIA])
2016-02-05day_counter:33INFOIn day_counter 2016-02-05 20:59:00+00:00
2016-02-05day_counter:34INFOmoney left 10075.3799515
2016-02-08rebalance:41INFOmoney to start 10171.8549515
2016-02-08PRINTopen orders
2016-02-08PRINTEquity(19920 [QQQ])
2016-02-08PRINTEquity(23921 [TLT])
2016-02-08PRINTEquity(8572 [AGN])
2016-02-08PRINTEquity(27533 [BIDU])
2016-02-08PRINTEquity(2174 [DIA])
2016-02-08day_counter:33INFOIn day_counter 2016-02-08 20:59:00+00:00
2016-02-08day_counter:34INFOmoney left 10212.0699363
2016-02-09rebalance:41INFOmoney to start 10321.9549363
2016-02-09PRINTopen orders
2016-02-09PRINTEquity(19920 [QQQ])
2016-02-09PRINTEquity(8572 [AGN])
2016-02-09PRINTEquity(27533 [BIDU])
2016-02-09day_counter:33INFOIn day_counter 2016-02-09 20:59:00+00:00
2016-02-09day_counter:34INFOmoney left 10160.2349363
2016-02-10rebalance:41INFOmoney to start 10109.0649363
...

1 response

Bumping the thread again. Any help is appreciated!