ARTÍCULOS ORIGINALES
E-ISSN 2389-8194
Vol. 10, No. 2
Julio-diciembre de 2023
doi: https://doi.org/10.16967/23898186.843
pp. 6-16
rpe.ceipa.edu.co
* Doctor in Business Economics and Finance. Universidad Rey Juan Carlos de Madrid, Madrid, Spain. E-mail: raul.
gomez.martinez@urjc.es. ORCID: 0000-0003-3575-7970. Google Scholar: https://scholar.google.com.ec/
citations?hl=es&user=yI03nEgAAAAJ. Scopus Author ID: https://www.scopus.com/authid/detail.uri?authorId=55624260800.
** Doctor in Business Economics and Finance. Universidad Rey Juan Carlos de Madrid, Madrid, Spain. E-mail:
marialuisa.medrano@urjc.es. ORCID: 0000-0003-1844-1034. Google Scholar: https://scholar.google.com/
citations?hl=en&user=C4MEk7gAAAAJ. Scopus Author ID: https://www.scopus.com/authid/detail.uri?authorId=55342658600.
*** Chemical Engineer. Universidad de Santiago de Compostela, La Coruna, Spain: E-mail: jaime.veiga@rai.usc.es.
ORCID: 0000-0002-7139-4743. Google Scholar: https://scholar.google.com/citations?hl=en&user=ZmLSU3UAAAAJ.
Investment strategies based on
investors’ mood: Better for crypto
RAÚL GÓMEZ MARTÍNEZ*
MARÍA LUISA MEDRANO GARCÍA**
JAIME VEIGA MATEOS***
E-ISSN 2389-8194
Vol. 10, No. 2
Julio-diciembre de 2023
doi: https://doi.org/10.16967/23898186.843
COMO CITAR ESTE ARTÍCULO
How to cite this article:
Gómez, R., Medrano, M.L. and
Veiga, J. (2023). Investment
strategies based on investors’
mood: Better for crypto. Revista
Perspectiva Empresarial, 10(2),
6-16.
Recibido: 27 de enero de 2023
Aceptado: 12 de julio de 2023
ABSTRACT Objective. Analyze the utility of an algorithmic trading system based on articial
intelligence models that uses Google Trends as predictor of dozens of nancial terms, to
predict the evolution of S&P 500 index and Bitcoin. Methodology. A trading algorithmic
system has been developed that opens a weekly long or short position in S&P 500 and Bitcoin,
following the signals issued by an articial intelligence model that uses Google Tends as
predictor for next week market trend. The articial intelligence models were trained using
weekly data from 2013 to 2018 and have been tested in a prospective way from February
2018 to December 2021. Results. Google Trends is a good predictor for global investors’
mood. The articial intelligence algorithmic trading systems tested in a prospective way
has been protable. Trading strategies based on investors’ mood have been more accurate
and protable for Bitcoin (beating the evolution of the cryptocurrency) than for S&P 500
(not beating the index). Conclusions. This evidence opens a new eld for the investigation
of trading systems based on big data instead of Chartism. Although there are many trading
systems based on Chartism, there are no articial intelligence trading systems operating
in real market, this investigation could be considered pioneer in this eld.
KEY WORDS Big data, behavioral nance, investors’ mood, articial intelligence, Google
Trends.
Estrategias de inversión basadas en el estado de ánimo de los inversores:
mejor para las criptomonedas
RESUMEN Objetivo. Analizar la ecacia de un sistema de trading algorítmico basado en
modelos de inteligencia articial que utiliza Google Trends como predictor de términos
nancieros para pronosticar la evolución del índice S&P 500 y del Bitcoin. Metodología.
Se ha desarrollado un sistema de trading algorítmico que abre una posición semanal larga
o corta en el índice S&P 500 y en Bitcoin, siguiendo las señales emitidas por un modelo de
inteligencia articial que utiliza Google Trends como predictor de la tendencia del mercado
de la semana siguiente. Los modelos de inteligencia articial se entrenaron utilizando datos
semanales desde 2013 hasta 2018 y se sometieron a pruebas prospectivas desde febrero
de 2018 hasta diciembre de 2021. Resultados. Google Trends sirve como predictor able
del estado de ánimo de los inversores globales. Los sistemas de trading algorítmico de
inteligencia articial que se sometieron a pruebas prospectivas demostraron ser rentables.
Las estrategias de trading basadas en el estado de ánimo de los inversores proporcionan
más precisión y rentabilidad para Bitcoin (superando la evolución de la criptomoneda) que
para el S&P 500 (sin superar al índice). Conclusiones. Esta evidencia presenta un nuevo
campo de investigación de sistemas de trading basados en big data y no en el chartismo.
A pesar de la existencia de numerosos sistemas de trading basados en el chartismo, hoy
no existen sistemas de trading de inteligencia articial que estén operando en el mercado
real. Por tanto, esta investigación se puede considerar pionera en este campo.
PALABRAS CLAVE big data, nanzas conductuales, estado de ánimo de los inversores,
inteligencia articial, Google Trends.
8
ARTÍCULOS ORIGINALES
RAÚL GÓMEZ MARTÍNEZ, MARÍA LUISA MEDRANO GARCÍA, JAIME VEIGA MATEOS
Revista Perspectiva Empresarial, Vol. 10, No. 2, julio-diciembre de 2023, 6-16
E-ISSN 2389-8194
Estratégias de investimento baseadas no humor do investidor: melhor
para criptomoedas
RESUMO Objetivo. Analise a ecácia de um sistema de negociação algorítmico
baseado em modelos de inteligência articial que utiliza o Google Trends como
preditor de termos nanceiros para prever a evolução do índice S&P 500 e do Bitcoin.
Metodologia. Foi desenvolvido um sistema de negociação algorítmico que abre
uma posição longa ou curta semanal no índice S&P 500 e em Bitcoin, seguindo os
sinais emitidos por um modelo de inteligência articial que utiliza o Google Trends
como preditor da tendência do mercado para a semana seguinte. Os modelos de
inteligência articial foram treinados usando dados semanais de 2013 a 2018 e
testados prospectivamente de fevereiro de 2018 a dezembro de 2021. Resultados.
O Google Trends serve como um preditor conável do humor dos investidores
globais. Os sistemas de negociação algorítmica de inteligência articial que foram
submetidos a testes prospectivos provaram ser lucrativos. As estratégias de negociação
baseadas no humor do investidor proporcionam mais precisão e lucratividade para o
Bitcoin (superando a criptomoeda) do que para o S&P 500 (sem superando o índice).
Conclusões. Esta evidência apresenta um novo campo de investigação sobre sistemas
de negociação baseados em big data e não no chartismo. Apesar da existência de
numerosos sistemas de negociação baseados no chartismo, hoje não existem sistemas
de negociação de inteligência articial que operem no mercado real. Portanto, esta
pesquisa pode ser considerada pioneira neste campo.
PALAVRAS CHAVE big data, nanças comportamentais, humor do investidor,
inteligência articial, Google Trends.
9
ARTÍCULOS
RAÚL GÓMEZ MARTÍNEZ, MARÍA LUISA MEDRANO GARCÍA, JAIME VEIGA MATEOS
Revista Perspectiva Empresarial, Vol. 10, No. 2, julio-diciembre de 2023, 6-16
E-ISSN 2389-8194
Introduction

