Intel·ligència artificial WallStreetBets FinBERT inversió quantitativa retrotest Reddit risc financer

Invertir amb WallStreetBets i IA: el biaix que va convertir un 51% en una pèrdua del 49%

Un bot classifica el sentiment de Reddit i sembla guanyar un 51% en dos mesos. En corregir un biaix temporal, l’avantatge desapareix i la prova deixa lliçons clau sobre IA i retrotests.

El resultat que semblava espectacular era un miratge

El vídeo de LosingLoonies prova si el sentiment de les publicacions de r/WallStreetBets pot convertir-se en una estratègia automàtica d’inversió. El creador classifica missatges amb FinBERT, assigna una puntuació diària a cada acció i compra el valor amb més opinions alcistes.

En el primer retrotest, el sistema sembla extraordinari: guanya un 51% en dos mesos i arriba a mostrar una taxa anual composta de quatre dígits. Però el mateix creador desconfia del resultat, revisa el codi i troba un sol signe mal posat. El programa utilitzava informació del dia actual per simular una compra que, cronològicament, havia d’haver decidit abans de conèixer aquella informació.

En corregir aquest biaix d’anticipaciólook-ahead bias—, desapareix l’avantatge. Segons els resultats que ensenya el vídeo, seguir el sentiment positiu de WallStreetBets acaba el període anual amb una pèrdua pròxima al 49%. Apostar a la baixa contra el fòrum tampoc supera l’S&P 500.

La lliçó no és que la IA no serveixi per analitzar mercats. És més precisa: un classificador pot llegir bé un text i, tot i així, no generar cap rendibilitat negociable. Entre entendre una opinió i operar abans que el mercat hi reaccioni hi ha una diferència enorme.

D’on surt l’experiment

El vídeo continua una prova anterior en què el creador comptava les mencions de cada símbol borsari a WallStreetBets. Va assajar dues regles:

  • comprar l’acció més mencionada cada dia;
  • comprar la que augmentava més ràpidament en popularitat.

Cap de les dues va superar la referència de l’S&P 500. El problema evident és que una menció no indica direcció. Una empresa pot dominar la conversa perquè els usuaris esperen una pujada, però també perquè acaba d’anunciar una fallida, pateix un escàndol o ja s’ha disparat i concentra totes les mirades.

El nou experiment afegeix sentiment. Cada publicació es classifica com a alcista o baixista, i per a cada ticker es calcula:

puntuació = nombre de publicacions alcistes − nombre de publicacions baixistes

El sistema compra l’acció amb la puntuació més alta i la manté fins que una altra ocupa el primer lloc. No hi ha diversificació: tota la cartera simulada queda concentrada en un únic valor.

És una regla fàcil d’explicar, però combina tres riscos: soroll lingüístic, concentració extrema i una rotació potencialment elevada.

Què és FinBERT i què no és

Al vídeo es presenta FinBERT com si fos «el model de llenguatge financer de Google». La descripció necessita un matís. BERT sí que va néixer a Google Research, però FinBERT és el nom que han utilitzat diversos projectes posteriors per adaptar l’arquitectura BERT a textos financers.

El treball de Doğu Araci de 2019, una de les referències més conegudes, parteix de BERT i l’ajusta per classificar sentiment financer. No és un model generatiu comparable a un xat actual ni prediu directament el preu d’una acció. La seva sortida és una etiqueta o probabilitat de sentiment.

Això és important perquè l’article original d’Oxford que inspira el vídeo no afirma simplement que «un LLM sap quina acció comprar». L’estudi analitza l’estructura de WallStreetBets amb models de temes, xarxes d’usuaris i actius, sentiment i proves economètriques. Una de les conclusions és que el fòrum sol reaccionar a moviments de preu previs més que anticipar-los.

El 94% d’encert no és comparable directament amb el 69%

El creador revisa manualment unes 200 publicacions que FinBERT havia classificat amb més d’un 90% de confiança i diu obtenir un 94% d’encert. Ho compara amb un 69% atribuït al treball d’Oxford.

Ell mateix admet que la comparació no és equivalent:

  • selecciona només exemples d’alta confiança;
  • elimina la classe neutral;
  • avalua aproximadament 200 casos, no milers;
  • la revisió la fa una sola persona que coneix l’objectiu de l’experiment;
  • sarcasme, argot i mems queden sobrerepresentats entre els casos difícils que es descarten.

