Saturday, December 24, 2011

Meta-Trader - Sunqu Review

Welcome back Meta-Traders.

Here's wishing you a joyous winter solstice and greetings of the season! Summer is now officially on the way!

In this review we tackle Sunqu, Asirikuy’s first expert advisor which makes use of neural network technology.

Before approaching a topic like this, it’s good to get some context. There are a lot of good introductory articles on Neural Networks. If you are not familiar with the topic, check out this article here.

To put it simply, Neural Networks are mathematical models that accept one or more numeric inputs, perform a mathematical function and produce a number as output. I have some familiarity with the topic since I did an independent study based on Neural Networks when I was working on my Master’s Degree in Computer Science back in the winter of 1988. The project turned out to be more like a solution looking for a problem in the sense that I didn’t focus on any particular problem domain. So it’s fortunate that all these years later I have an excellent problem domain in the forex markets!

First, Sunqu means door in Quechua, the language of the Inca people in Central America. Sunqu runs on EUR/USD against the daily charts and attempts a once-per-day prediction of the direction of the close based on the today’s open plus the prior X bars price action. Sunqu trains by looking a X bar price patterns over Y number of bars of recent price action.

Since the network weights are initialized to random values, it turns out that the network may produce different results on 2 subsequent runs - even if presented with the same input data! This would appear to violate the definition of a mathematical function that given the same inputs, should produce the same output no matter how times you run it, right?

Daniel tackles this problem by making a ‘committee’ of networks, that all are presented with the identical input data and produce their prediction. Then he polls each of the networks and considers the results to be valid only if some percentages of the network’s predictions agree on one direction or the other. As a result of that process you get one of 3 results:

  • All Bullish
  • All Bearish
  • No-agreement
Based on the daily evaluation, the trading strategy falls out as follows:

  • An "All Bullish" prediction: results in opening a long position - and first closing an open short if necessary
  • An "All Bearish" prediction results opening a short position - and first closing an open long if necessary
  • No-Agreement results in no position being taken, and existing longs and shorts are closed if necessary
Other key points of the strategy as follows:
  • Position size defaults to 1 risk unit using the standard Asirkuy position size calculation based on the 14 bar daily ATR
  • There is also an option to pyramid positions where you get agreeing signals for more than one day in a row
  • Stop losses default to 200% of the ATR value
Back testing Sunqu is time-consuming and CPU-intensive to say the least. Running a back test for 10-years on EUR/USD took the better part of 24-hours to complete. It would have taken much longer except I reduced the committee size to 5 and the agreement threshold to 80% - so 4 of the 5 networks would have to agree to produce a trading signal. Daniel coordinated a group-back test in which many Asirikuy members ran the back tests to compare results. As a result of that effort, Daniel came out with a recommended number of committes and agreement threshold. Clearly, you can be more liberal with the number of networks used for live or demo trading versus back testing.

Before we talk about performance, keep in mind that your results may vary. That’s always the case with back-test and live trading of course. But there’s an extra bit of uncertainty due to the semi-deterministic nature of the neural network and the results that it produces.

In a 10-year back-test, against EUR/USD, Sunqu showed an annual return of 5.62% with a maximum drawdown of 14.05%. That sets the Average Annual Return to Maximum Drawdown Ratio at about 0.4 which does not compare favorably to many Asirikuy systems and portfolios. To put it more simply, Sunqu risks about $1 for every 40 cents in realized profit.

But those numbers don’t really tell the whole story. Considered on a year-by-year basis, Sunqu showed a profit in 9 of the 10 years between 2000 and 2010 and the largest yearly loss was -3.63%. So to consider the overall performance, Sunqu does not produce a lot of profits, but drawdown is also relatively low. Also, the fact that its trading signals are completely unrelated to the other systems on Asirikuy, adds additional diversification to the trading results and should therefore be a good complement to other systems on Asirikuy.

One more thing – Sunqu has a cool user interface which can be enabled through an external variable or property for the expert advisor. When enabled, Sunqu pops up a window during network training which shows the actual performance over the past Y days, and the system’s predictions versus the target data during the training process. Each round of training can take between 10 and 30 seconds and based on the settings and the number of networks to be trained, the system can take up to 15-20 minutes to finish testing once it has started the process.

Another positive thing about Sunqu is that it trades often. Looking at the demo account, the system was in a trade more often than not for the testing period. That means more opportunities to be on the right side of a big more even if utterly unforeseen by other circumstances. Also, more trading means more pip rebates which his always a good thing.

Another plus is NFA compliance, since the system trades in only one direction at a time.

Sunqu was tested on the daily chart of several major pairs, and most pairs were not profitable with the exception of EUR/USD. Sunqu has been show to be profitable on USD/CHF as well as EUR/USD.

Sunqu is currently not enabled for live trading. Once it is, I will apply it to one of my spare forex.com accounts.

That’s all, have a great weekend folks.

4 comments:

  1. In accession to profits, forward-looking, are admiring to assertive adopted barter traders use forex apprentice adversity and complications, admission to ability of the market, because they can be a bit scary.

    Day trading software

    ReplyDelete
  2. Dear Tcxmon,
    I have been following your blog for a while, and I think you're doing a good job.

    However, as you already know, your atinalla-3-live/79369 account is not setup properly hence underperforms this type of strategy. Yesterday was a good example as all other similar accounts in Asirikuy closed a EURUSD sell with a 1% to 3% profit, whereas this trade is totally missing at your account.

    I think this is an excellent opportunity for you to run a backtest and see why this trade was not done. Then you will probably have to redownload the portfolio parameters, rerun the backtest - and maybe repeat this process until you finally figure out what is the problem that causes it to misbehave.

    Sorry for my criticism, but I think if you are serious about this portfolio (and I believe you are) then you just cannot ignore this from happening time after time and continue trading this portfolio as nothing had happened (-:

    Again, I am following your blog regularly and would like to see your success, and I hope you take my note seriously and fix this, so you can really start 2012 with a right step..

    Regards
    Al.

    ReplyDelete
  3. Hi Al-

    Thanks for the comment. Most of the time the only comments I get are people posting their own web links so its good to see someone is reading, particularly someone I haven't heard from before!

    Anyway, most of my Forex.com accounts have been off-line this week for conversion from 4-digits to 5-digits. This will result in tighter spreads and some price improvement, so it should be well worth the effort in the long run.

    Forex.com requires the accounts to be flat during the process. I submitted the request last Thursday and expected it to take a 2-3 days. When I still hadn't heard from them as of late yesterday, I contacted them again and they told me it was done. It would have been nice if they would have told me much earlier in the week.

    I did catch the short EUR/USD trades in my Atinalla #1 and Atinalla Custom accounts which run on FXDD. Also, I kept my Atipaq Full Portfolio (which runs on Forex.com) account on 4 digits since it hasn't been flat all week.

    Anyway, all 4 accounts are back on line now and are now running the Asirikuy F3-70d accounts using the new Asirikuy indicator libraries.

    I'm a little nervous since this change involves changing 2 key items at the same time, so i'm going to watch closely for the first week or so to make sure everything is running properly.

    Thanks again for the comment and check back tomorrow for my year-end summary.

    Chris

    ReplyDelete
  4. Well, I am completely amazed to see the magnificent review of Meta-Trader. It's completely looking one of awesome featured source for me. The exclusive contents of this source really enhances my amount of knowledge about it. Thanks for sharing.

    Day trading software

    ReplyDelete