1 Introduction

The efficient market hypothesis (EMH) has been highly criticised during the last twenty years, especially on the basis of empirical evidence suggesting the presence of so-called “anomalies”, i.e. abnormal behaviour of asset prices which is seen as inconsistent with market efficiency. Since the seminal work of Mandelbrot (1963), several studies have shown that the Gaussian distribution provides a poor fit to the behaviour of asset prices, not being compatible with the random walk model implied by the EMH. As a result of this literature, fat tails, clustered volatility, long memory etc. have become well-known “stylized facts” characterising the behaviour of asset prices. The aim of this paper is to show that apparent statistical “anomalies” do not necessarily mean that the market is inefficient: if it is not possible to generate extra profits by exploiting them, they should be seen simply as statistical phenomena rather than as evidence of market inefficiency.

In particular, we focus on one of the best known anomalies, which is the presence of intraday patterns, i.e. more intensive trading at the beginning and the end of the trading day combined with higher price volatility (Admati and Pfleiderer 1988). For example, Wood et al. (1985) reported that all positive returns are earned during the first thirty minutes and at the market close. Harris (1986) showed that prices and last trades tend to be up during the first 45 min of trading sessions (all days except Monday). Such patterns were also mentioned by Thaler (1987) and Levy (2002). Strawinski and Slepaczuk (2008) found evidence of intraday patterns in the Warsaw Stock Exchange as well.

The main limitation of the above mentioned studies is that they neglect transaction costs: incorporating spreads, commissions and other fees and payments connected with the trading process can change the picture dramatically. Specifically, it can become clear that some of these “anomalies” cannot in fact be exploited, i.e. profitable trading is not possible, and this inability to obtain extra profits is fully consistent with the EMH.

The present study examines intraday patterns using a trading robot which simulates the actions of the trader and incorporates some transaction costs (spreads) into the analysis. The aim is to show that, as mentioned above, the presence of anomalies by itself does not necessarily represent evidence of market inefficiency, since it might not be possible to exploit them in practice. Obviously, speculators searching for profit opportunities are not simply blind followers of the crowd; instead, they quickly react on others’ behaviour, and as a result any arbitrage opportunities (based on deviations from fundamentals-based asset prices) will quickly disappear; however, it might be possible to exploit them in the very short run using an appropriate trading strategy. We analyse both a mature and an emerging stock market, namely 27 US companies included in the Dow Jones index, as well as 8 Blue-chip Russian companies. Further, we examine different sub-periods (2005–2006—“normal”; 2007–2009—“crisis”; 2010–2011—“post-crisis”) to establish whether there is evidence of changing behaviour depending on the phase of the economic cycle.

The remainder of the paper is structured as follows: Sect. 2 briefly reviews the literature on the efficient market hypothesis and market anomalies. Section 3 explains the method used for the analysis. Section 4 presents the empirical results. Section 5 offers some concluding remarks.

2 Literature Review

The EMH was initially formulated by Fama (1965), who argued that in an efficient market prices should fully reflect the available information and be unpredictable (see also Samuelson 1965). Fama (1970) then defined three forms of market efficiency (weak, semi-strong and strong). This theory has been used for the valuation of financial assets in terms of risk and uncertainty, and for devising portfolio strategies (see, inter alia, Sharpe 1965; Lintner 1965; Mossin 1966, and Treynor 1962). In the 1980’s, it was highly criticized as overlooking transaction costs, information asymmetry (Grossman and Stiglitz 1980), irrational behaviour etc. As a result many alternative theories and approaches were developed (behavioural finance, the adaptive market hypothesis, the fractal market hypothesis, etc.).

The main implication of the EMH is that traders should not be able to “beat” the market and make abnormal profits. An extensive literature analyses whether instead there exist market anomalies that can be exploited through appropriate trading strategies. This term was first used by Kuhn (1970). Schwert (2003) is an example of a study providing evidence of abnormalities which are inconsistent with asset pricing theories. Shiller (2000) and Akerlof and Shiller (2009) take the view that there are deep reasons for the presence of anomalies in financial markets, namely irrational behaviour of investors (animal spirits, the herd instinct, mass psychosis, mass panic), which is inconsistent with the EMH paradigm.

Jensen (1978) argued that anomalies can only be considered statistically significant when they generate excess returns. Raghubir and Das (1999) classify them as follows:

  • Anomalies related to prices and returns (contrarian trading, value investing, the size effect, momentum effect, the effect of closed-end funds);

  • Anomalies associated with trading volume and volatility (panic, bubbles on the markets);

  • Anomalies associated with the time series (the M&A effect, the IPO effect);

  • Other anomalies.