markets in an unattended way, sending buy and

instrument, according to a complex mathematical
algorithm. Most of the trading systems that are
operating nowadays follows Chartism rules, but
the irruption of big data in asset management has
opened a new approach for algorithmic trading.
There are a number of studies that analyzes
how investors’ mood is affected by different factors,
changes over time and may be conditioned by
experience or training (Cohen and Kudryavtsev,
2012). These changes in investors’ mood provide
evidence of anomalies in the stock markets returns
(Nofsinguer, 2005). Corredor, Ferrer and Santamaría

effect on stock performance.
Previous studies demonstrated that weather
affect to the stock market returns (Hirshleifer and
Shumway, 2003; Jacobsen and Marquering, 2008)
as sunny climates are associated with an optimistic
mood and then positive returns. On the other hand,
seasonal patterns like vacations that implies the
effect of “sell in May and go away” or the “Halloween
effect (Bouman and Jacobsen, 2002) means that
securities market yield should be greater from
November to April than from May to October. And
strange as it may seem, the Moon (Yuan, Zheng and
Zhu, 2006) implies different returns according to the
different phases of the moon observing differences
from 3 % to 5 % in yield from one phase to another.
Other studies are focused on how the sports

mood. Edmans, García and Norli (2007) studied the
results of football, cricket, rugby and basketball;
while others have focused on the NFL (Chang et al.,
2012), football (Berument, Ceylan and Gozpinar,
2006; Kaplanski and Levy, 2010), and on cricket
(Mishra and Smyth, 2010). Gómez and Prado (2014)
performed a statistical analysis of the following
stock markets session return after national team
football matches. The results obtained show that
after a defeat of the national team, we should expect
negative and lower than average prices on the
country’s stock market, the opposite occurring in
the case of a victory.
At this stage, if we believe that investor mood

