Sep 30, 2008

Forward tesing - update

Today the expert advisor won one trade in forward testing.
Now it should have open a new trade, but the connection is lost to the server. I checked Alpari's server, and it's fine.  Since I intend to trade the strategy on a real account, I should do it with another broker, and make the fine tuning of the setup before. I experienced troubles with different Metatrader brokers in the past, and that's the reason that I will probably work with a non-Metatrader broker company. I tried "MBTrading", and they were fine so far.
What's left before engaging the real account? First, I should insert the state logic into the expert advisor. It means that if the Metatrader shuts down, the expert advisor will be able to recover. Second, I have to continue the forward testing at least for the next week and a half.
In the operational form, the Metatrader will be the signal supplier to manual trading, or for the application that I will have to develop as well, which will be based on the broker's API.

Second bug fix - version 4

On forward testing a bug related to long positions found. I fixed it and checked the performance - it got a little bit better. The new version will be MYP4.

Sep 29, 2008

First win

After the bug fix yesterday, the expert advisor traded on a demo acoount two winning trades today. I will continue the forward testing, and compare it to the back test of this week, at the weekend in order to verify that it behaves the same.

Sep 28, 2008

First bug fix

Well, I found the annoying bug from Friday night. It was a simple rounding problem. If the takeprofit or stoploss are not rounded, the Metatrader returns an error, which wasn't in back test.
I verified also that the performance didn't change. It shouldn't but we must know it for sure. Since there was a softwrae change, it will be named "MYP3".
The forward testing continues with thta version.

Sep 27, 2008

Second version - MYP2

The second round enhancement from the last post was added to the expert advisor. This version will be "MYP2" (The first version is MYP1).  The results are better! The best result in my opinion is profit factor of 1.91, 155 trades, and draw down of 15% with risk of 2% for the first trade, and 3% for the second round. The profit was 11290$.
The number of trades raised in 50%, the profit factor improved.
Let's define risk2 as the second round risk.
Since I am interested in higher profit, I checked the setup with different risks, with the same risks ratio: 

RiskRisk2ProfitPFTradesDrawdown
23112901.9115515.10
46319301.8315530
57.5461421.815535.12

The back test short report is available here for the setup of risk=4%, risk2= 6%.
The actual risk of each setup is the sum of the two risks.
MYP2 yields higher profit factor, lower draw down, and much trades compared to MYP1. For example, let's have a look at the results of the setup risk=5%, risk1= 7.5%. It is equal to a risk of 12.5%. The same profit is achieved with the first version (MYP1) with risk of 11%.  The difference is that the drawdown is lower (35% vs. 43%), and the profit factor is higher (1.8 vs. 1.45). 
The conclusion is that MYP2 is better, and it is going to be my main effort right now.

Sep 26, 2008

Forward test first problem

I started the expert advisor in real time yesterday, and it missed a trade which exists in back test of that day. Right now I don't know why it happened. Full logging mechanism was embedded, and I am going to understand the problem on Monday morning since the conditions for trade are still relevant. 
I am going to continue developing the strategy in paralel. In order ro enlarge the amount of trades, and the profit of course, I am going to add trades to a successful move. Since the winning trads statistics is excellent (around 82%) it might be a good idea.

Sep 25, 2008

Forward test

The expert advisor is being tested, with 5% risk. 
My goal is to verify two things:
1. The statistics of the farward testing is similiar to the back test's.
2. The expert advisor works fine in real-time.

Of course it's a demo account. 
There is another optimization process running in the background, whick should find the best setup for 12% risk. I do that since I intend to trade in the future with that level of risk.

Money management

One more thing before launching the expert advisor in real-time mode, is determining the risk. The risk defined as the maximal portion (in percents) of the account that will be in japery every trade. Actually, the stop loss is derived from it. Here we can see the back test parametesr vs. the risk. 

I noticed that the performance changed a little bit, and it might be due to the model type, which is based on tick modeling with a random ingredient.

Since I am interested in a high risk, I might perform one more optimization for higher risk (the profit factor changes as the risk changed). 

Sep 24, 2008

Checking the statistics

Until now the results seem pretty good. The next thing we have to do is to check if the statistics is reliable or not. One way to do it is to perform a back test on a same period of time. Since the optimization time was 19/9/2007-19/9/2008, I decided to check how my strategy handled the period 19/9/2006-18/9/2007.
The results are available here.
It did half the trades (50 instead of 108), with a higher profit factor (2.02 instead of 1.64). Since there were less trades, I expect a higher profit factor. The drawdown is the same (around 16%), the portion of profitable trades is the same(72%) , and the average winning trades vs. losing trades is a little bit better (4:1 instead of 3:1), which is expected since there were less trades.
In conclusion it seems that the statistics remains through out that period, and it is a good indicator that it will carry on in the same way in the future.

Last optimization

I ran one more optimization in order to verify that there are no better setups for my expert advisor. The results were almost the same, and it indicates that we are through with the optimizations at this stage.
The chosen setup's report summary may be viewed here. First, the trades are scattered along the time axis uniformly. This is a good sign that shows us that the strategy is not depended on rare occasions. Second, the report's parameters are positive: average of 3 winning trades against 1 average loss,  71.3% winning trades, and the amount of short and long positions are in the same scale.

Sep 23, 2008

Second optimization

After the first optimization, I had to make a finer optimization. In order to make an efficient optimization, the first one covered a big range of options, with a big step between them, and the finer optimizations should sharpen the results around the most promising results of the last optimization.

The starting point of the second optimization was the one that was noted in the last post.

The risk stays the same, as well as the testing period.

Right now the best result is 17149$ profit, PF 1.64, 108 trades and DD of 16.58%.

Less trades, but the results are better in all other means.

It seems that I will have to continue the optimization process, since a few variables reached their limit in the best result.

The optimization report is available here.


Sep 20, 2008

First results

The first optimization with 90% accuracy yielded pretty good results. I have to make a few finer optimizations in order to focus.
The currency is GBPJPY, H1.
Initial account - 10,000$.
I tested it on the last 12 months, with 5% risk per trade.
The best results are 11,240 $ profit, PF (profit factor) 1.5, DD (drawdown) 22.3%, and 114 trades.
Right now I have to continue the optimization with a finer search, in order to find a set with bigger PF, and smaller DD.
I am pleased with the amount of trades.
I also backtested the winning results to verify that the trades are uniformly scatterd on the time axis - and it was fine.
Bac tets results will be in one of the next posts.

Sep 19, 2008

First optimization

Last week I've started developing my expert advisor. Since I am experienced with that issue, I decided to start with a simple idea I had in mind.

A few principles led me in the way:

1. The strategy may open only one long trade and one short trade at the same time.

2. Money management – the ability to define the account’s portion that may be in risk in one trade.

 

After a few on going modifications I had positive results in back test. But, I have mismatch errors in my data, and it’s not 90% accurate. I downloaded data from “Metatrader” data center, and I have to start over.

A new optimization process with the new data…

The goal

What is an expert advisor?

An expert advisor is an automated trading strategy, executed by a trading platform called “Metatrader”.

This platform enables the developer to back test the coded strategy, in order to evaluate its performance.

 

How do I determine whether an expert advisor is worthy?

First of all, we need an accurate tick database, which will be used through the stage of back testing.

A good expert advisor should yield a lot of trades, be profitable in a long time period. The trades themselves should be uniformly scattered on the time axis. Why? These terms guarantee a good and reliable statistics through time.

 

My goal is to develop an expert advisor which will yield in a year profit factor of 1.5 or higher, an average of 1 trade per trading day, with a drawdown of 15% or lower.

After that stage, forward testing will be needed before live trading.