Jacobsen et al. (2005) distinguished between calendar, pricing and size anomalies. Examples of calendar (time) anomalies (the most frequently observed) are: End-of-Quarter Effect, Annual Worldwide Optimism Cycle Effect, Halloween Effect, 12-Month Cycle for Stock Returns Effect, Mid-year Point Effect, Two-Year Effect, Sector Performance by Calendar Month, Worst and Best Days of the Year Effect, January Effect, Monthly Effect, Turn-of-the-Month Effect, Labor Day Effect, Day of the Dividend Payments Effect, Trading Around Option Expiration Days and others.

Particularly important are intraday anomalies, including Half-of-the-Day Effects (abnormally low returns in the middle of a trading session, accompanied by a sharp fall in trading volumes); Last Hour and First Hour Effects (with the last hour of trading being the best, and the first hour the worst time in terms of returns); and the Time of the day anomaly (with securities tending to be up in the first 45 and last 15 min of the trading day).

Harris (1986) and Thaler (1987) examined 15-min intervals in asset prices movement to identify patterns in (the volatility of) returns (see also Levy 2002, and Dimson 1988). Harris (1986) found a time of the day anomaly in the first 45 min of a trading session of all days of the week except Monday and at the end of a trading day (approximately the last 5 min of the session). In his study of the Spanish stock market, Camino (1996) found positive returns in the first hour of the trading session in all trading days except Monday and Wednesday, and a strong tendency for prices to rise in the first and last 15-min periods of trading (see also Coroneo and Veredas 2006). Wood et al. (1985) reported jumps at the opening and closing of trading. Brooks et al. (2003) found higher trading volumes in the NYSE at the beginning and the end of the day. The possibility of using the U-shaped pattern by market participants to build trading strategies was emphasized by Abhyankar et al. (1997). The same pattern was found with respect to trading volume, return volatility and liquidity profile by Tissaoui (2012) in the Tunisian Stock Exchange. Table 1 gives details of additional relevant studies.

Table 1 Intraday anomalies: researches overview

3 Data and Methodology

Although most studies suggest the presence of anomalies in the first 45 min (or first hour) of the trading session, their results differ in terms of the exact time when the end-of-the-day anomaly emerges: the last transaction, the last 5 min, the last 15 min, the last hour. Chan (2005) reported that the overall average returns per minute in the Hong Kong stock market (over the last 30 min, over the last 10 min, over the last 5 min, and over the last 1 min) are statistically positive. However, the majority of studies consider 15-min intervals. Since the empirical literature does not provide clear evidence on intraday effects on specific weekdays (see, e.g., Strawinski and Slepaczuk 2008; Harris 1989), and since it is difficult to distinguish between time of the day and day of the week effects, we focus specifically on the last 15 min before the end of the trading session (see Levy 2002).

We look at the intraday anomaly from the trader’s viewpoint: is it possible to make profits from trading on intraday patterns (which would indicate market inefficiency)? In particular, we test the following hypotheses:

  • Hypothesis 1: first 45 min up effect exists (H1):

  • H1a—case of developed countries

  • H1b—case of developing countries

  • Hypothesis 2 last 15 min up effect exists (H2)

  • H2a—case of developed countries

  • H2b—case of developing countries

  • Hypothesis 3 the results for different periods (pre-crisis, crisis, and post-crisis) are statistically different (H3).

We use data at 15-min intervals for 27 US companies included in the Dow Jones index and 8 Blue-chip Russian companies. For the US the sample period is 2005–2011, and the following sub-periods are also considered:

  • 2005–2006—normal;

  • 2007–2009—crises;

  • 2010–2011—post-crises.

For Russia, owing to lack of data, the analysis is carried out only for the period 2011–2013.

Most studies on intraday anomalies do not incorporate transaction costs, even though trading is inevitably connected with spreads, fees and commissions to brokers. These costs can be divided into fixed and variable ones. The latter are present in each transaction. A typical example is the spread, which is incorporated into our analysis. Specifically, we programme a trading robot which automatically opens and closes positions according to the time of the day effect. Positions (in our case only the “long” ones) will be opened on “ask” price and closed on “bid” price, though we will incorporate the variable part of transactional costs in our analysis. The algorithm is constructed such that long positions are opened at the beginning of the trading session and are closed after 45 min (the first 45 min up effect mentioned by Harris (1986) and Levy (2002)), and are also opened at the end of the day. As we consider 15-min intervals, they are opened in the last 15 min of the trading session and are closed at the end of the session (the last 15 min of the day up effect mentioned by Levy 2002). We use a programme in the MetaTrader terminal that has been developed in MetaQuotes Language 4 (MQL4) and used for the automation of analytical and trading processes. Trading robots (called experts in MetaTrader) allow to analyse price data and manage trading activities on the basis of the signals received.

