Thursday, July 30, 2009

EAs are not universal anymore

It used to be when you write a metatrader EA, it can be used across all brokers who has this platform, and the only thing to take care of is the server time as each broker has different GMT settings and that is provided the trading strategy is time dependent.

Today it is fragmented, in just a matter of months. The first is fractional pips, some brokers have switched to offer this, others remain. But this is easily solved. Next are those US brokers who are NFA registered. In this category, there are different implementations. One broker said everything remain the same, just make sure your lot sizes are not the same so that some backend system will handle the no stoploss, no takeprofit, no trailing stops that NFA has forbidden. Of course all NFA brokers cannot offer hedging now. Then on the other side where brokers are not US based, there are those who offer direct ECN connectivity. That means, you cannot send orders with TP and SL. These two parameters must be zero. But at the next tick, you can send in a modify order command.

Gone are the days where we can have more universal settings and code. So even with one platform, there are so many permutations of implementation that is getting tedious to write a universal EA.

Thursday, July 16, 2009

Book Review - Mechanical Trading Systems

I came across this book that is worth mentioning only because there are not many books covering automated trading systems. The book is "Mechanical Trading Systems" by Richard L. Weissman, John Wiley & Sons, 2005.


It is a book about mechanical trading system, that is, systems that can be automated or expert advisers (EAs), a term I have been using frequently. It is interesting because it explores the psychology of different trading systems that a trader needs to know in order to match the system to his own trading psychology, something I had talked about in here. But there is no holy grail, it appears the author has some successful automted trading systems which he openly said he will not reveal. His purpose is to share the usefulness of automated trading and how it can be applied as follows:


1. Trend-Following Systems: patience is the key and not getting out of a profitable trade too quickly. The psychological make-up to trade such systems are patience to wait for trade entries, long drawn trades (could be months), ability to give back a large portion of profits.


2. Mean-Reversion Systems: these systems are intermediate term trades and needs discipline; discipline to overcome crowd psychology, media hype and action price reading. There will be more losing trades than winning trades, but the losing trades are small in value but consecutively large.


3. Short-Term Systems: there could be many trades in a day and require quick thinking and fixed formulas for entry, exit and money management. These type of trading is intensive and require the trader to stay seated to the screen (but this is where automated trading comes in handy).


Most of the examples of trading systems are based on technical indicators. I can only infer these are probably not the systems to use since they have been revealed!


The author has also covered the usefulness of automated systems for backtesting, forward testing and optimisation of trade parameters. At risk is the convenience of optimisation and curve fitting of a set of data that does not represent future prices.

So this is a book worth reading so that you know yourself better and therefore have better grasp in handling/using EAs.

Friday, July 3, 2009

Only FIFO orders NFA - no placing of stop loss or takeprofit

So we had a break from the implementation of the FIFO rule by NFA, deferred till 31 Jul 2009. See this note from NFA. Why do we need more time to have this new rule implemented?

Well, it is not just a simple first-in-first-out handling of orders. It also means you cannot put stop loss to your orders!! Essentially, a stop loss is an opposing order and you are not allowed to issue this order in advance.

Imagine you place two orders in the same direction (because you can't place opposing orders anymore ie no hedging). The first order you have a Takeprofit of say 100 pips. The second order you have no takeprofit or stoploss. You trail the second order such that the second order will be taken out say with a trailing of 30pips. But it does not work like this anymore. The first order must be closed first before the second ie FIFO. So as a result, you cannot place takeprofit or stoploss levels now because the first order must always be processed first.

Ok, the brokers in US are coming out with solutions like OCO (One Cancel the Other) which means you can still place stoploss or takeprofit via OCO.

What does this means for EA users? More reprogramming required, more testing needed but little time left.

So what are the brokers with MT4 platform doing:

1. Broker1 - use different lot sizes so that the orders are treated differently
2. Broker2 - drop MT4 becasue it cannot be changed to handle new ruling; so use another platform or use UK broker
3. Broker3 - still not a member of NFA

PS: Remember, all this applies to US brokers only.