2015), the challenge is how could we quantify
mood to predict market trend (Hilton, 2001). This
objective leads us to a big data approach.
Searching online means a source of big data.
Agarwal, Kumar and Goel (2019) review the research
work about the impact of the information content
of the Internet over the retail investors’ trading
patterns. Wu et al. (2013) use big data to predict
market volatility, and Moat et al. (2013) use the
frequency of use of Wikipedia to determine investor
feelings. Apart from these stats, Google Trends is
one of the sources researched. This service provides
aggregated information on the volume of queries
for different search terms and its evolution over
time. So, academic literature evidence that Google
Trends is a good predictor in Medicine (Carneiro
and Mylonakis, 2009), Economy (Choi and Varian,
2012), Engineering (Rech, 2007), between others.
In Finance, Moat et al. (2013) they point out that
Google Trends is be able to anticipate the stock
market falls because in the precede period investors

this way, Gómez (2013) elaborated a “Risk Aversion
Index” based on the stats of Google Trends for
certain economic and financial terms that relate
to market growth. Through an econometric model,
he shows that Google Trends provide relevant

and may generate investment signs that can be
used to predict the growth of major European stock
markets. According to this approach, we propose an
algorithmic trading system that issues buy and sell
orders by measuring the level of aversion to risk,
if an increase in tolerance towards risk implies a
bull market and an increase in aversion to risk a
bear market.
In this paper we will describe big data trading
algorithmic systems that, instead of Chartism
   
based on Google Trends to predict de evolution of

Bitcoin.
After this introduction, it discusses the research
methodology and what is the main hypothesis. I
also know describes how the data was collected;
presents itself the model outputs, followed with
conclusions respective.
10
ARTÍCULOS ORIGINALES
RAÚL GÓMEZ MARTÍNEZ, MARÍA LUISA MEDRANO GARCÍA, JAIME VEIGA MATEOS
Revista Perspectiva Empresarial, Vol. 10, No. 2, julio-diciembre de 2023, 6-16
E-ISSN 2389-8194
Methodology

based on the market capitalizations of 500 large
companies having common stock listed on the NYSE,

was developed and continues to be maintained by

