There is no mystery that the world is full of patterns and we're governed by them and the financial market are not exception of this rule. The time element such as the time of the day could also play a big role in how certain FX pairs may behave. There is an empirical research conducted by major institutions which suggest that there are strong evidence of a predictable time-of-day pattern in FX. This research was conducted by Angelo Ranaldo from SNB.

The main idea behind this article will be to turn a simple trading pattern backed up by an extensive empirical research into an automated trading system using the Visual JForex platform.

  • Time-of-Day Effect

The major currency pairs have a strong tendencies to depreciate during local trading hours and tend to appreciate during foreign trading hours. (eg. EUR/USD tends to depreciate in the European session and then appreciate in US session). These time-of-day patterns are statistically and economically highly significant as they show the tendency of market participants to be net purchasers of foreign exchange in their own trading hours. The research concluded that there are two main factors that can explain this pattern:

  1. Liquidity - determined by the imbalances between supply-demand equation at specific intraday times.
  2. Asymmetric information effects - local traders tend to have superior information because of their networking, trading location and the time zone in which they operate.
They come and suggest that liquidity is the detrimental factor for the time-of-day effect which is caused by portfolio balance effects. Going further there are two main factors that contribute to the portfolio balance effects:

  1. Domestic-currency bias - means that traders located in one specific country tend to hold assets denominated in the reference currency of that country. Their portfolios typically include domestic assets and, therefore, the domestic currency prevails over foreign currencies.
  2. Domestic-time bias - refers to the actual time when trading is done. For instance, US investors, brokers and dealers will tend to exchange US dollars against euros during the main US hours of work.
This are the basic premises behind the time-of-day pattern that suggest the home currency depreciates during domestic trading hours and appreciates during foreign trading hours. In aggregate, the geographic segmentation, coupled with the domestic-currency bias, creates sell-price (buy-price) pressure during domestic (counterpart) working hours.

  • Time-of-day Pattern Empirical analysis
The study has been conducted over a large period of time and has 10 year sample size. They begin by testing the relationship between hourly returns and the time of day for EUR/USD, and they defined the returns by using the mid-quote price at the end of each hour.

Figure 1. EUR/USD Statistical Properties of hourly FX Returns


" We present three basic tests of the relationship between hourly returns and time of day, a simple test of significant excess returns, an excess returns test adjusted for time-varying volatility and a non-parametric sign test of returns. " (Source: Research paper)

Figure 2. EUR/USD Hourly Return


The above figures shows clear evidence that hourly FX returns do seem to follow significant time of day patterns which, show that local currencies tend to depreciate during their own trading hours. Figure 3 tests the trading hours effect more precisely by conducting the tests on opening-to-closing or opening-to-opening in the case when the Europe and US session overlap.

Figure 3. EUR/USD Statistical Properties of trading day returns


Although the statistical test is not that compelling the pattern of probabilities is quite promising.

  • Time-of-Day Pattern Meets Visual JForex
Since we have some statistical evidences that this strategy can produce an edge it's time to put the theory into practice and model this theory into a simple base trading strategy. There can be multiple ways in which you can model this theory and because I like it to keep things simple, after multiple testing I came up with a strategy that has a positive expectancy.

Lets proceeded first by giving out the strategy summary:
  1. Currency pair: EURUSD;
  2. Time Frame: 1h;
  3. Target= Highest/Lowest point of the London Open-NY Open
  4. Stop Loss= 2pips below/above Highest/Lowest point;
  5. Trading Rules:
  • Buy at NY Open if the local currency is depreciating during local trading hours, range>20pips;
  • Sell at NY Open if the local currency is appreciating during local trading hours, range >20 pips;

Now that we have all the data required to build our strategy the only thing that remains to be done is to open Visual JForex and move forward with the implementation process. Since ours strategy requires us to know to range between the London Open and NY open we'll need to set a time range from 7:00 GMT to 13:00 GMT which can been done by using 2 conditional "IF" blocks (see Figure 4).

Figure 4. Range_Time block construction (click on figure to enlarge)



This part of the strategy is quite simple as all we need to do is to go through each candle time period by using a conditional "IF" block and than by using the "GetTimeUnit" we store the time of current candle in a new variable that I named it "Current_time". Than with an additional 2 "IF" blocks we used to find the time range between London Open and New York. Reminder: "GetTimeUnit" block settings you need to choose Hours. After you're done hold CTRL and select all the blocks to form a new Group, this way you keep the whiteboard clean and easy to follow through the strategy logic.


Figure 5. Finding the High and Low between the London Open and NY Open (click on figure to enlarge)

Next step we're going to find the London Open price and the High and Low of the session between the time when London session opens and NY session opens(see Figure 5). On this stage we're going to use quite a big numbers of blocks. The logic behind the block construction is simple we first need the "Get Historical Candles" block to store the price data (OHLC) in a new variable. From here we can have the open, high, low and close price of the next 5 candles, remember we only need the price data of the next 5 candles between London open and NY open. The "Loop Viewer" block is an iteration function that retrieves an array of data, which contains our price data. This will helps us to find the High and Low of our desire range. We're going to compare the current candle low with the "Lowest" price, variable that was assigned previously, and this cycle will continue until current candle low is less than the "Lowest" in which case the "Lowest" will become the new low. The same structure apply to determine the "Highest".

Once the cycle is over and we have found our price data the "Loop Viewer" cycle ends and we can move to next step.

Figure 6. Order Execution (click on figure to enlarge)

On this stage we're doing some calculation to find the range between London open and NY open, we also need to get the NY open price. If the London Price is greater than NY open price than we know the currency have been depreciating during the London session and we're going to buy it during NY session. And if London Price is less than NY open price than we know the currency have been appreciating during the London session and we're going to sell it during NY session. Another condition that has to be fulfilled is the range to be greater than 20 pips, we have to make sure there is enough space and target margins for our trade. You can either target the previous high'low of the range or either use a predefined target which was the option I choose.

  • Backtesting

Figure 7. Backtesting Results (click on figure to enlarge)

As it can been seen from the backtesting results the strategy does provide a positive expectancy, however the strategy does not perform so good when we have strong trends put in place, because under does conditions the currency tends to move uniformly across all major session and the time-of-day effect does not materialize so profoundly. I always like to keep things simple when it comes to trading and the time-of-day pattern does fulfill those criteria as it has strong empirical evidences of it's presence in the market as was proven by backtesting results.

Best Regards,
Daytrader21
Translate to English Show original