A paper, "Good Day Sunshine: Stock Returns and the Weather", correlates the sunniness of days with changes in stock price. The theory is that sun boosts people's mood and good mood improves people's outlook on the market. The paper concludes that "sunshine is highly significantly correlated with daily stock returns. After controlling for sunshine, other weather conditions such as rain and snow are unrelated to returns." I thought this was interesting, so I tried to reproduce the results.
Although the paper looks at many different locations, I just looked at New York City. I obtained weather forecasts for the upcoming day from a Twitter feed to try to minimize look-ahead bias. Once I had my data, I organized it into a .csv so I could use it in my algorithm. The algorithm itself is simple: if the upcoming day is going to be sunny or mostly sunny, it goes long. Otherwise, it goes short. It always buys or sells the most shares possible given the current cash or positions.
This strategy works well using the S&P 500, particularly relative to the benchmark around 08-09. I'm curious to see if there is any noticeable pattern in the securities that do better or worse in this strategy, as maybe traders of certain stocks are more or less affected by sun.
If you're interested in using different weather history, you can see here. With an algorithm that uses data from a source like that, though, you have to make sure the time shift is correct such that the right weather affects the right day of trading. Similarly, note that there would a slight bias since you would be using the actual, not the forecasted, weather conditions.
Feel free to copy the algorithm by clicking Clone below. You can try different stocks against NYC weather, or you can add different weather sources you find.