the Dow Jones Industrial Average and the NASDAQ
Composite index, because of its diverse constituency
and weighting methodology. It is one of the most
commonly followed equity indices, and one of the
best representations of the US stock market.
On the other hand, Bitcoin is a decentralized
digital currency created in January 2009. It follows
the ideas set out in a white paper by the mysterious
(under the pseudonym) Satoshi Nakamoto. Bitcoin
offers the promise of lower transaction fees than
traditional online payment mechanisms do, and
unlike government-issued currencies, it is operated
by a decentralized authority.
The following statistics are mainly used to
measure the perform of an algorithmic trading
system (Leshik and Crall, 2011): (i) ,
the total amount generated by the system from its
transactions over a certain period; (ii) ,
percentage of successful transactions out of the total
transactions, if the percentage is above 50 %, the

the better the system; (iii) , this rate
shows the relationship between earnings and
losses, by dividing total earnings by total losses. A
rate higher than 1 implies positive returns and the
higher the rate, the better; (iv) , relates

better the performance of the system (Sharpe, 1994).
InvestMood Fintech developed in January 2017
several algorithmic trading systems for different

the volume of searches registered in Google on
 

Since 2004 in which Google Trends began to publish
these statistics, it is observed that bearish markets
imply high level of searches of terms such as crash,
recession or short selling, while bull markets
imply low levels of this searches. Bearing this in

has created big data algorithmic trading systems
that open long or short positions following an AI
model in which the predictors are Google Trends
stats while the target variable is the next evolution
of this index (up/down).
The process of the algorithm is the following
one:
(i) Every Sunday an AI model is trained, using
a weekly sample downloaded from Google Trends

a prediction for next week trend. Google Trends

do not have any restriction by localization.
(ii) The system opens a long or short position
in the market following the prediction issued by
the AI model and maintains a long or short open
position until there is a new prediction in the
opposite direction.
From this point, the hypothesis to study is the
following one:
H1: A big data algorithmic trading system based
on AI models over investors’ mood can generate
positive returns.
We will validate this hypothesis if we reach

simulation is positive; (ii) Success rate is higher than

       
downloaded from Investing.com webpage. From
this data we deduce our target variable that can
only have two values: up/down. Goggle Trends has
historic data available from 2004 in a monthly base

We use data downloaded from Google Trends since

Each week, the sample increases with one more
observation that we incorporate into the training
dataset to generate a new AI model that we will use
for the next prediction.
As this study have been done in a prospective
way (we train the model every week, we generate
the prediction, and we have to wait for a week to
observe if the prediction is right or wrong) the study
has been developed for almost 4 years.
11
ARTÍCULOS
RAÚL GÓMEZ MARTÍNEZ, MARÍA LUISA MEDRANO GARCÍA, JAIME VEIGA MATEOS
Revista Perspectiva Empresarial, Vol. 10, No. 2, julio-diciembre de 2023, 6-16
E-ISSN 2389-8194
Results
The AI models created for the trading systems
has been trained using the algorithms of dVelox, a