Un 94% sobre la part més fàcil del conjunt no implica un 94% sobre totes les publicacions. Tampoc implica que el 94% de les operacions siguin correctes: encert lingüístic i encert financer són mètriques diferents.

Per què el primer retrotest «veia el futur»

El vídeo troba l’error en una condició temporal del codi. La simulació feia servir la reacció de la comunitat d’un dia per atribuir una compra a un moment anterior o massa favorable. D’aquesta manera, el preu de compra no respectava quan la dada hauria estat realment disponible.

Això és un cas clàssic de filtració temporal:

  1. passa un esdeveniment o el preu comença a moure’s;
  2. els usuaris publiquen i voten;
  3. el model observa aquella conversa;
  4. el retrotest simula que ja estava posicionat abans o al preu previ.

El sistema sembla predictiu perquè una part del futur s’ha colat a les variables. La documentació de TimeSeriesSplit de scikit-learn recorda que, amb dades ordenades en el temps, cal entrenar amb el passat i provar en observacions futures; les particions aleatòries poden donar estimacions irreals.

En aquest cas encara caldria ser més estricte. No n’hi ha prou amb separar per data: s’ha de conservar l’hora exacta de publicació, distingir horari de mercat i fora de mercat, incorporar el retard de descàrrega i inferència, i executar la compra al primer preu realista posterior al senyal.

El CAGR de quatre dígits no era una expectativa anual

Anualitzar un guany de dos mesos converteix un període curt en una taxa hipotètica assumint que es pot repetir una vegada i una altra amb capitalització. Matemàticament pot ser correcte, però econòmicament és molt enganyós quan:

  • la mostra és curta;
  • hi ha poques operacions;
  • una sola jornada aporta bona part del guany;
  • l’estratègia encara no ha estat provada fora de mostra;
  • el retrotest conté un error temporal.

El vídeo mostra precisament una jornada amb un guany aproximat del 25%. Una observació tan extrema pot dominar tot el resultat. Presentar-ne el CAGR sense posar en primer pla aquesta fragilitat faria semblar estable el que pot ser simple sort o contaminació de dades.

Fer exactament el contrari tampoc crea un avantatge

La idea més votada pels espectadors era invertir el senyal: si WallStreetBets s’equivoca, cal posar-se curt contra les accions més populars. La prova falla tant durant l’episodi de GameStop com en un període més ampli.

El creador informa d’un retorn medià aproximat del −1,09% per a les carteres curtes simulades entre 2025 i 2026, davant d’un guany pròxim al 18% de l’S&P 500. Les xifres són les que mostra el vídeo i no una verificació independent de les dades o del codi.

Hi ha una asimetria decisiva: en una compra ordinària, la pèrdua màxima d’una posició sense palanquejament és el capital invertit. En una venda en curt, el preu pot pujar sense un límit teòric i la pèrdua pot superar el capital inicial. FINRA adverteix també dels requisits de marge, els interessos i l’obligació de recomprar les accions prestades.

Per això «fer el contrari» no és el negatiu exacte de comprar. Canvien el perfil de risc, els costos, la disponibilitat de préstec i la possibilitat d’una liquidació forçosa.

El retrotest encara omet costos i friccions importants

Corregir el signe temporal elimina l’error més gros, però no converteix la simulació en una estratègia executable. Per aproximar-se a la realitat caldria incloure:

  • comissions i diferencial entre compra i venda;
  • lliscament, sobretot en accions volàtils;
  • cost i disponibilitat del préstec per a posicions curtes;
  • dividends que ha de pagar qui està curt;
  • suspensions de cotització i límits operatius;
  • liquiditat i impacte de mercat;
  • impostos;
  • univers d’accions que existia realment cada dia, per evitar biaix de supervivència.

També cal definir com es tracten els símbols ambigus. El vídeo detecta que paraules com «TECH», «BULL» o «MEME» poden coincidir amb tickers d’ETF i generar senyals falsos. Que l’efecte agregat sembli petit en una prova no garanteix que no alteri una operació concreta.

Què diu realment l’estudi d’Oxford

