Dec 1, 2008

Version 8

After watching my expert advisor in live mode, I had a few thoughts about modifying the take profit calculation, whick became the 8'th version. 
a report is available here.
An analysis of the results in terms of monthly profit factor and amount of trades is given:




Nov 28, 2008

Second week summary

This week the opened trade from last week was closed  in profit, and another trade was opened with low risk. The low risk mechanism is used to detect low risk situations, and then the expert advisors uses the low risk in the money management considerations. The low risk trade is still open.

Nov 21, 2008

First live week summary

Due to money transfers the expert advisor started only on Wedensday night. It started with two positive trades, which lasted about 36 hours. Afterwards another trade was opend.
The trading week is over.
Initial deposit: 21K$.
Status: Balance=23.3K$, equity= 24K$.

Nov 9, 2008

New version - 7

While I am getting ready to the live activation of my expert advisor I performed a few last (so I thought) optimizations, and a settings mistake led me to different settings with completely different results. The setting result was large targets. Since my expert advisor has special logic for closing the trade it compensates in cases of targets that are too far.
Since the change is far targets, I understood that trailing stop loss is  essential. That's how version 7 was born.
The new results are available here. Those results are remarkable, and I wish it will stay like that. 
Since I need more time to fine tune the settings, next week I will start live trading.

Nov 4, 2008

Last descisions before moving to live trading

I decided that I am going to run my expert advisor in live mode to trade automatically, without MBTrading. Why? I found a bug related to MBTraing API and it looks suspicious. If I, a simple API user, found a bug, it might be a sign for the future to come. I have a problem with Metatrader brokers (for example read it), but since my expert advisor has long targets it will be very difficult to bypass the market rates in order to make me lose. 
Also I chose an American broker since there are a few new limitations that protect the customers. I added a Skype dll to my expert advisor that will SMS me each time a trade was made or closed. I added global variables support in order to recover from shutdowns. 
That's it. I opened an account at the chosen broker, and I am going to start trading one week from now.

Oct 31, 2008

Launching in ten days...

It appears that there is a bug with MBTrading demo accounts, which was related to my problem. They SDK support guy told me how to bypass it and it works. The robot is working. I added a Skype plug-in to my robot, in order to send me SMS every time an order is closed, or being opened.
I decided to use Alpari at the moment as my signal supplier, and an optimization is being run in order to find the best set.
Next week will be used to final tests and checks, and afterwards the robot will be launched for the first time.

Oct 29, 2008

Metatrader platform difficulties

In the last 3 days I was busy debugging the MBTrading robot application. I had a problem related to closing the trades, and I am still in touch with their support team. Except that, the robot is ready.
I noticed a problem related to back test with Metatrader platforms - The Metatrader platform from Metaquotes is very fast, and very comfort to back test, unlike the Alpari platform. I compared them and Alpari is much slower. The second problem is that Alpari has different performance with the same data.
I need a signal supplier which is reliable, and it's platform will be able to conduct my optimizations rapidly. I am examining different brokers in order to find a good signal supplier for my robot.

Oct 22, 2008

Version 6

This week started with two successful trades, and no more. While observing the expert advisor's performance, an idea for a filter came to me, and I decided to check it out. It seems that the new version (from now on it will be version 6) makes the same net profit, with half the trades, and with half the drawdown as well. The back test's results are available here.
The robot that trades with MBTrading is robust to logic changes, and will continue working with any version that I will choose. So, it seems that we will continue with version 6.

Oct 17, 2008

Week's summary

The robot software (which trades via MBTrading) worked well today, made 2 trades according to the expert advisor's orders. The software is stable and simple.
I had a problem this week that the forward testing of version 5 did not match exactly the back test's. I suspected that since I ran two different versions in parallel it might be the reason. So since yesterday only version 5 is being tested on that platform, and the results match at the moment - there were 3 trades since then.
What's next? I have to make a small addition to the expert advisor that will store global variables in case of Metatrdare platform shutdown. I will continue the robot's testing, and if it will be fine, maybe I'll start live trading two weeks from now.