These algorithms build a Bayesian Network (Bayes,
1763) like the Figure 1. For a better understanding
Figure 2 shows the same model in 2D view.
Figure 1. Bayesian Network for S&P 500 trading system. Source: authors own elaboration.
These graphs show the causality connection
between our target variable (green, in this case

and the interest of the investors on different
features of the market, measured by the number
of searches made in Google, available in Google
Trends. This is our explanatory variables as a
metric for investors’ mood.
12
ARTÍCULOS ORIGINALES
RAÚL GÓMEZ MARTÍNEZ, MARÍA LUISA MEDRANO GARCÍA, JAIME VEIGA MATEOS
Revista Perspectiva Empresarial, Vol. 10, No. 2, julio-diciembre de 2023, 6-16
E-ISSN 2389-8194
Figure 2. Bayesian Network for S&P 500 trading system (2D). Source: authors own elaboration.
In the same way, the model trained by dVelox for Bitcoin is shown in Figures 3 and 4.
Figure 3. Bayesian Network for S&P 500 trading system (3D). Source: authors own elaboration.
13
ARTÍCULOS
RAÚL GÓMEZ MARTÍNEZ, MARÍA LUISA MEDRANO GARCÍA, JAIME VEIGA MATEOS
Revista Perspectiva Empresarial, Vol. 10, No. 2, julio-diciembre de 2023, 6-16
E-ISSN 2389-8194
Figure 4. Bayesian Network for S&P 500 trading system (2D). Source: authors own elaboration.

500 system, form February 2018 to December 2021.

of the trading system that opens a weekly long or
short position following the signal of the AI model


like a indexed fund.
Figure 5. Prospective simulation of InvestMood trading system on S&P 500 vs the market. Source: authors own elaboration.
14
ARTÍCULOS ORIGINALES
RAÚL GÓMEZ MARTÍNEZ, MARÍA LUISA MEDRANO GARCÍA, JAIME VEIGA MATEOS
Revista Perspectiva Empresarial, Vol. 10, No. 2, julio-diciembre de 2023, 6-16
E-ISSN 2389-8194
We observe that the evolution of the trading

system has not been able to beat the market because
its evolution since June 2021.

of the trading system prospective evolution on
Bitcoin and its comparation with the evolution of
the Bitcoin.
Figure 6. Prospective simulation of InvestMood trading system on BTC vs the market. Source: authors own elaboration.
In addition, we observe that the evolution of

the direct investment in Bitcoin.
Table 1 sums up the stats of both trading systems
prospective simulation, and its comparation with

Table 1. Prospective simulation of InvestMood trading system on BTC vs the market
BTC IM_BTC SPX IM_SPX
Net Return $ $ 42397.45 $ 120404.11 $ 7766.01 $ 4020.10
Net Return % 424 % 1204 % 78 % 40 %
Net Annual Return 109 % 309 % 20 % 10 %
Prot Factor 1.28 1.17 1.40 1.23
Volatility 10.59 % 10.52 % 2.77 % 2.78 %
Sharpe Ratio 10.27 29.35 7.19 3.71
Succes rate n.a. 57 % n.a. 53 %
Source: authors own elaboration.
15
ARTÍCULOS
RAÚL GÓMEZ MARTÍNEZ, MARÍA LUISA MEDRANO GARCÍA, JAIME VEIGA MATEOS
Revista Perspectiva Empresarial, Vol. 10, No. 2, julio-diciembre de 2023, 6-16
E-ISSN 2389-8194
So, we should highlight these points: (i) Al


and loss) is over 1, so all the strategies have been

Ratios, higher for Bitcoin despite a higher volatily;
(iv) An investment of 10000 USD has generated a
ROI of 1204 %, if we use the signals of the AI model
for BTC and a ROI of 40 %, if we use the signals of the

between right predictions and total predictions of
the AI models) is higher for the strategy on BTC

Nevertheless, both ratios are over 50 % so we

Therefore, we should validate H1 hypothesis of
this study, and it is clear that the performance of a
trading strategy based on an AI model on investors’

Conclusions
In this study, we used an innovative approach to

the investors’ mood to predict the evolution of the

Bitcoin. The study is based on big data and uses AI to
predict the weekly trend of the index (up or down)
and the cryptocurrency. We can check that these

both in bullish and bearish market.
First conclusion is that Google Trends is a good
investors’ sentiment metric. Taking into account that

increase and decrease depending on the optimism
or pessimism of the market, so we observe through
the results of this study that this metric provides
value and a certain predictive capacity.
Second conclusion from this study is that trading
systems can be developed using an alternative
approach to common systems based on technical
analysis. This study has shown how this trading

positive returns in a long/short strategy, all these
operations based on the predictions of an AI model
that uses investors’ mood from Google Trends.
The third conclusion that we can obtain focuses


500 real companies, which publish their results,
and therefore, company valuation methods can
be applied by calculating their theoretical price.
These valuation methods cannot be applied to
cryptocurrencies and their evolution is conditioned
by the expectations of investors about the use of
cryptocurrency and the expansion of blockchain
technology. For this reason, we observe that investor
sentiment is a more effective leading indicator in
those instruments that are more conditioned by
expectations. Therefore, investor sentiment is a
better analysis tool for cryptocurrencies than for
equity markets.