El treball Wisdom of the Crowds or Ignorance of the Masses? analitza publicacions i comentaris de WallStreetBets amb més amplitud que el bot del vídeo. Entre les seves observacions:

  • les publicacions solen arribar després d’una pujada i van seguides, de mitjana, d’un retrocés;
  • les grans agrupacions d’actius comentats tenen mal comportament predictiu;
  • alguns grups petits i especialitzats mostren senyals més prometedors;
  • determinades publicacions marcades com a anàlisi detallada —due diligence— es comporten millor que el flux general;
  • una relació de causalitat de Granger no demostra per si sola causalitat econòmica ni una estratègia rendible després de costos.

El vídeo recull la pista dels grups petits com a possible següent experiment. És una hipòtesi raonable per investigar, però seleccionar a posteriori els clústers que van funcionar obre una altra porta al sobreajust.

Com s’hauria de provar una segona versió

Una auditoria més robusta podria seguir aquest protocol:

  1. congelar la regla abans de mirar el període de prova;
  2. conservar marques de temps amb zona horària i disponibilitat real;
  3. entrenar i calibrar només amb dades anteriors;
  4. reservar un període final completament intocable;
  5. executar una validació walk-forward;
  6. afegir costos, lliscament i restriccions de venda en curt;
  7. comparar contra S&P 500, una cartera equiponderada i senyals aleatoris;
  8. informar rendibilitat, volatilitat, màxima caiguda i rotació;
  9. publicar tots els intents, no només el millor;
  10. provar després en paper trading abans d’arriscar diners.

FINRA i la SEC recomanen no basar una decisió exclusivament en eines de sentiment social: les dades poden ser incompletes, antigues, manipulades o tenir incentius ocults. També recorden que concentrar la cartera en un sol actiu augmenta el risc específic.

Conclusió

L’experiment és valuós precisament perquè fracassa de manera instructiva. El model classifica amb aparent solvència una selecció de textos, però el primer gran guany prové d’un error que deixa entrar informació futura. Quan es corregeix, comprar el sentiment positiu perd prop d’un 49% en el període mostrat i posar-se curt contra el fòrum tampoc supera el mercat.

La descoberta central és que predir sentiment no és predir rendibilitat. Per obtenir un senyal negociable cal demostrar que la informació arriba abans del moviment, sobreviu fora de mostra, cobreix costos i manté un risc acceptable. Sense aquestes proves, un gràfic espectacular és només una història que el retrotest explica sobre el passat.

Contrast i context

Fonts consultades

7 fonts
  1. 01
  2. 02
  3. 03
  4. 04
  5. 05
  6. 06
  7. 07

Font de treball

Transcripció amb marques de temps

