GOOGLE TRENDS AS PREDICTOR OF GRAIN PRICES

This paper examines the predictive power of Google trends on the grain’s futures price movement. The aim was to validate if an algorithmic trading system designed was profitable and able of beating the market. In the research was used data from soybean futures and corn futures, both contracts are listed in the Chicago Mercantile Exchange. The results of the research show that its forecasting power is high when predicting soybean futures and corn futures prices. According to the findings, the formulation of such predictive analysis is a good option for individual traders, investors, and commercial firms. © 2021 EA. All rights reserved.


Introduction
Uncertainties press the agriculture prices. Li and Lu (2012) identify several factors such as the rapid growth of some important emerging countries (China, India), speculative trading from financial markets, the climate change, variations in harvest and inventory levels of agricultural and the biofuel programs of the United States and the European Union According to Valiente (2013), the formation of the price of physical commodities and futures contracts is a combination of idiosyncratic factors (such as product characteristics -quality, storability, etc.-and supply and demand factors -capital intensity, industry concentration, technological developments, etc.-) and exogenous factors (such as access to finance, public subsidies and interventions and the weather). In particular, the price of agricultural and soft commodities is more influenced by demand factors (i.e. income growth) and exogenous factors that can cause supply shocks (i.e. government policies or weather). Also, wide academic literature shows the impact of macroeconomic and But would it possible to know if there is an expectation of a good or bad harvest using the big data? To answer this question, Google trends could be a useful tool. This service provides aggregated information on the volume of queries for different search terms and its evolution over time. So, multiple 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, Preis, Moat and Stanley (2013) points that Google trends is be able to anticipate the stock market falls because in the precede period investors reflects their concerns about financial market. In 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 information on the performance of financial markets and may generate investment signs that can be used to predict the performance 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, this implies a bull market and an increase in aversion to risk, a bear market For grain commodities case, Google trends peaks are observed in moments of maximum tension on a topic. Figure 1 show the historical series of Google searches of the topics "Dow Jones" and "Maize". It is noted that the largest searches for Dow Jones occurred in October 2008, coincide with the bankruptcy of Lehman Brothers, so we can check that Google trends is a good thermometer to measure stock market uncertainty. For cereals, we see in Figure 1 that there is a pattern in the searches of the topic "Maize" with higher number of searches after the summer and low number of searches during winter. Then, could it be said that the price of grain follows the evolution of the expectations patter draw by Google trends?
In this paper we will describe a trading algorithmic system that opens long and short positions according to the patter shown by Google trends. If a higher (lower) number of searches could be understood as a higher (lower) level of uncertainty, the trading system will open a short (long) position in the corn and soybean futures markets.
After this introduction, in section 2 hypothesis and methodology are presented, in section 3 results are showed, and the last section is the conclusion.

Hypothesis and methodology
The hypothesis to test is the following one: searches increase and, therefore, it is interpreted that uncertainty about the price of grain increases. And long positions will be taken in the months in which searches decrease.
We will validate H0 if the algorithmic trading systems developed are profitable and records a good performance with profit factor (the sum up of winning amounts divided by the sum up of losing amounts) bigger than 1, winning sessions ratio bigger than 50% and a positive Sharpe ratio (Kaufman, 2016).
In Figure 2, we can check that the pattern draw by Google trends for uncertainty is similar for the topics "Maize", "corn" and "Soybean". The H0 hypothesis would be validated if the algorithmic trading system designed was profitable and able of beating the market.
Considering that we observe the statistics of Google trends since January 2004 to August 2019 with monthly frequency, the backtesting was carried out from that same date and with that same frequency.
The simulation of the back testing was carried out with the Trading Motion SDK (IBroker Global, 2021) that obtains prices directly from the market by belonging to the iBroker Global Markets company. Figure 3 plots the profit and loses chart of the trading algorithmic system for soybean futures. We can check in Figure 3 that the algorithmic trading system is profitable for the studied period whereas soybean price is almost plane for the fifteen years period studied. The performance of this system is sum up in Table 1.

Results
Net and Gross Profit and Loses are positive, as it was shown in Figure 3, but there is another statistic that points out the profitability of the system. We can check that "profit factor" is bigger than 1, so the systems should be profitable. Sharpe ratio is also positive, and the winning sessions ratio is over 50%.  Figure 4 plots the profit and loses chart of the trading algorithmic system for corn futures, the second underlaying asset to study in this paper. Again, the chart shows a profitable system (green area) that beats underlaying market price for the period studied form 2004 (red line).
The stats of the backtest of the algorithmic trading system for corn futures are like the stats of the algorithmic trading system for soybean futures. Again, Net and Gross profit are positive, with profit factor bigger than 1 and a winning sessions rate over 50%.
The main stats of the algorithmic trading system for soybean futures are presented in Table 2.

Conclusion
For many years, stock market analysis on any financial instrument was based on technical analysis or fundamental analysis. In the field of soft commodities, specifically for commodities in the agricultural sector, multiple investment strategies have been developed based on prices supports and resistances, or on several technical analysis indicators.
In contrast to this traditional approach, the development of behavioral finance is facilitating the appearance of new trading strategies, based on the investors' mood from different indicators extracted from the big data and social networks.
This article shows the development of two algorithmic trading systems that are not based on the traditional quantitative models of technical analysis. In this case, the investment decisions have been deducted from the interest that investments in soy and corn generate on the Internet.
Thus, we have observed that Google trends helps to identify patterns of uncertainty about an item, in this case the prices of the main agricultural commodities such as soybeans and corn, which allows us to anticipate price formation and obtain positive returns.