the development of algorithmic trading.
References
Agarwal, S., Kumar, S. and Goel, U. (2019). Stock market
response to information diffusion through internet
sources: A literature review.  
, 45(6), 118-131.
Bayes, T. (1763). An Essay towards solving a Problem in
the Doctrine of Chances. 
, 53, 370-418.
Berument, H., Ceylan, N.B. and Gozpinar, E. (2006).
Performance of soccer on the stock market:
Evidence from turkey.    ,
43(4), 695-699.
Bouman, S. and Jacobsen, B. (2002). The Halloween
indicator, “sell in may y go away”: Another puzzle.
, 92(5), 1618-1635.
Carneiro, H.A. and Mylonakis, E. (2009). Google trends:
a web-based tool for real-time surveillance of
disease outbreaks.   ,
49(10), 1557-1564.
Chang, S. et al. (2012). Local sports sentiment y returns of
     
, 19(3), 309-318.
Choi, H. and Varian, H. (2012). Predicting the present
with Google Trends. , 88, 2-9.
16
ARTÍCULOS ORIGINALES
RAÚL GÓMEZ MARTÍNEZ, MARÍA LUISA MEDRANO GARCÍA, JAIME VEIGA MATEOS
Revista Perspectiva Empresarial, Vol. 10, No. 2, julio-diciembre de 2023, 6-16
E-ISSN 2389-8194
Cohen, G. and Kudryavtsev, A. (2012). Investor
Rationality and Financial Decisions.  
, 13(1), 11-16.
Corredor, P., Ferrer, E. y Santamaría, R. (2013). El
sentimiento del inversor y las rentabilidades de
las acciones. El caso español.   
, 42(158), 211-237.
Edmans, A., García, D. and Norli, Ø. (2007). Sports
sentiment y stock returns. ,
62(4), 1967-1998.
Gómez, R. (2013). Señales de inversión basadas en
un índice de aversión al riesgo. 
       ,
19(3), 147-157.
Gómez, R. y Prado, C. (2014). Sentimiento del inversor,
      
sobre sus índices nacionales.   
, 23(3), 99-114.
Hilton, D.J. (2001). The Psychology of Financial
Decision-Making: Applications to Trading, Dealing,
and Investment Analysis. 
, 2(1), 37-53.
Hirshleifer, D. and Shumway, T. (2003). Good day
sunshine: Stock returns y the weather. 
, 58(3), 1009-1032.
Jacobsen, B. and Marquering, W. (2008). Is it the
weather? , 32(4), 526-
540.
Kaplanski, G. and Levy, H. (2010). Exploitable
predictable irrationality: The FIFA world cup effect
on the U.S. stock market.    
, 45(2), 535-553.
Leshik, E. and Crall, J. (2011).   
.
New Jersey, USA: Wiley.
Liu, S. (2015). Investor Sentiment and Stock Market
Liquidity, 16(1), 51-67.
Mishra, V. and Smyth, R. (2010). An examination of the
impact of India’s performance in one-day cricket
internationals on the Indian stock market. 
, 18(3), 319-334.
Moat, H.S. et al. (2013). Quantifying Wikipedia usage
patterns before stock market moves. 
, 3, 1801.
Nofsinguer, J.R. (2005). Social Mood and Financial
Economics.    , 6(3),
144-160.
Rech, J. (2007). Discovering trends in software
engineering with google trend.  
, 32(2), 1-2.
Sharpe, W.F. (1994). The Sharpe ratio properly used
it can improve investment management. 
, 21(1), 49-58.
Yuan, K., Zheng, L. and Zhu, Q. (2006). Are investors
moonstruck? lunar phases y stock returns. 
, 13(1), 1-23.
Wu, K. et al. (2013). A Big Data Approach to Analyzing
Market Volatility.  , 2(3-4),
241-267.