When I first started coding trading robots, I focused mainly on trend following designs, because that's what I had learned about Forex. Follow the trend.
These robots were pretty miserable performers, because defining a trend in code was never something I managed to work out properly. Indicators such as moving averages, RSI and ADX helped, but they can never reveal as much information as a quick glance at a chart.
Eventually I decided to use fractals to try and buy pull-backs in trends, and met with some success, but only during trends - which of course I had trouble defining in code.
My robot designs then shifted from trend following to hedging - first hedging only when trend following failed, and then just desperately trying to capture any pips they could and hedge when they failed. Again, some success, until the market went crazy and then it was heavy draw-down and margin call time.
There was a brief flirtation with envelopes and standard deviations from channels, but still the price would seemingly jump around these levels and getting an entry was difficult.
It was then I came across break-outs, and from looking at the charts, indeed, prices more often start moving rapidly ("break-out") than orderly cross moving averages and channels. Even with my hedging robots, the problem was while I could maintain a profit for a while when prices were consolidating, eventually the price would make an enormous leap which the hedging robot would miss and would suddenly be heavily into draw-down.
Looking back, I can see how little I really knew about Forex, but I'm glad I have had these experiences, even if it took some time to learn their lessons, because having been through them, I'm not likely to forget them.
I keep a few trend-following robots on demo accounts just to see how they do, and sure enough, so far, they tend to fail most of the time, but occasionally go through periods of big wins (they catch a big trend). Just like all of my early robots.
So, break-outs it is. Generally I've been having more luck with these than any other system I've tried to date. I am running into a few problems, however, namely "false break-outs". I'm still trying to determine the best time-frame, and take-profit and stop-loss levels. Also, break-outs don't occur all the time, so a lot more patience is required, which means testing takes a lot longer.
I have a feeling that I'll never enjoy great success with break-out robots, but having gone through three types of robot designs now (trend following, hedging, and break-outs), I am now more aware of various movements in the Forex market, which will hopefully make my manual trading a little better.
Feb 29, 2012
Feb 28, 2012
dan MTF scoring EA
The "multi time-frame scoring robot" from 13-05-2010 checks the values of many different indicators, and assigns a score depending if they are bullish or bearish. Once the score reaches a certain value, the robot opens a trade, and closes it again once it drops too low.
The idea behind this robot was that with enough information about the market given by many agreeing indicators, we should be able to get some winning trades.
It was programmed partly out of curiosity and partly from desperation since no other robot designs were working.
It loops through several time-frames looking up various values and uses arrays to store the indicator values for some reason ... maybe just because I wanted to use arrays for fun.
I attempted to back-test this robot, but it was extremely slow, and I stopped it after a while.
From memory, this robot actually performed half decently, until at one point I increased the lot size, thinking I really only needed a few accurate trades with high leverage to generate a good profit.
Then it suffered one huge loss, and I stopped testing it.
Update!
I realized I had put the delay which I usually include in my robots in the wrong place.
This link has the corrected code with the working delay. The robot now back-tests faster, but doesn't seem to open any trades. It could be the multi time-frame code doesn't play well in MetaTraders back-tests.
The idea behind this robot was that with enough information about the market given by many agreeing indicators, we should be able to get some winning trades.
It was programmed partly out of curiosity and partly from desperation since no other robot designs were working.
It loops through several time-frames looking up various values and uses arrays to store the indicator values for some reason ... maybe just because I wanted to use arrays for fun.
I attempted to back-test this robot, but it was extremely slow, and I stopped it after a while.
From memory, this robot actually performed half decently, until at one point I increased the lot size, thinking I really only needed a few accurate trades with high leverage to generate a good profit.
Then it suffered one huge loss, and I stopped testing it.
Update!
I realized I had put the delay which I usually include in my robots in the wrong place.
This link has the corrected code with the working delay. The robot now back-tests faster, but doesn't seem to open any trades. It could be the multi time-frame code doesn't play well in MetaTraders back-tests.
EURUSD
Last night saw the EURUSD break out of a small consolidation pattern and move lower. On my demo break-out strategy trading account, trades were placed earlier in the day, the SELL-STOP was activated and made $33.40.
The consolidation pattern is marked in blue on the EURUSD 4 hour chart above. It's not very clear on this chart, so disregard.
What I do see on this 4 hour chart is another doji has just formed. One formed just before Friday closing last week, and the EURUSD dropped.
The daily chart (not shown) shows the EURUSD still a little outside the top Bollinger Band, and also inside candles have formed on EURUSD and several other currency pairs (not shown).
From these two pieces of technical information, I'd be expecting EURUSD to drop a little further tonight. Which of course means it will go up!
DailyFX is forecasting EURUSD in an uptrend for the moment, and we do still have room to reach the Fibonacci level 1.36270.
There are no nice consolidation patterns available for placement of break-out trades, but I do still have a BUY-STOP at 1.34905 active from the consolidation yesterday. EURUSD would have to go past this level to move higher anyway.
I feel like placing a SELL-STOP at 1.33525, which is a little under the current weekly low. However, I have no system to justify this order, and it doesn't fit with my break-out strategy, so I'll wait.
Feb 27, 2012
Dollar Box Demo Test
The other day, I wrote about this robot, called Dollar Bot.
It was designed to make quick trades and close when they reached just $1 of profit. It's back-tests weren't very good - it would make a little profit, then the market would make wide ranges, and well, it was bad.
I made a few small modifications to Dollar Bot (modified code not available) and put it on a demo account with two currency pairs, EURUSD and GBPUSD. Last week, it's up over $100 (although current draw-down is over $45).
It would be nice if back-tests were more reliable. Still, I expect that this test will eventually fail in a similar fashion shown by the back-testing.
It was designed to make quick trades and close when they reached just $1 of profit. It's back-tests weren't very good - it would make a little profit, then the market would make wide ranges, and well, it was bad.
I made a few small modifications to Dollar Bot (modified code not available) and put it on a demo account with two currency pairs, EURUSD and GBPUSD. Last week, it's up over $100 (although current draw-down is over $45).
It would be nice if back-tests were more reliable. Still, I expect that this test will eventually fail in a similar fashion shown by the back-testing.
Robot Results for 20-25 Feburary
Last week I published the results of some robots that I'm demo testing, so I thought it would be fun to keep posting the results from these same robots for a while.
There are three - Inside Bar, Pending Reversal Candle, and 4 hour box break-out.
Pending Reversal Candle
There are three - Inside Bar, Pending Reversal Candle, and 4 hour box break-out.
First, Inside Bar, which last week lost some $290.
For this last week, I changed it's time-frame to H4, up from H1. It places less trades, but I was hoping it would be more accurate. It had three pending orders which became market orders - a loss for $89, a break-even, and a win for $261. Not enough to cover last weeks losses, but up on the week over-all.
Pending Reversal Candle
Last week had one winning trade for $292 and one break-even. This last week it placed no trades.
I modified the code slightly and added indicator arrows showing where the pending reversal candles are. It's easy enough to trade this system manually. I'm not completely sure the code is doing what it's supposed to do, so I'll keep an eye on it this week.
Lastly, the 4 hour box break-out system, which is actually an EA from Forex Factory.
This is the system which I am trading manually, although the EA also places trades and actually interfered with my trades. Last week due to some psychological trading issues (i.e., being scared), it left us with only a $90 profit.
This last week, with the EURUSD fluffing around, I was similarly scared, but since it's just a demo account, I decided just to leave it.
I placed my manual trades (with a lot size of 1). The price kept dipping back into the box, and the EA closed them for a loss! Grrrrr.
I reset my trades, and at the end of the week when the EURUSD finally did something, we ended up with $527 profit. This was up over $900 at once stage, but the EURUSD retraced a little and the EA set a trailing stop-loss itself. Still, not terrible.
It's worth noting that once my second BUY-STOP was activated, I disabled the EA for a day or so, and at one point it was at -$300. Once it got to break-even, I flirted with the idea of closing the trade, but decided to leave it in the hands of the EA and reactivated it.
Also note I added another currency pair, GBPJPY. The EA traded that exclusively, ending up with a small profit this morning.
I like this trading method. The wide range of the break-out box should help prevent many whip-saws, and time spend watching the charts is minimal. The bad thing is that if your trades go bad early in the week, you usually should wait until the next week to try again.
So, not terrible results from these three systems.
Note that these three EA's are trading with way too much leverage. When they start to fail, which they almost surely will, the excessive leverage will ensure they fail spectacularly!
EURUSD
Finally some action from the EURUSD. Thursday of last week saw the EURUSD move higher, breaking through the 100 period simple moving average on the daily chart, breaking through recent consolidation action, and then it moved even higher on Friday.
See how price action consolidated right through the cloud? The breakout occurred just as price action exited the cloud.
I haven't been using Ichimoku Konko Hyo for my analysis, but it's interesting to look at.
If I were to try and forecast EURUSD price action, I'd look at some other currency pairs as well, such as GBPUSD, AUDUSD, and USDCAD. Some of these don't look too lively right now (not shown) which makes me doubt continued EURUSD momentum. However, since I doubt it, it will be going up.
Look here, a doji!
We'll place trades and see how it works out tonight.
The advantage of this break-out system is that we don't have to try to forecast (or guess) where the EURUSD might be heading. We simply wait for consolidation and straddle it with BUY and SELL pending orders.
The disadvantage of this system is that we can get whip-sawed and stopped out of both of our positions. I'm hoping that this tends to happen only during broader periods of consolidation (i.e., when consolidation starts to appear on daily charts), but we'll find out.
Personally, I thought it might drop. Generally, Forex always does the complete opposite of what I expect.
Looking at the daily EURUSD chart above, I've drawn a Fibonacci retracement line from the big move down from October last year to January of this year. If this current move up is a retracement from that move, we'd be expecting it to hit the 61.8 retracement line at about 1.36270.
Here is the daily EURUSD chart with Ichimoku Kinko Hyo plotted on it:
See how price action consolidated right through the cloud? The breakout occurred just as price action exited the cloud.
I haven't been using Ichimoku Konko Hyo for my analysis, but it's interesting to look at.
If I were to try and forecast EURUSD price action, I'd look at some other currency pairs as well, such as GBPUSD, AUDUSD, and USDCAD. Some of these don't look too lively right now (not shown) which makes me doubt continued EURUSD momentum. However, since I doubt it, it will be going up.
Look here, a doji!
This doji, highlighted in yellow on this 4 hour EURUSD chart, can mean a reversal signal. At least in the short term.
From the first chart of this post, we can also see price action has also broken through the upper Bollinger Band. Rarely does price continue past these bands on the daily chart.
I could continue posting supporting and contrary technical evidence about EURUSD price action all day until we all just want to get drunk and pass out.
Lately I've been demo trading a break-out strategy, that looks for consolidations and places pending orders above and below. With the EURUSD doing strange things lately, this strategy hasn't been working out so well. With some movement back again, however, we can try again.
Here's a nice consolidation pattern high-lighted in yellow on the 15 minute EURUSD chart:
We'll place trades and see how it works out tonight.
The advantage of this break-out system is that we don't have to try to forecast (or guess) where the EURUSD might be heading. We simply wait for consolidation and straddle it with BUY and SELL pending orders.
The disadvantage of this system is that we can get whip-sawed and stopped out of both of our positions. I'm hoping that this tends to happen only during broader periods of consolidation (i.e., when consolidation starts to appear on daily charts), but we'll find out.
Feb 22, 2012
danw2 - dollar bot EA
"Dollar Bot" from 17-06-2011 is a simple robot that tries make $1.
How hard could that be, right?
As it turns out, in Forex, it's pretty damn hard to make (and keep) even a dollar.
This robot hedges aggressively upon failing to make it's dollar. The idea was that as the price eventually decided where it wanted to go, "Dollar Bot" would open orders in that direction until it had enough to counter any trades in the "wrong" direction, and then close everything and break-even.
It kind of worked, for a little while, until the market moved aggressively one way or another, leaving orders in the "wrong" direction massively in the negative, dragging down account equity until margin call time.
I added an equity check filter to stop the robot trading if it got too low, but basically all that did was delay the inevitable.
The graph shows very small gains, and two periods of large losses. A 75% loss over-all, despite winning 74% of it's trades, averaging 6 wins to 2 losses.
It was exciting thinking at the time, but every hedging robot I've ever designed has ended this way.
This robot is also fun to run on the 1 minute chart. Unfortunately during back-testing it gets hung up at some stage and never completes the test. But try it on a demo account.
How hard could that be, right?
As it turns out, in Forex, it's pretty damn hard to make (and keep) even a dollar.
This robot hedges aggressively upon failing to make it's dollar. The idea was that as the price eventually decided where it wanted to go, "Dollar Bot" would open orders in that direction until it had enough to counter any trades in the "wrong" direction, and then close everything and break-even.
It kind of worked, for a little while, until the market moved aggressively one way or another, leaving orders in the "wrong" direction massively in the negative, dragging down account equity until margin call time.
I added an equity check filter to stop the robot trading if it got too low, but basically all that did was delay the inevitable.
The graph shows very small gains, and two periods of large losses. A 75% loss over-all, despite winning 74% of it's trades, averaging 6 wins to 2 losses.
Back-test from 1-1-2011 to 1-1-2012, 15 minute EURUSD chart.
It was exciting thinking at the time, but every hedging robot I've ever designed has ended this way.
This robot is also fun to run on the 1 minute chart. Unfortunately during back-testing it gets hung up at some stage and never completes the test. But try it on a demo account.
danw0 - 24 sma close + close-weighted EA
This robot from 18-03-2011 had me excited for a little while, until I eventually figured out what was happening.
It opens trades if a 24 period moving average based upon the period closing prices compared with the weighted-closing prices cross each other. It also gets a stochastic value and doesn't open if oversold/over-brought, and the signal line has to agree with the direction of the trade.
It was among the first robots to use my updated "danw0" code-base, which allowed limited hedging, and also introduces proper trade triggers (in this case, the moving average cross).
The inspiration for the code update came from that fact that I had just moved to Australia a few months previously and opened an account with an Australian broker, who allow hedging. The US had just recently banned it for accounts with US based Forex brokers.
It had good results from a very limited back-test I ran (I went through stages of back-testing or not back-testing robots, depending upon what I had been reading about them at the time). It also performed well on a demo account .... for a while.
Until it failed I really thought I had stumbled upon some magical combination of moving averages that no one had ever thought of before.
Look at these results from a back-test on GBPUSD (1-1-2011 to 1-1-2012)
It actually performed better on GBPUSD than EURUSD, one of the few robots to do so. It was even turning a small profit until near the end of the test.
Look at the performance results - 94.44% win rate! Averages 26 consecutive wins! Amazing! Behold the predictive power of weighted-moving averages!
But wait. The average profit is only $7.87, compared with an average loss of $246.
I don't think the moving averages really do much at all. When reviewing the back-test chart (not shown), it appears to just open an order at random, move in the wrong direction almost immediately, eventually retrace, and then the EA will close it for a small profit.
But I learned that it's also possible to get this high win rate by quickly closing orders as soon as they're in profit, and just let the losses run until they (hopefully) hit your stop-loss.
Look also at the equity graph. See the green line beneath the blue line? This is the actual equity of the test account, while the blue line shows profit. The green lines dips quite far at times. This is the hedging taking effect. On this graph, it shows the green line eventually coming back to the blue, which is when all orders are closed and profits or losses settled.
Soon after designing this robot, I took the idea of hedging even further with another series of robots, where the blue profit line never moves, but the green equity line dips to zero, eventually causing a margin call on the account!
Even though this robot proved to be a loser (like all of my robots to date), I learned a lot from it, and I remember it fondly.
It opens trades if a 24 period moving average based upon the period closing prices compared with the weighted-closing prices cross each other. It also gets a stochastic value and doesn't open if oversold/over-brought, and the signal line has to agree with the direction of the trade.
It was among the first robots to use my updated "danw0" code-base, which allowed limited hedging, and also introduces proper trade triggers (in this case, the moving average cross).
The inspiration for the code update came from that fact that I had just moved to Australia a few months previously and opened an account with an Australian broker, who allow hedging. The US had just recently banned it for accounts with US based Forex brokers.
It had good results from a very limited back-test I ran (I went through stages of back-testing or not back-testing robots, depending upon what I had been reading about them at the time). It also performed well on a demo account .... for a while.
Until it failed I really thought I had stumbled upon some magical combination of moving averages that no one had ever thought of before.
Look at these results from a back-test on GBPUSD (1-1-2011 to 1-1-2012)
It actually performed better on GBPUSD than EURUSD, one of the few robots to do so. It was even turning a small profit until near the end of the test.
Look at the performance results - 94.44% win rate! Averages 26 consecutive wins! Amazing! Behold the predictive power of weighted-moving averages!
But wait. The average profit is only $7.87, compared with an average loss of $246.
I don't think the moving averages really do much at all. When reviewing the back-test chart (not shown), it appears to just open an order at random, move in the wrong direction almost immediately, eventually retrace, and then the EA will close it for a small profit.
But I learned that it's also possible to get this high win rate by quickly closing orders as soon as they're in profit, and just let the losses run until they (hopefully) hit your stop-loss.
Look also at the equity graph. See the green line beneath the blue line? This is the actual equity of the test account, while the blue line shows profit. The green lines dips quite far at times. This is the hedging taking effect. On this graph, it shows the green line eventually coming back to the blue, which is when all orders are closed and profits or losses settled.
Soon after designing this robot, I took the idea of hedging even further with another series of robots, where the blue profit line never moves, but the green equity line dips to zero, eventually causing a margin call on the account!
Even though this robot proved to be a loser (like all of my robots to date), I learned a lot from it, and I remember it fondly.
EURUSD
Still not much happening with EURUSD. I was able to fit in another bullish trend-line on the 60 minute chart. But I was also able to fit in a bearish trend-line as well, forming a wedge.
Until it either gets above that line, or moves lower, there's not much to report.
Ah, geometry. It's so much fun. I could draw trend-lines, boxes and circles all day.
This daily chart shows the price still reluctant to breach the 100 day simple moving average.
Until it either gets above that line, or moves lower, there's not much to report.
Feb 21, 2012
EURUSD
The start of the trading week saw many currency pairs open with a large gap. Monday trading saw the EURUSD resume it's upwards march, and we were able to fit a trend-line in there (shown in blue). Tuesday morning (Australia time), just after New York close, prices have broken through this trend-line.
There's three red lines on this graph. The top line represents the high from 9th February, and the other two mark a broad consolidation range from 25th January to 7th February. Current price action is struggling to get out of this range. It succeeded briefly on the 16th Feburary when the 1.3000 price level was flirted with and briefly breached and now the current rally which has just topped the consolidation range but failed to breach the February 9th high.
On the daily chart (not shown), prices are still under the 100 period simple moving average, while the 4 hour chart (not shown) shows prices bounced from the 200 period simple moving average last week.
We're assuming the daily chart holds a little more weight, and will watch 1.33096 (the current daily 100 SMA) and 1.3000 to the down-side.
So, pretty much the same analysis as Friday. Some intra-day action but not much movement over-all. For today, we can watch if the price is able to climb back above the blue trend-line.
Looking at fundamentals, and oh look, Greece is in the news. How unusual. This article seems to sum up nicely how we feel about Greece.
Feb 20, 2012
4 hour Box Break-out Trades Set
This EA from Forex Factory has drawn a new box for it's weekly break-out setup. While it does open orders automatically, I've been manually trading this system based on the break-out box, and have set BUY & SELL-STOP orders in my demo account for this week. We'll see what happens!
If the orders are activated, I keep track of them myself.
If the orders are activated, I keep track of them myself.
Feb 19, 2012
danw2 - bull+bear v1 EA
Once I downloaded a whole lot of robots from the MetaTrader codebase site and gave them each a quick back-test. Most of them bombed (but to be fair, I didn't adjust any settings, and barely read any available documentation that came with them).
This EA was inspired by one such robot found on that site, available here. They post their own back-test results, and they're impressive. I couldn't get it to work properly in my own back-test, but I had a quick look at the code and implemented by own version of it.
Quickly back-testing it (60 minute EURUSD, 1-1-2011 to 1-1-2012, stop-loss 30, trailing-stop 50) gave these results:
An impressive 89% return, but only a 43% win rate.
Sadly, AUDUSD and GBPUSD don't fare so well:
Additionally, this robot places an awful lot of trades, and from looking at the EURUSD equity curve, most of the profit comes from about 7 big jumps (possibly 7 big trades). Not a good sign.
Despite the impressive EURUSD results, this is a bad, bad robot.
This EA was inspired by one such robot found on that site, available here. They post their own back-test results, and they're impressive. I couldn't get it to work properly in my own back-test, but I had a quick look at the code and implemented by own version of it.
Quickly back-testing it (60 minute EURUSD, 1-1-2011 to 1-1-2012, stop-loss 30, trailing-stop 50) gave these results:
An impressive 89% return, but only a 43% win rate.
Sadly, AUDUSD and GBPUSD don't fare so well:
Additionally, this robot places an awful lot of trades, and from looking at the EURUSD equity curve, most of the profit comes from about 7 big jumps (possibly 7 big trades). Not a good sign.
Despite the impressive EURUSD results, this is a bad, bad robot.
Slope - RSI - Multi Time Frame EA
Someone searched Google for "RSI DAILY EA 2012", and my site was included in the results (and added to my website stats, which is how I know).
I don't have an EA by that name, but when I did the same search, I believe they were searching for this robot. It's a free EA from a site called "Trade2Win".
It includes the robot, and an indicator which must go in the MetaTrader 4 experts\indicators folder. It suggests you run it on the 5 minute EURUSD chart, but when I did and ran a back-test from 1-1-2011 to 1-1-2012, it bombed badly.
Another back-test on the 60 minute EURUSD chart reveals the following:
It makes a $2743 profit despite an abysmal 19.31% win rate. It was doing quite well until half way through it's run (like many robots I test), which could possibly be due to weird back-test history data. Looking at the equity graph, you can see it was up over $8,000 until the mid-way point.
I briefly tested it on 15 minute and 30 minute time frames, with no luck. I didn't attempt to adjust any settings.
I don't have an EA by that name, but when I did the same search, I believe they were searching for this robot. It's a free EA from a site called "Trade2Win".
It includes the robot, and an indicator which must go in the MetaTrader 4 experts\indicators folder. It suggests you run it on the 5 minute EURUSD chart, but when I did and ran a back-test from 1-1-2011 to 1-1-2012, it bombed badly.
Another back-test on the 60 minute EURUSD chart reveals the following:
It makes a $2743 profit despite an abysmal 19.31% win rate. It was doing quite well until half way through it's run (like many robots I test), which could possibly be due to weird back-test history data. Looking at the equity graph, you can see it was up over $8,000 until the mid-way point.
I briefly tested it on 15 minute and 30 minute time frames, with no luck. I didn't attempt to adjust any settings.
Feb 18, 2012
Some testing EA end-of-week results
29 robots. That's how many I'm currently testing. About 1/3 are in profit, but not by much. Most have been running for a few weeks at least.
Last week I mentioned briefly results from several of these robots. Let's see how they did this week.
First, the "Inside Bar" robot, which back-tested so well.
It's down $290 for the week. I had increased the lot size to make things more exciting. It has several small wins, but several much bigger losses. It could just be a bad week, but I doubt it. I don't think this robot will work out, but I'll keep testing it for a few more weeks.
In this post I mentioned three other robots. A "price failure" bot, "4 hr box breakout" EA, and another one I was vague about.
Pending Reversal Candle (Price Failure) EA results:
One trade, $292 profit. Quite a large (ie, not recommended) lot size considering the account balance. But fun to play with on a demo account, nonetheless.
4 hr box break-out EA results:
Last week I mentioned briefly results from several of these robots. Let's see how they did this week.
First, the "Inside Bar" robot, which back-tested so well.
It's down $290 for the week. I had increased the lot size to make things more exciting. It has several small wins, but several much bigger losses. It could just be a bad week, but I doubt it. I don't think this robot will work out, but I'll keep testing it for a few more weeks.
In this post I mentioned three other robots. A "price failure" bot, "4 hr box breakout" EA, and another one I was vague about.
Pending Reversal Candle (Price Failure) EA results:
One trade, $292 profit. Quite a large (ie, not recommended) lot size considering the account balance. But fun to play with on a demo account, nonetheless.
4 hr box break-out EA results:
This EA is available from Forex Factory. I'm actually trading it manually but relying approximately on the black box the EA draws in order to place the trades. It does place trades itself (0.01 lot size). This week, it would have lost if left alone.
I placed pending BUY-STOP and SELL-STOP trades myself at the beginning of the week. The first BUY-STOP was only just activated, but then dipped below the cyan lines and into black box territory. I closed it for a $44 loss. Next the SELL-STOP was activated, and if I had left it alone, would have made a crap load of money. But once the price showed signs of retracing, I closed it prematurely for a $146 profit. I flirted with the idea of placing additional SELL-STOP trades under the bearish price action, which in retrospect I should have. Just didn't have the cojones, even though this is just a demo account. The large lot size has a lot to do with it.
The last robot I mentioned in the Not All Doom and Gloom post which I was vague about didn't have a very good week, so it's not worth mentioning.
dan-mtf-ema21 EA
Oh boy! Do I ever remember this robot, from 27-08-2010! It blitzed the demo. I was so sure I had come up with a winning strategy, and so impressed with several days of demo results, that I put it on my live account.
Sure enough, it continued to win, so I upped the lot size, and went merrily off to the bar on that fine summers day to drink beer with my friend and tell him tales of my impending riches.
I came home to find it had gone belly up, and I had lost several days of profits, multiplied by about 10. Sigh.
This strategy calculates a 21 period EMA (exponential moving average) of 6 time frames (hence the "mtf" in the EA's name - "multi time frame") . If the price is above all of them, it opens a market BUY order (reverse for SELL).
Brilliant! A very simple strategy that I thought was also very clever.
I back-tested it with my usual parameters (60 min EURUSD chart, from 1-1-2011 to 1-1-2012), and it was a loser.
Looking at the code, it had some strange order closing logic, so I applied my coding magic and adjusted the take-profit from 50 to 500 pips. Et voilà !
That, my friends, is a mostly decent equity curve, 36% return on your money, and a 93% win rate!
But before you go stealing the code, giving it a cool name, and selling it as your own for millions of dollars to unsuspecting chumps, let's check the back-test results on our friends AUDUSD and GBPUSD:
Not so pretty, huh?
Not even a small profit on AUDUSD, despite a good win rate. Massaging the settings may yield better results, but I kind of doubt it. When robots fail in such a fashion on more than one currency, it's usually a sign that you just got lucky with whatever pair it showed a profit on.
Since I already suspect my history data of being highly dodgy, particularly the EURUSD data, I doubt this robot would ever work.
Go on. Try it on your live account. I dare you.
Last year I designed another similar robot based on multi-time frame 100 period moving averages, and it made a lot of money - sometimes. Then it would lose it's ass.
Eventually I figured out what was happening. Break-outs. Every so often the price action would break-out of a range, and money would rain down from the sky. But when the break-out ended, the robot suffered.
This is why I'm now currently demoing break-out strategies, both manual and some automated. I'm having slightly better (but not spectacular, so far) success with these strategies.
Sure enough, it continued to win, so I upped the lot size, and went merrily off to the bar on that fine summers day to drink beer with my friend and tell him tales of my impending riches.
I came home to find it had gone belly up, and I had lost several days of profits, multiplied by about 10. Sigh.
This strategy calculates a 21 period EMA (exponential moving average) of 6 time frames (hence the "mtf" in the EA's name - "multi time frame") . If the price is above all of them, it opens a market BUY order (reverse for SELL).
Brilliant! A very simple strategy that I thought was also very clever.
I back-tested it with my usual parameters (60 min EURUSD chart, from 1-1-2011 to 1-1-2012), and it was a loser.
Looking at the code, it had some strange order closing logic, so I applied my coding magic and adjusted the take-profit from 50 to 500 pips. Et voilà !
That, my friends, is a mostly decent equity curve, 36% return on your money, and a 93% win rate!
But before you go stealing the code, giving it a cool name, and selling it as your own for millions of dollars to unsuspecting chumps, let's check the back-test results on our friends AUDUSD and GBPUSD:
Not so pretty, huh?
Not even a small profit on AUDUSD, despite a good win rate. Massaging the settings may yield better results, but I kind of doubt it. When robots fail in such a fashion on more than one currency, it's usually a sign that you just got lucky with whatever pair it showed a profit on.
Since I already suspect my history data of being highly dodgy, particularly the EURUSD data, I doubt this robot would ever work.
Go on. Try it on your live account. I dare you.
Last year I designed another similar robot based on multi-time frame 100 period moving averages, and it made a lot of money - sometimes. Then it would lose it's ass.
Eventually I figured out what was happening. Break-outs. Every so often the price action would break-out of a range, and money would rain down from the sky. But when the break-out ended, the robot suffered.
This is why I'm now currently demoing break-out strategies, both manual and some automated. I'm having slightly better (but not spectacular, so far) success with these strategies.
EURUSD
Not much happened with the EURUSD last night. Thursday saw a drop to and test of 1.3000, which was rejected and the price rallied to 60 min 100 simple moving average.
Last night the price broke through the 60 minute upper 100 simple moving average line (upper red line), but it failed to break through the 60 minute 200 simple moving average (blue line). Also at about that 1.31845 mark was daily pivot R1 resistance and last weeks mid point. EURUSD failed to reach last weeks high, managed to move slightly lower, but closed a little higher.
Here is the EURUSD daily chart:
The price briefly followed the far bearish right trend-line (blue) and now rests slightly above it.
The blue box represents where I think the prices have consolidated. Apart from a brief poke above last week, the prices appear to be returning to this zone.
Looking at some other currency pairs to try to get a clearer picture of where the EURUSD might be heading, we can see that there hasn't been much action there, either, with the exception of GBPUSD and USDJPY.
The weekly charts for USDCAD and AUDUSD show an inside candle has formed:
The GBPUSD closed higher than last week, but failed to reach last weeks high. It did make new lows, however. The USDJPY rallied.
What other information do we have? EURGBP daily chart (not shown) suggests consolidation since January. USDCAD has tried several times to break through 0.99330, failed, and also appears to be consolidating.
So much technical information, my head hurts!
My best guess is to wait until EURUSD breaches 1.3230 or 1.3000 in a meaningful way.
Even the experts aren't in agreement with what the EURUSD is doing, so that makes me feel a little better about my indecision.
Fan Yang from FX Times thinks it might go up (with some caveats):
I particularly agree with his comments "The bounce from 1.2974 was very sharp in the 2/16 US session, and has followed through in the Asian and European session." But he points out resistance factors too.
And lastly, Joel Kruger from DailyFX thinks more consolidation and choppy trading is ahead, which is also the analysis I agree with.
Like a yacht stuck with no breeze, we sit and wait direction.
Feb 17, 2012
dan-rsi-2b EA
This robot from 15-04-2010 is another one relying on the values of 2 RSI indicators to place orders. RSI(5) attempts to tells if the market is over-brought or over-sold, while RSI(20) determines trend strength.
The robot opens a BUY market order if the larger RSI is above 50 but below 70, the smaller RSI is below 80, and a 3 period EMA seems to be going up.
The results are not good:
(Back-test on 60 minute chart, EURUSD, 1-1-2011 to 1-1-2012. Stop-loss 23, take-profit 54, trailing-stop 42).
You'll notice it placed no long trades. This is because there was a bug in the way it calculated the RSI values.
I remember this robot performing reasonably well on demo tests (but as with all my robots, only for a while). I must have fixed the bug in the version I was demo trading, and this version is one of the original backups.
Let's fix the code (available here), tweak the settings a little, and see what happens:
(Back-test on 60 min EURUSD chart, 1-1-2011 to 1-1-2012, stop-loss 30, take-profit 500, trailing-stop 30).
The win rate has almost doubled from 25% to 47%, and it makes a profit of almost 10% over the year, $995.
Not too happy with the equity curve though. Notice it stops making profit about half way through? This happens on too many robot back-tests.
As it turned out, there was more than 1 bug in the code. There's a section called "ASKdiff" which in place of any other sort of trade trigger, makes sure the ASK isn't too far away from a 3 period EMA. It looks like I coded it quite badly and it also wouldn't allow a BUY condition.
Almost all of my early robots used this code. I don't think all of them failed to place BUY trades, so I must have modified it at some stage. Yikes, I better go check!
The robot opens a BUY market order if the larger RSI is above 50 but below 70, the smaller RSI is below 80, and a 3 period EMA seems to be going up.
The results are not good:
(Back-test on 60 minute chart, EURUSD, 1-1-2011 to 1-1-2012. Stop-loss 23, take-profit 54, trailing-stop 42).
You'll notice it placed no long trades. This is because there was a bug in the way it calculated the RSI values.
I remember this robot performing reasonably well on demo tests (but as with all my robots, only for a while). I must have fixed the bug in the version I was demo trading, and this version is one of the original backups.
Let's fix the code (available here), tweak the settings a little, and see what happens:
(Back-test on 60 min EURUSD chart, 1-1-2011 to 1-1-2012, stop-loss 30, take-profit 500, trailing-stop 30).
The win rate has almost doubled from 25% to 47%, and it makes a profit of almost 10% over the year, $995.
Not too happy with the equity curve though. Notice it stops making profit about half way through? This happens on too many robot back-tests.
As it turned out, there was more than 1 bug in the code. There's a section called "ASKdiff" which in place of any other sort of trade trigger, makes sure the ASK isn't too far away from a 3 period EMA. It looks like I coded it quite badly and it also wouldn't allow a BUY condition.
Almost all of my early robots used this code. I don't think all of them failed to place BUY trades, so I must have modified it at some stage. Yikes, I better go check!
EURUSD
Even though Blogger adds the date to the top of the post, I keep wondering if I should put the date in the title.
Some action last night. EURUSD flirted with 1.3000 for a while, broke through it briefly before good US economic news propelled several currency pairs higher on "risk rally".
While the EURUSD only just broke through the bearish hourly trend line and failed to reach the previous days high, GBPUSD and AUDUSD (not shown) did.
There is finally a little bit of consolidation though, enough to place pending trades according to my break-out strategy:
Will there be a nice clean break-out or will volatility whip-saw my trades into stop-loss oblivion? Stay tuned ...
Feb 16, 2012
EURUSD
The EURUSD chart shows some interesting price action on the 1 minute chart as the price flirts with 1.3000.
Something is guaranteed to happen soon. But will it be an orderly breakout or whip-lash ahoy?
Something is guaranteed to happen soon. But will it be an orderly breakout or whip-lash ahoy?
"Batman" EA
Here's an interesting free EA that I found last night on the MetaTrader site, called "Batman". It includes a cool indicator called "BAT" which at very quick glance at the settings may be formed by multi time-frame ATR values.
Back-test performance on 1 hour EURUSD from 1-1-2011 to 1-1-2012 isn't very good:
I also tried 15 min and daily with no luck. However, H4 shows some promise:
$1389 profit, winning 54.8% of it's trades. Quite a difference from the other time-frames.
Back-testing on H4 GBPUSD wasn't so great, although interesting to see it broke even:
But quite the surprise from H4 AUDUSD:
Back-test performance on 1 hour EURUSD from 1-1-2011 to 1-1-2012 isn't very good:
I also tried 15 min and daily with no luck. However, H4 shows some promise:
$1389 profit, winning 54.8% of it's trades. Quite a difference from the other time-frames.
Back-testing on H4 GBPUSD wasn't so great, although interesting to see it broke even:
But quite the surprise from H4 AUDUSD:
$3986 profit, an almost 40% return over the course of a year. Only wins 59% of it's trades, although the equity curve is decent. Also, the draw-down is much less than with the other currency pairs.
I don't recall ever seeing a robot which performed better on the AUDUSD than the EURUSD. If I had time, I'd investigate further why this is.
Now, if only these robots would perform as well live, or even demo forward tests, we could all be rich. Sadly, this is rarely ever the case.
Subscribe to:
Posts (Atom)