Back to Community
Quantopian/Reuters: How Mass Shootings & Politics Boost Gun Shares

A few weeks ago we were approached by Reuters about doing some research on how mass shootings and politics affects the price of gun manufacturers stocks. Here is the backtest and code so you can see for yourself.

Check out the article by Tim McLaughlin Trading algorithm shows how mass shootings, politics boost gun shares

Clone Algorithm
Backtest from to with initial capital
Total Returns
Max Drawdown
Benchmark Returns
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 568e8c8522d8fe1180543de7
There was a runtime error.

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.

13 responses

Sorry for this beginner question. I think this is more about quantopian than anything else. I was using your algo to test this hypothesis of investing in gun companies the day after a shooting.

I think there may be an issue with the performance of my tests:
Now for my question: my backtest says the cumulative performance of my test is 350.7% (the percentage that you get when you move the blue dot). However, for the total returns it says 698.3%. Why is that? Is that a glitch?

Zachary. If you think you found a bug send a screenshot to [email protected] and we'll try to clear things up.

I don't know if I was doing something wrong, it was fixed, or it was an issue with a particular browser, but it is not happening anymore. Thanks.

@James. Why do you use SWHC as the benchmark and not RGR? You probably know that RGR outperforms your algo.

The Reuters reporter wanted to use Smith & Wesson, and yeah RGR does outperform on a returns only basis.

If you wanted to run an algorithm similar to this but with live information, what csv source would you recommend?

This source seems to have a pretty good list going.

Can someone make this Q2 compliant. I would like to trade this.

I may do it eventually. What's stopping you?

I don't know how to code :(

Does anyone know if the CSV will be updated in the future?

I have no plans to update the Google Sheet used in the algorithm. See my response above for a source that seems to be updated regularly, though I can't vouch for the timeliness.

typo in Reuters' article's chart legend.