3 ms·
Okay, so I got the page to load (in a previous comment, I said it would not load). This guy is doing nothing correctly, and his code is an absolute mess. He's n
by smabie 6y ago
Okay, so I got the page to load (in a previous comment, I said it would not load). This guy is doing nothing correctly, and his code is an absolute mess. He's not using pandas except for displaying data and reading a CSV and his code is unnecessarily ugly and verbose. You really shouldn't be using very many loops at all when doing quant research. And he capitalizes all variable names, but whatever I guess.
He's using raw price data (not sure if Yahoo split and dividend adjusts, so that might be another problem), not log returns. Also as lalaland1125 pointed out, he's literally splitting his data into training and testing randomly, not keeping contiguous time-series. This makes no sense, and no quant researcher would ever do this.
Because of these problems, his results are completely and totally invalid and readers should completely ignore this article.
Looking at his linkedin, he has no experience in finance, as I expected. You can't just take over your textbook ML models and apply them to finance. It doesn't work like that.
I've seen a lot of these ML stock market witchcraft kind of medium posts lately and I hope they're making money off of medium, because they definitely aren't developing successful strategies.
Edit: I wasn't going to mention this, but I run a no bullshit quantitative finance blog: https://cryptm.org/ https://cryptm.org/
I keep it mathematically rigorous and honest. Some of it is original research, but most of it is backtesting/analysis of well known academic research.
Edit2: Take a look at this code:
while x < (len(data)):
if x < (len(data)-5):
if ((close_prices[x+1] + close_prices[x+2] + close_prices[x+3] + close_prices[x+4] + close_prices[x+5])/5) > close_prices[x]:
Five_Day_Obs.append(1)
else:
Five_Day_Obs.append(0)
else:
Five_Day_Obs.append(0)
x+=1
- cshad 6y agoHey, thanks for pointing out some of the mistakes in my code. I'm definitely new to this field and still have a lot to learn. It's great to get feedback like this! I would love to connect with you and hear more about the work you are doing if you have time. I reached out on LinkedIn!