Oct 16, 2008

Progress report

The robot started working, and it's stable. I had a few trades executed, but it needed a manual confirmation. I fixed it. I will have to check carefully the orders execution, and compare it to my expert advisor, since MBTrading works differently. In order to make a buy order, you have to place a position, and against it an open order with the limits. It's more complicated, and therefore it requires extra care.
I noticed that with the Alpari platofm, the forward testing did not match exactly the back test's results of this week. I suspect that since I ran versions 4 and 5 together on the same platform might be the cause. I left only version 5 for the forward testing.

Oct 13, 2008

Robot in demo mode

Well, the settings of the new version is set for forward test in this week. I still need to check the risks again, since it was changed due to logic changes. The back test of the new version is available here. The results are much better: the P.F changed to 2.31, 77% profit trades, with a little bit smaller drawdown.
I finished fixing the robot application. This application embeds the MBTrading API, and receives orders from the Metatrader expert advisor. I used a DLL I wrote in the past for communication between the two different applications.
Right now two versions are in forward testing: MYP4 and the last one - MYP5.
The robot is triggered from MYP5.

Oct 11, 2008

New version - MYP5

After watching my expert advisor in live, I tried a few ideas to minimize the loss trades. I checked a mechanism of rescue, when the trade is profitable, to set the stop loss to a profitable level. This idea did not achieve better results. Afterwards I tried a few conventional filters, which did not do any better. 
At last,  I had an idea for a filter, with three levels:
1. High risk trades
2. Low risk trades
3. No trading at all
I tried it, and it had better results.
The results are for the period 19/9/07-18/9/08 GBPJPY H1:

ProfitP.FDrawdown (%)Trades
196971.9626.95128
230612.2126.67109
236602.8326.1787

The risk is as it was the same (4% for the first and 6% for the second) with a small modification: the filter determines the risk of the first trade: 4% is considered as the high risk and 2% for the low risk.
What's next? I am going to continue with the third result and make a small risk optimization around that setting since the drawdown settings is changed.

Oct 10, 2008

Daily progress report

I have opened two MBTrading accounts, and linked them together. By the way, they have a great support. I have the skeleton of my robot from a project I made in the past. This skeleton receives commands from the Metatrader, and executes them with MBTrading.
A few enhancements should be made: two accounts instead of one, and to integrate the MBTrading communication module into the expert advisor.
The forward testing continues, and it seems fine. It's almost ten days bug-free, and the back-test matches the forward testing.
I am trying to improve the expert advisor by adding a rescue mechanism for profitable trades that end up at the stop loss. It is in the middle of optimizing, but it seems worse.

Oct 8, 2008

Forward testing - updtae

The expert advisor keeps working, and its results match completely the back test. I am starting preparing to live trading.
What does it mean? Since I do not know a reliable Metatrader broker, which is very important, I am going to work with MBTrading.  This company is actually a gateway, and has no interest in your transactions. 
So, MBTrading offers an API to trade, and I am going to develop a small application that will receive trade signals from the Metatrader, and execute them with MBTrading.
There are a few disadvantages with that method:
1. MBTrading does not allow opposite trades (longs and shorts at the same time), but I may open a sub account for this purpose.
2. The small application requires QA.

Oct 6, 2008

Second week forward testing

The week started with 6 winning trades :)
The most important thing is that it matches the back test of today(until now), and no bugs found.

Oct 3, 2008

First forward test week

This week there were two bugs, which were solved. Due to the forward testing they were discovered. I can't compare the results to the week's back test because of the bugs. Consider the fact that the original platform has a few disconnections per day which affect the results, and forced me to change the broker, I will have to wait to the next weekend to compare the results to the back test hopefully with no bugs, and ready to start live.

Oct 1, 2008

Day's summary

Today the expert advisor traded according to the logic, and won one trade. Since I am going migrate to other broker (Alpari instead of OLD), I check the performance with the Alpari's data and it seems fine. No bug found today, and it is a good sign. 

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.