Back to Community
A reverse buy/sell strategy

I am working on a research paper, but I am quite bad at programming. Actually, I have no experience in it. What I need is the following.

-To buy a stock that's part of the S&P the day after its price fell for 10% or more, hold it for 21 days and then sell it.
-To sell a stock that's part of the S&P the day after its price rose for 10% or more and hold it for 21 days.

Each investment will be 10% of the portfolio. If there are 10 stocks in the portfolio and there is a stock that fell/rose for 10% or more, its ignored.

I'm looking forward for your code.

Thank you,
Kostadin

9 responses

Without some kind of stop-loss, that strategy will lose your shirt on tail events like Amazon going to the moon or Lehman Bros. going bankrupt.

That said, if you convince me that the programming component is not part of what you're supposed to learn from the paper and pay me 1 BTC upfront, I can write you that algorithm by next Sunday Aug 7.

It won't lose money. I actually have a list of all the drops/rises of the 500 S&P companies during 2014/2015. I'm going to analyse the reasons for these abnormal returns as-well as their impact on the future returns. Anyway, I'm going to learn and I'll code this on my own.

Kind regards,

Kostadin, that's the spirit--code it yourself. if you get stuck, feel free to post, as long you show real effort, someone will help you.

I don't mind helping for free, as long as I get credited in the paper. I can see some promise in this strategy, and would be happy to help! :)

Kostadin, I can provide some hints for your projects, but not code:

  1. You need to study ALL drops, not just those which happen first, to have conclusive results
  2. You need to account for the PEAD anomaly, else if the move is earnings related, you will most likely lose money due to momentum in the first 20 days after an earnings surprise
  3. You need to tweak the 2 inputs: 10% and 21 days, and report results for other combinations of the two, not just this one
  4. You need to define "abnormal" and in that sense you need to study what was the return for the SPY on the same day....if SPY went up by 3% and your stock went up by 11%, then that stock's abnormal return is 8% not 11%.
  5. You MUST expand your time frame if you are writing an academic paper, since 2 years is going to be unacceptable to your professors - if it is, then you need to look for better professors.

Hope this helps,
BT

The S&P companies had over 250 drops and rises during 2014 and 2015. Now, the goal of my academic paper is not only to test this strategy as many researchers did in the past (using similar formulas and different definition of "abnormal return" but different time periods), but to see the correlation between the reasons for the stock/rise and its performance in the next 21-days. Now, sadly, the only way to find the reasons is to google each stock drop or rise one by one. But, in reality, I am not going to invest in ALL of these as I am not sure when and how many of these events will happen. This strategy will help me test investing in 10 stocks at a time, for different periods and give me answer whether this is a good idea or not. It can also be tested whether there is a reversal or momentum strategy. Even if I am not beating the market, it is still a conclusion.

However, my academic paper, as I said before, will focus on the reasons and not only on the results. Sadly, that's something that nobody researched before.

Kind regards,
Kostadin

OK you seem set in your ways and you disregard the feedback, so...good luck to you.

It won't lose money. I actually have a list of all the drops/rises of the 500 S&P companies during 2014/2015. I'm going to analyse the reasons for these abnormal returns as-well as their impact on the future returns. Anyway, I'm going to learn and I'll code this on my own.

Here are your abnormal returns since 2002.

I'm not sure if this was the result you were looking for though...

Clone Algorithm
6
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
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: 579fb4e88b9c6e1001a98a95
There was a runtime error.

The average return of all the stocks that rose for 10% or more during 2014 and 2015 in the next 21-trading days on average was -2%.

Now, as I mentioned above, I am not good at coding, but the logic says it is not possible to lose money by shorting these.

I'll take a look at your coding and try to understand what it does.

Thank you,
Kostadin