Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Clarification, please

Just to be certain, please --
is this piece of code going to launch the "getin" procedure four days BEFORE the END of the month, 40 minutes AFTER MARKET OPEN?

schedule_function(func = getin,  
                  date_rule = date_rules.month_end(days_offset = 4),  
                  time_rule = time_rules.market_open(minutes = 40),  
                  half_days = True)

And this one the procedure "getout" four days AFTER the BEGINNING of the month, 40 minutes BEFORE MARKET CLOSE?

schedule_function(func = getout,  
                  date_rule = date_rules.month_start(days_offset = 4),  
                  time_rule = time_rules.market_close(minutes = 40),  
                  half_days = True)

Many thanks in advance!

Tim

3 responses

Looks good - that's exactly right!

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Thank you, James.

I think the code I quoted could be an easy way of implementing the following strategy, mentioned by Graham Voigt on the "Trading Strategy Ideas" thread:


There's already some posts about end of the month stock behavior above, but here's a detailed paper about it:

http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2528692&download=yes

From the intro: "we find that since July 1926, one could have held the US value-weighted stock index (CRSP) for only seven
days a month and pocketed the entire market excess return with nearly fifty percent lower volatility
compared to a buy and hold strategy."

The equity curve graph on page 22 of the paper is eye opening.


Btw, how can I reference this (or any other) existing message without duplicating it in full?

Thanks again,

Tim