Mixed results

Using linux machine to make trades, 2 trades were done until now for the gbpusd-eurusd pairs, results are mixed. one trade failed when differential reverted back to the mean while the other one (a lot shorter in time) dropped profits.

tarde 1 losser entry:

trade 1 exit at mean 4 days later the entry was made and the result is - 54 USD but i was -100 usd down at some moments of the trade!

Now, in a more shorter in time trade made later:

and it exit just a few hours later at the mean:

the second trade made 31 USD

statement

Tags: , , , , ,

First Statistical Arbitrage Trade using mql

Now that i have the basics (much more than i posted in the blog) i can start to test this on more real life examples. so using my mql skills i made an expert advisor to calculate mean and standard deviations and send me trade signals. For testing purposes i will make the first trade manually, then i will let the expert make all the work.

First signal, differential is at -2 std deviations so we get in expecting to earn profits at mean reversing. It is friday, we will have to probably leave the trade open during the weekend.As we are at -2 and GBP goes first in our calculations, it is our base symbol, so we buy GBP.

Market traded all day between -2 and -3 std deviations:

The day pass and the session ends for the week.

On monday the mean reversed happened early, check the numbers on the left top panel, the differential is now trading between the mean and positive 1 standard deviation.

As expected the mean reversion dropped a profit, the amount wasn’t calculated yet, i don’t even think it will be possible to estimate it as this is a very dynamic situation, the only advantage i have is that at 2 std deviation there is a big chance that the prices will start to head to the mean again.

Meta trader trade statement

Tags: , , , , , , ,

Robot Optimization

Optimization of expert advisors will help me find the right parameters for different variables of the program in a period of time. It is better to use the 20 ema crossing the 200 ema or the 30 ema crossing the 193? all this kind of questions can be replied with the optimization process.

I will use control points instead of every tick so the process will be faster, we will use Expert Advisor 9 for optimization. I will run the optimizator with data of the current year, starting january 1 and ending july 31.

The 2 moving averages for the cross will be optimized, the take profits variable, the stop loss variable and the trailing stop will all be optimized as well. the mql build in optimizer will combine all this and display a report.

There is no need to use the same values for short and long trades, what it works good for long it don’t necessarily haves to work for short trades so i made 2 optimizations runs and here are the results:

Long Optimization Reports

Short Optimization Reports

It looks that the optimizer found great results for short trades, the draw down is of 20% and the expected payoff is high. This is what we look in an expert advisor, big payoffs and small drawdowns.

With this new optimized values:

StopLoss=250     TakeProfit=1850     Period_MA_1=9     Period_MA_2=171     Tral_Stop=750

i make a new expert advisor optimized for short sales, when i run it in the strategy tester using the most precise data now we get this curve from january 1st 2010 to today:

Details

Tags: , , , , , , ,

MACD Expert advisor tests

The MQL community page ( http://www.mql4.com/ ) is a great source of information and it provides me articles and source code. I can use the expert advisors made by other programmers and test them up, make modifications to them, use parts of their code, etc.

To start with this lets try a classic expert advisor that use the macd histogram and a signal line, this strategy was not something i use to trade on the days of manual trading but what i like from this expert is the way it is coded, a lot less code than what i was using to make expert advisors from the mql book.

Here is the article page: http://articles.mql4.com/84

The short and long entries are defined with the following:

The expert don’t have a stop loss, exit is executed when:

  • Long exit – by execution of the take profit limit, by execution of the trailing stop or when MACD crosses its Signal Line (MACD is above zero, goes downwards and is crossed by the Signal Line going upwards).
  • Short exit – by execution of the take profit limit, by execution of the trailing stop or when MACD crosses its Signal Line (MACD is below zero, goes upwards and is crossed by the Signal Line going downwards).

I have the historical test of 2010 for euro against dollar, 15 min chart in here: http://fforex.me/robots/macd/

As expected the expert didn’t had a great year but the lack of stop loss also have some very big losses, for example in january 2010 i can see a loss of -197.38 in a single trade. this goes totally against my tolerance, it is a very big loss for my trading style.

So i tried a new version that can also insert a stop loss of 30 into the trade, with this we will not have those big losses but we are also limiting the expert, remember that less risk can also mean less profit sometimes, this is what is happening in this case:

MACD expert with stop loss of 30

I like how it is coded as it is more compact than the expert sample of the book , i am not really expecting a profit from it, also i have to test all the experts i can found for free, it will help me understand more about the mql programming language.

Tags: , , , , ,

Emas cross 21 – 200 TP modification.

In prior versions of the emas cross robot we were using a 20 pips of stop loss and a 20 pips to take profits as well.

lets now make a new version changing the TP variable from 20 to 30, this way we risk 20 pips on each trade (same as we were doing before) but we increase our profit potential to 30.

as a disadvantage we have that in a certain trade the market can get the 20 pips but maybe can’t do it with the 30, so it will reverse and end with a loss. the only way to know it is testing the strategy.

here the results of the first 7 months of 2010:

Emas Cross 21 – 200 with a TP of 30 pips

As we can see this is the best operator we have until now working in a 24 hours environment in the euro dollar market.

Tags: , , , , , , ,

24 hours 21 – 200 emas cross july test

as expected with the robot trading in the american session only, the 24 hour version of the 200 ema crossing the 21 ema or vise versa end July with losses but smaller ones than the american robot.

EA 4 July 2010

Even with that small loss the best performance for now is still made by this robot:

EA4 Robot

Tags: ,

First Auto trade

The first robot i will be testing is the one i call “11 – 31 Moving Averages Difference”, it is a very basic expert advisor for mql but i will help me to start to see how all this work.

Please check the trades i am making with this robot and the variables used in here:  http://fforex.me/robots/11-31-moving-averages-difference/

Let’s see how it works with some images, here the robot makes an entry in the short side.
Please note that at this time that the difference between the 11 and the 31 moving averages is equal or more than 18 pips. This gives the robot criteria to open a short order.
The robot simple obey and open the trade:

Here you can see the market trading very close to the TP line of 20 pips but without hitting it:

The market bounce up, robot was very close to profits but now we are facing losses. The robot idea is no intervention so i am just spectating totally outside:

SL is finally hitted, the trade ends with -20.90 pips.

Even with a loss, i learned a lot from this trade and i liked this EA. It was so close to profits that i am sure this robot can win sometimes, i like the criteria the robot haves and it is a great start to make bigger things.

Remember to check how the robot is doing here:

http://fforex.me/robots/11-31-moving-averages-difference/

Tags: , , , , , ,