Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Why is my short term reversal factor not in control?

I used following in my optimisation:

    constraint_sector_style_risk = opt.experimental.RiskModelExposure(  
        context.risk_loading_pipeline,  
        version=opt.Newest,  
    )  
    constraints.append(constraint_sector_style_risk)  

But my short term reversal factor exposure is still high. What am I doing wrong?

Please advise.

8 responses

Not sure. You might try adding/subtracting the built-in Pipeline factor RSI to your indicator prior to applying the Optimize API.

@Grant, how will that help? RSI is a technical indicator that shows the relative strength using price action.

Assuming is not a bug in the algorithm, I imagine that a risk factor with a high turnover/low autocorrelation could produce what you are seeing. The optimize API works computing the assets weights taking into consideration the current assets exposure (factor loading) to short term reversal risk factor , but if the turnover of short term reversal risk factor is very high (and so autocorrelation low) then tomorrow exposure could be very different from today one and the constraints used on today exposure might have little influence on tomorrow's exposure. This is just my understanding, but I'd love to hear from Q more about this issue.

My understanding is that the short_term_reversal is just the 14-day RSI, so you should be able to extract it manually.

Also be sure to use the new slippage model, particularly if trading frequently at high turnover.

"Past performance is no guarantee of future results."

If Grant is correct (which he typically is) then the short term reversal factor is just the latest 14 day RSI. Optimize simply keeps this value within range. However, the Pyfolio results are calculated on the values during the actual timeframe which one holds the security NOT this value when it was opened. Just because the RSI was X when one opened a position doesn't mean it's going to stay that way. This will be exacerbated if one's logic is good at finding securities expecting a big change to RSI. Optimize just optimizes based upon past performance but that's no guarantee for the future.

I ran into what seems to be a similar issue with beta. Tried to take a relatively short term beta (eg 14 days) using that as a constraint in hopes of keeping beta low. Failed miserably. When looking at the securities that were purchased, sure enough, they all had low beta as of the day they were opened. However, I looked at the betas during the time I held them... much different. That short term beta had so much variability it was a meaningless predictor of future beta. May want to spot check some of the past and future RSI values for some of the holdings?

That would be my two cents.

@Dan I totally agree and that's exactly what I meant in my post. If you analyze the short term reversal factor loading and discover that it has high turnover/low autocorrelation it means the assets exposure to the factor changes frequently and this increases the problem of "Past performance is no guarantee of future results."

You could try applying the Optimize API daily just for keeping the portfolio constrained. In this case, I’m wondering if one would use an alpha factor vector equal to the current portfolio weights and the TargetWeights objective.

Of course, if the trading is daily then the Optimize API should already be doing a decent job.

I'd also refer you to this conversation - it's about the same topic, and I think Rene's advice would be the same.

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.