Machine Learning in Forex Trading: First results from shifted timeframes

Earlier this month I wrote a post about shifted timeframes and how we could use them to achieve a potentially much higher level of diversification in trading system generation. The idea is to gain diversification by creating systems using new information at the same level of computational cost. We expect shifted timeframes to work almost as entirely new symbols, providing us with new uncorrelated systems without needing to completely change the instruments being traded. Today I am going to talk about my first results when using shifted timeframes in machine learning and how their use has led to significantly better results on symbols different to the EUR/USD on the daily timeframe. I will talk about the amount of acceptable systems I have found, how these compare with other systems and how systems generated across different shifts correlate.


To start the journey into the use of shifted timeframes I wanted to see if their use solved the problem with the generation of historically profitable machine learning systems on the daily timeframe for symbols different to the EUR/USD. In the past I made some significant efforts to generate good systems on the daily timeframe but my efforts were only successful on the EUR/USD. In the end I concluded that generating good systems for other symbols on the normal 1D was not possible because the entry times were constrained to points that were naturally unfavorable for non-EUR/USD instruments. However the use of shifted daily timeframes completely eliminates this constraint – since I now have access to 24 new potential entry points – giving me the opportunity to explore whether this fixes the issues with different symbols.

I decided to test this hypothesis using a neural network machine learning algorithm that retrains at the beginning of each bar using a past set number of examples (a moving window of examples). These examples are built using past Heiken-Ashi bar returns as inputs – which we have also studied before here – and the outcomes from long and short trades taken with a given trailing stop mechanism as outputs. Therefore the neural network produces a forecast that attempts to predict whether a short or long trade taken at the current bar open would be successful and by what amount. If the return of the long/short trade is predicted to be positive and the short/long is predicted to be negative then we enter positions we do not enter if both are predicted to be positive or if both are predicted to be negative.


To initially test this I performed a parameter space quality assessment using the unshifted, 4H and 10H shifted USD/JPY daily timeframes (which I will call 0S, 4S and 10S). Since the simulations on the 1D are quite fast and we do not need to filter by trading hour I was able to perform this analysis at a more significant level of depth when compared with the 1H systems. In the end I was quite surprised with the increase of acceptable strategies (correlation coefficient higher than 0.9) that I was able to find on the shifted timeframes compared to the unshifted. On the unshifted barely 1% of the space led to usable systems while on the 4H and 10H shifted daily timeframes I measured these to be 6.4% and 8.7% respectively. Performing finer grain searches to find better performers I also found much better Sharpe and CAGR values on the shifted timeframes compared to the 1H.

Overall the 10S was much better at generating larger number of systems while the 4S was better at generating higher quality trading strategies. The systems found on the 4S in general had lower maximum drawdown period lengths and higher Sharpe ratios but they were significantly scarcer when compared to the 10S. Most notably there was a significantly low correlation between the systems found on the 4S and the systems on the 10S, despite the fact that they are both coming from the same symbol (USD/JPY). These results clearly show how it is possible to generate uncorrelated strategies for the same symbol by simply changing the shift of the timeframe that you’re working on. The construction of shifted timeframes really opens up a door to a lot of additional diversification.


This exercise is a strong enough proof of concept that you can indeed generate a much larger number of candidate systems on shifted 1D timeframes than on the traditional 1D timeframe, especially when results on the normal 1D are really poor. It shows how 1D shifted mining spaces are viable candidates for system mining as well. Of course this says nothing about other important issues such as mining bias, we will have to use these shifted timeframes within our machine learning cloud mining effort to see whether there is any decrease or increase in data-mining bias when using this type of timeframes.

After this exercise to show that the results are indeed interesting the next step is to take this to live trading. For this we first need to take this to our cloud mining effort and then modify our software to allow us to live trade using shifted timeframes. We will be implementing this functionality into our Asirikuy programs, mainly the Asirikuy Trader which is the program we use for live trading.If you would like to learn more about machine learning and how you too can program your own machine learning strategies using our programming framework  please consider joining, a website filled with educational videos, trading systems, development and a sound, honest and transparent approach towards automated trading.

Print Friendly, PDF & Email
You can leave a response, or trackback from your own site.

One Response to “Machine Learning in Forex Trading: First results from shifted timeframes”

  1. fxwinner says:

    Good effort!
    I think we should go away from traditional time frame concept and review it, along with shifting. using traditional systems doesn’t allow easily (you can modify data and import it into any trading systems, but it is extra effort ) to use shifting, this means it is not being used! so we have higher chance of success in finding some market inefficiency. Also we can avoid pollution and noise associated with lots of automation on the market with standard time frames (or its presentation in any given movement). Please consider using non-standard time frames as per my previous comments (week worth of data divided on equal intervals )

Leave a Reply

internal_server_error <![CDATA[WordPress &rsaquo; Error]]> 500