Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Is this strategy BS or do I do something wrong?

I found on the net this: http://www.quantumcharts.com/qcsc/OldFaithfulReport.pdf

It basically says:

The Rules:  
1. The close of the day before the first calendar day is at least 3.00 points below the  
previous day's high  
2. Don't trade in August  

I thought: OK, I can't believe it's true but I'll try coding it.... it basically never trades....

1 response

There are two topics previously discussed here related to this concept. One is that all, and I do mean all, positive returns for the SPY occur out of session (close to open).

SPY chart printed from Excel

The other is that the end of month trade is real:
http://www.evernote.com/l/ACPLTIhwvNNB1I69NDoCRR7M3nALsywF8FA/

Buy SPY end of the month

As for your strat, you'll have to try various combinations of date rules and period deltas. Try just entering on the end of the month -- without the high - close test.

def initialize(context):  
    context.stock = symbol('SPY')  
    schedule_function(EnterLong,  
                      date_rule=date_rules.month_end(days_offset=2),  
                      time_rule=time_rules.market_close(hours=0, minutes=5))  
    schedule_function(ClosePosition,  
                      date_rule=date_rules.month_start(days_offset=1),  
                      time_rule=time_rules.market_close(hours=0, minutes=5))

def handle_data(context, data):  
    pass

def EnterLong(context, data):  
    order_target_percent(context.stock, 1.0)  
    print("EnterLong")

def ClosePosition(context, data):  
    if context.portfolio.positions[context.stock].amount > 0:  
        order_target_percent(context.stock, 0.0)  
        print("ClosePosition")