MetaQuotes Language 4 is the language for programming trade strategies built in the client terminal. The syntax of MQL4 is quite similar to that of the C language. It allows to programme trading robots that automate trade processes and is ideally suited for the implementation of trading strategies. The terminal allows not only to programme trading robots, but also to test them by checking their efficiency using historical data. These are saved in the MetaTrader terminal as bars and represent records appearing as TOHLCV (HST format). The trading terminal allows to test experts by various methods. By selecting smaller periods it is possible to see price fluctuations within bars, i.e., price changes will be reproduced more precisely. For example, when an expert is tested on one-hour data, price changes for a bar can be modelled using 1-min data. The price history stored in the client terminal includes only Bid prices. In order to model Ask prices, the strategy tester uses the current spread at the beginning of testing. However, a user can set a custom spread for testing in the “Spread”, thereby approximating better actual price movements. Positive profits \(>50~\%\) imply that H1 and H2 cannot be rejected. As for H3, we carry out t tests: H3 is rejected if \(t < tcritical\). The program codes for the trading robots used in this study are presented in Appendix 4 and 5.

4 Empirical Results

The testing procedure comprises two steps, i.e. initially testing the first 45 min up effect, and then the last 15 min up effect.

The complete results for the former are presented in Appendix 1. A summary for different time periods is shown in Table 2.

Table 2 Summary of testing results for the “first 45 min up effect”

As can be seen, all periods were unprofitable, with the probability of a profitable trade being less than 50 %. Hypothesis H1a is rejected, i.e. there is no evidence of a first 45 min up effect in the US stock market. Table 3 reports the t test for H3 for different sub-periods: here is rejected in all cases. Table 4 shows that H3 is not rejected for net profit per deal in any of the sub-periods.

Table 3 t test for profit trades (% of total)
Table 4 t test for net profit per deal

The complete results for the last 15 min up effect are presented in Appendix 2. A summary for the different time periods is displayed in Table 5.

Table 5 Summary of testing results for the “last 15 min up effect”

All periods were unprofitable, with the probability of a profitable trade being less than 40 %. Hypothesis H2a is rejected: there is no last 15 min up effect in the US stock market.

The t tests for H3 for different sub periods are displayed in Table 6: this hypothesis cannot be rejected, and this applies to all sub-periods.

Table 6 t test for profit trades (% of total)

Table 7 shows that H3 is rejected for net profit per deal. There is no evidence of differences between sub-periods.

Table 7 t test for net profit per deal

The complete results for Russia are presented in Appendix 3. A summary is provided in Table 8: H1b and H2b are rejected again, indicating the absence of the intraday anomaly being considered in a less developed market as well.

Table 8 Summary for the Russian stock market

5 Conclusions

The empirical relevance of the EMH has been called into question by many studies finding evidence of so-called anomalies seemingly giving agents the opportunity to make abnormal profits. This paper argues that the presence of anomalies does not necessarily represent evidence of market inefficiency (risk-free profit opportunities): using a trading robot simulating the actions of a trader we show in the case of intraday patterns that, if transaction costs are taken into account, there are no profitable trading strategies (i.e. opportunities to make abnormal profits exploiting this type of anomaly), and therefore no evidence against the EMH.

Specifically, we consider a well-known “time of the day anomaly”: prices tend to be up during the first 45 min and the last 15 min of the trading session.

We test 3 hypotheses:

  • Hypothesis 1: first 45 min up effect exists (H1):

  • Hypothesis 2: last 15 min up effect exists (H2)

  • Hypothesis 3: results for different periods (pre-crisis, crisis, and post-crisis) are statistically different (H3)

These hypotheses are rejected for both the US and Russia, a mature and less developed stock market respectively. The only exception is H3: the results for the last 15 min up effect vary depending on the sub-period considered.

On the whole, our analysis implies that it is not possible to exploit intraday patterns to make abnormal profits. This suggests that the results from previous studies purporting to provide evidence of exploitable profit opportunities resulting from market anomalies (which would be inconsistent with the EMH) were in fact misleading because they did not take into account transaction costs. The trading robot approach used in the present study can also be used to analyse other anomalies, but this is left for future work.