10 fragments
Consulta la transcripció
  1. 0:00 , obre el vídeo en una pestanya nova

    I built the world's stupidest trading bot that uses Reddit posts to predict which stocks are about to explode before they actually do. And it failed miserably because Oxford beat me to the punch and has already developed an algorithm to do exactly this, which is now publicized. Last time I built a bot to trade off Wall Street bets and it lost to the S&P baseline. Then you guys left 600 comments detailing every important improvement I should make. And I went through every single one of them and have assembled a list that I will use to create the best Wall Street Bets trading algorithm implementing your suggestions to beat these brainiac Oxford quants with comment section creativity. So about the Oxford paper, they didn't actually build a trading algorithm. Instead, they built three specific places where a signal might exist [music] and then three big warnings about where it doesn't. Today, the comment section beats Oxford accuracy with five minutes of coding. Then, I want to go straight into every single warning that Oxford specifically told us to avoid. And by the end, I'm going to show you two doors that I still haven't opened yet, and which ones we're

  2. 1:00 , obre el vídeo en una pestanya nova

    going to be opening next. But before we beat Oxford, I owe the comment section one test, [music] the one everybody asked for, the one that got a,000 up votes. All right, so quick recap in case you missed my last video, by the way. Definitely go check that out. We had scanned through Wall Street Bets posts counting the number of mentions for a particular stock ticker every single day. We then bought the hype, basically the most popular stock for a given day, and then we sold it when it lost its popularity. And we lost to the S&P every single time, as expected. We then tried to buy the fastest risers, maybe stocks where mentions were spiking suddenly, and we also lost. So sadly, these two different strategies did not work. But you guys pointed out exactly why, and Oxford actually knew it, too. You can't just buy the most mentioned stock with the fastest riser because the sentiment could actually be negative. Maybe the company is about to declare bankruptcy and that's why everybody's talking about it. So, it's probably not a good time to buy. Oxford actually went through the effort of handlabeling 4,000 posts either bullish, bearish, or neutral. They then fine-tuned an AI called Finnbert and hit an accuracy of 69%. And

  3. 2:04 , obre el vídeo en una pestanya nova

    then they tested investing based on sentiment for every Wall Street Bets post and they lost money. Fantastic. >> [music] >> So, we do need sentiment. And boy oh boy, do I have a plan for this. But before we get to that, I have to address your most upvoted comment. Did you try doing the opposite? >> So, if the crowd is reliably wrong, then inverting them should be reliable, right? I mean, come on. It's basically free money. Let's bet against Wall Street bets, which means we will short the most mentioned stocks. [music] So when the company we bet on crashes, we see massive returns because surely the most mentioned stocks are overhyped right now. At first I chose the GameStop year running the back test from January to February of 2021. I know it's an interesting [music] time period to choose. Now this quickly resulted in all of us losing our money together as GameStop exploded in value and we lost everything during our short. We could run a bunch of individual random portfolios where we short stocks on the date they are mentioned in the subreddit. This could generally tell us if Wall Street Bets is on average consistently wrong. And maybe we can

  4. 3:10 , obre el vídeo en una pestanya nova

    make a profit by just betting against the [music] whole forum in general. And unfortunately, this too does not work with our portfolio coming in just below average market return. But running this during the GameStop year would be misleading. It was a massive outlier. So, let's pull data for the entirety of 2025. Now, what you're seeing is our simulated portfolio in green compared to the S&P in red. Even by shorting the most mentioned stock throughout this entire year, there's only a single fleeting moment where the strategy was beating the S&P. And how did we do by shorting random stocks on the Wall Street Bets forum? Well, also not great. These uncapped downsides mean that our risk is so much higher than simply buying and holding a stock, which results in these rather poor returns. The median return for our shorting strategy was approximately minus 1.09% over 2025 to 2026 as compared to the S&P return of about 18%. So do the opposite isn't a cheat code. [music] And we just confirmed Oxford's second warning that shorting the crowd does not work. But the comment section had a much better idea. The idea that 40 of you pointed out. Okay, quick thing. All of this goes up on GitHub for my sponsors. every

  5. 4:23 , obre el vídeo en una pestanya nova

    script, every back test, everything. 600 of you already run it and you can cancel any time, but every month I merge your ideas into the code. So, the people who stay get something that keeps getting smarter. Plus, you get to support a struggling PhD grad. Link in the description. I should maybe stop publishing this stuff because, as one of you have already pointed out, >> don't publish all [music] your secrets in a YouTube video. Tsunoo. >> Okay, back to the Oxford thing. Roughly 40 of you said the same thing. Use an LLM that classifies sentiment for each post. That way we know if people are bullish or bearish on a stock. [music] We buy the ones we like and short the ones we hate. Okay. Oxford did this too by labeling 4,000 posts by hand fine-tuned in a Finnbert model and hit an accuracy of 69%. [music] So that's the number that we have to beat. They did it with two PhDs hand labeling. And I'm going to use Finnbert for the entire [music] thing. Finnbert is just Google's language model that is specifically trained on financial sentiment data. It's able to generate an indicator for positive or negative sentiment based [music] on text alone. And yes, I know a

  6. 5:27 , obre el vídeo en una pestanya nova

    lot of posts are super sarcastic, but I'm hopeful we can beat this thing [music] regardless. So, I used Finn to classify posts from January to February of 2025 into positive or negative sentiment. Then, I validated them by hand to get a sense for its accuracy. I ended up checking about 200 posts with confidence levels above 90%. [music] And yeah, I know that this is like way less than the 4,000 posts manually validated by the Oxford level PhDs, but I am lazy and pucker up for this. In those 200 posts, the prediction accuracy that I found was 94%. [music] Which is pretty damn good. Now, full disclosure, I am cheating a little bit because the Oxford 69% accuracy was on three different classes, both bullish, bearish, and neutral. [music] And across every post, which is very difficult, some are sarcastic or not really obvious. I'm doing two classes only, both bearish and bullish on the easiest high confidence posts only, which I think makes [music] much more sense for creating a trading algorithm. The advantage in this case is that our algorithm only uses data that has high confidence [music] rather than the sarcastic posts that are uncertain. So with better accuracy, can we beat the

  7. 6:36 , obre el vídeo en una pestanya nova

    Oxford model? That is the question. Okay, this is a recap on the algorithm in case you're taking notes. Basically, every day we're going to scan through Wall Street Bets posts and label it as bullish or bearish using our LLM. Then each stock ticker mentioned, we calculate a score. I want the score to make use of positive and negative sentiment. And I also want it to be dead simple because I'm not that smart. So the score is going to be the number of bullish posts mentioning that stock minus the number of bearish posts mentioning that stock. Whichever stock has the highest score that day is the one that we're going to buy. We then hold it until a different stock takes the top spot. Then we rotate to that new one instead. I decided not to have any diversification because come on, live a little. In my short back test, we see that buying the stock with the highest positive sentiment does really well compared to buying and holding the S&P. This worked super well, and we even had a day give plus 25% returns. The total return over these two months was 51%. Which amounts to a compound annual growth rate of over a,000%. H the spy over the same time period [music]

  8. 7:45 , obre el vídeo en una pestanya nova

    did a compound annual growth rate of 10%. So, is this thing actually working? Am I making a massive mistake by uploading this video to YouTube? Is this commenter right? I genuinely don't know. But if my physics background taught me anything, it's that a good scientist always seeks to disprove himself. So, let's try to investigate this further. My first thought was that I got lucky. I mean, we only looked at January to February of 2025, so maybe let's look at all of 2025. I then pulled the data from January of 2025 to January of 2026 and let Finnbert get to work. And there are a lot of posts to classify, so this took a couple of hours. Okay. I mean, this is what I'd expect. It has no real edge. Uh oh. Oh gosh. Okay. Okay. This is working really well. All right. So, I went back to my code to investigate because if something looks too good to be true, it probably is. And I ended up finding this. This simple less than symbol is the difference between the code working or not. It's basically allowing us to use the current-day sentiment for tomorrow's prediction. But the way I had wrote it allowed the program to look at the community reaction and then buy it before the news has spread into the market value. Basically, I had really

  9. 8:58 , obre el vídeo en una pestanya nova

    bad look ahead bias. The model was cheating off of tomorrow's knowledge. So, now that we fixed our look ahead bias, we can rerun the code and see the results. Here we're going long on stocks based on high scores from our sentiment. We can see that the model unfortunately does not work. So simply following the crowd is definitely a bad idea. But stick around for a bit because we're not done yet. We still need to short Wall Street Bets based on sentiment. Following Wall Street Bets positive sentiment gave a 1-year return of minus 49%. Which is uh not good. Maybe you don't trust Wall Street bets with your next stock trade. So, what if we bet against stocks that have highc scoring positive sentiment? In my opinion, this is what would give the highest probability of working because we're purposely betting against a degenerate crowd of gamblers. So, we should have a pretty good shot at winning, right? Also, quick note, the algorithm flags words like tech, bull, and meme as tickers because they are real ETFs. So, when Wall Street Bets says this is a meme stock, my bot thinks they're hyping the meme ETF, which is a cute bug, but it doesn't really change the results by much. So, here we go.

  10. 10:06 , obre el vídeo en una pestanya nova

    Finally, let's short Wall Street Bets with sentiment. Now, we can see that the volatility is super high because of the uncapped downsides. And while the market in general took a downswing in February of 2025, which helped our short positions, we quickly lost all of our gains. and the S&P quickly recovers back to beating the strategy. So, no, it did not work. We walked into every warning Oxford left for us. Don't follow the hype. We did and lost 49%. Don't trade on aggregate forum sentiment. We did. No edge. But here's what we didn't do. Oxford's paper has a few findings I just glossed over, and I thought I'd save the best for last. Oxford built a network map of which assets get discussed together and most of the big clusters lost money. But small niche clusters did have positive returns. So maybe small groups of weirdos like me and you talking about boring stocks might actually work. Now we have a lot more work to do and I need your help. So drop a comment with your ideas and I will explore them in the next [music] video. The code for this is on GitHub. Have fun playing around with it. But if you solve something, you are obligated to tell me about it. I'll see you guys in the next one.