| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Blind guesswork in an EA? https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=521 |
Page 1 of 2 |
| Author: | SteveHopwood [ Sat Apr 28, 2012 11:14 pm ] |
| Post subject: | Blind guesswork in an EA? |
These consecutive posts in the same thread reflect something that I have been considering for some time: http://www.stevehopwoodforex.com/phpBB3 ... 496#p11496 http://www.stevehopwoodforex.com/phpBB3 ... 545#p11545 I am considering coding the most basic of EA's:
Edit: read Gary's post that follows this one; it is enlightening. |
|
| Author: | garyfritz [ Sun Apr 29, 2012 12:08 am ] |
| Post subject: | Re: Blind guesswork in an EA? |
Generally a random entry has a 50-50 chance of hitting a fairly close TP or SL. Flip a coin, either the market goes your direction or it doesn't. With equal-size SL/TP you hit each about half the time, resulting in roughly a breakeven before costs. If the PT is further away than the SL, it's no longer a 50-50 proposition. Random market fluctuations will tend to hit the nearer SL more often than the farther TP. Interestingly enough, the proportion of the times that it hits the SL vs. the TP are generally just about equal to the TP:SL ratio. You're back to a breakeven before costs. The FX/Empty4 solution is to throw a Martingale at it. 50% of the time you lose, so you double up and flip the coin again. If you can keep doing that forever, Martingales are guaranteed winners -- but you take on unlimited risk for a small win. If you have limited funds -- as most of us do When I experimented with Scoobs' FR on Tradestation, I found that the simple version I was testing -- back around 4.2g I think -- was not much better than a coin-flip. If I removed the Martingale, it went pretty much sideways. Martingales can work -- most of the time -- with a higher-percentage system. With a 50% system you're going to get 4 levels deep in recovery about once every 16 trades -- LossPct^Level. If your entry has an edge and you can improve your win % to 70%, then you'll only hit L4 0.3^4 = 0.81% = once every 123 trades. If you can survive L4, you'll only hit L5 once every 400+ trades. But the trouble with Martingales is that you WILL hit your limit on it. Whether it's a Japanese tsunami/nuclear crisis or a 9/11 event or a 2008-style financial meltdown, sooner or later something will happen that blows up your Martingale. You should plan for that in your position sizing. Sorry for the Martingale side-track... but I think it applies to your question. The bottom line is, random entries tend to give you random results. You need to find entries/exits that give you an edge. |
|
| Author: | SteveHopwood [ Sun Apr 29, 2012 12:25 am ] |
| Post subject: | Re: Blind guesswork in an EA? |
Gary, you mentioned the 'M' word. Wash your mouth out with soap and water. What you write makes sense even to me. I shall leave this thread in place until I am fairly sure you have read my acknowledgement of your reply, then delete it. |
|
| Author: | garyfritz [ Sun Apr 29, 2012 12:27 am ] |
| Post subject: | Re: Blind guesswork in an EA? |
Why delete it? Somebody else might have the same question you did. Plus I went to all that effort to write up a nice answer. |
|
| Author: | SteveHopwood [ Sun Apr 29, 2012 8:52 am ] |
| Post subject: | Re: Blind guesswork in an EA? |
Good point. I will leave it in place. |
|
| Author: | nanningbob [ Sun Apr 29, 2012 10:32 am ] |
| Post subject: | Re: Blind guesswork in an EA? |
I know a guy in England who put a random generator on an EA and did this. It actually made money. The reason is during a range period you always have a chance of price bouncing around and hitting your TP. He didnt use a SL though. The result of his test was dont use a SL during range periods. LOL |
|
| Author: | Alpenkorps [ Sun Apr 29, 2012 10:57 am ] |
| Post subject: | Re: Blind guesswork in an EA? |
This reminds me of a coin flip test I did like a year ago. At the open of new daily candle, I opened trade at the direction of it at 10 pairs, SL last candles open, 1:1 RR. Surprisingly it made money in my 1 week test. I didn't have the coding skills to backtest. Anyway I moved on from these coin flipping ideas and learned how to trade. Gary is right, there is no edge in coin flip, and as you increase difference between SL and TP, you mathematically increase the possibility of more losses and less wins. A coin flip is a coin flip, you lucky, you win. |
|
| Author: | garyfritz [ Sun Apr 29, 2012 3:26 pm ] |
| Post subject: | Re: Blind guesswork in an EA? |
I wrote up a little TS system to test this and make sure I knew what I was talking about. If it's not currently in a position, it flips a coin and enters randomly at the close of the current bar. I set the SL and TP to be roughly 4*ATR. It won roughly 50% of its trades, as you'd expect. Running on 1 year of H1 bars, it traded about 250 times. WITHOUT any costs or slippage, it generally made somewhere between -$1000 and $1000 (+/- 1000 pips, trading 0.1 lots) in a year. In 10 trials, about 2500 trades, it lost a total of about $1000. Given enough trials I expect it would converge to breakeven. Then I set the SL to 2*ATR and left the TP at 4*ATR, so the TP was 2*SL. It usually won about 1/3 of its trades, and again it basically broke even before costs. I ran it on a year of M5 bars, again setting TP/SL at 4*ATR. On the first trial it traded almost 5000 times, won 49.66%, and lost a grand total of $257.23. Setting SL at 2*ATR so PT = 2*SL, it again won about 33% and came out about even. Then I set TP to 2*SL and got my first surprise. On a year of M5 it traded about 8500 times. Out of 10 trials, 9 were profitable -- not sure why. But even the profitable ones were only averaging about 0.1-0.2 pips per trade, before costs. So other than that small surprise, this test confirmed what I said -- random entries get you random profits. Costs and slippage will turn that into a guaranteed loser. Finally, I tried giving it a teensy bit of an edge. Instead of random entries, I tried going long when C > O, when C > C of N bars ago, when C > EMA(C,N), etc. I thought that might be enough to tip the scales to improve it over the random entry, but it didn't help much. The C>EMA(C,N) tests were consistently profitable (except for N in the 250-600 range), but only about 0.1 pips profit per trade. The best result was going long when C > C of 30 bars ago, and even that averaged only 0.50 pips per trade. Those simple tests aren't much better than random entry. |
|
| Author: | SteveHopwood [ Sun Apr 29, 2012 5:14 pm ] |
| Post subject: | Re: Blind guesswork in an EA? |
Thanks for spending the afternoon doing this, Gary. That was a super piece of research that will enlighten all who read it. And it saves me coding an EA. |
|
| Author: | garyfritz [ Sun Apr 29, 2012 6:54 pm ] |
| Post subject: | Re: Blind guesswork in an EA? |
That's one of the things I like about TS -- "EasyLanguage" really does let you do simple things easily. This random-entry test system is about 35 lines of code. I wrote it from scratch in about 10 minutes, spent about 20 minutes finding my stupid errors If only it handled multi-symbol testing better it would be fabulous. (MultiCharts also runs EasyLanguage, and I believe it does portfolio testing too. But it's a $1500 package and I'm not certain the portfolio-capable version handles FX. Khalid would know.) |
|
| All times are UTC | Page 1 of 2 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|