Blind guesswork in an EA?

Place your new trading idea here to see if someone can automate it.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Blind guesswork in an EA?

Post by SteveHopwood »

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:
  • - take a trade in a direction pseudo-randomly selected by the EA.
    - whatever the stop loss is, the take profit is twice or thrice the stop loss
Any further ideas, guys?

:D

Edit: read Gary's post that follows this one; it is enlightening.
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
garyfritz

Re: Blind guesswork in an EA?

Post by garyfritz »

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 :D -- you can't keep doing it forever, and eventually you get deep enough in recovery that you have to bail. And again interestingly enough, that bail-out tends to lose you about what you made in all of your wins.

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.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Blind guesswork in an EA?

Post by SteveHopwood »

Gary, you mentioned the 'M' word. Wash your mouth out with soap and water. :lol:

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.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
garyfritz

Re: Blind guesswork in an EA?

Post by garyfritz »

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. :D
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Blind guesswork in an EA?

Post by SteveHopwood »

Good point. I will leave it in place.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
nanningbob
Trader
Posts: 4564
Joined: Sun Dec 04, 2011 1:23 pm

Re: Blind guesswork in an EA?

Post by nanningbob »

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
I trade http://www.stevehopwoodforex.com/phpBB3 ... =38&t=3964,
I talk about my philosophy of trading here.
http://www.stevehopwoodforex.com/phpBB3 ... =38&t=3627
"The key to converting something useful to others is simplicity. Complexity is the enemy to execution." Tony Robbins
User avatar
Alpenkorps
Trader
Posts: 213
Joined: Thu Dec 15, 2011 4:03 am

Re: Blind guesswork in an EA?

Post by Alpenkorps »

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.
Take my love, take my land, Take me where I cannot stand
I don't care, I'm still free, You can't take the sky from me
garyfritz

Re: Blind guesswork in an EA?

Post by garyfritz »

I wrote up a little TS system to test this and make sure I knew what I was talking about. :D

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.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Blind guesswork in an EA?

Post by SteveHopwood »

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. :lol:

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
garyfritz

Re: Blind guesswork in an EA?

Post by garyfritz »

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 :oops:, then spent about half an hour experimenting with different cases.

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.)
Post Reply

Return to “Ideas for Possible Automation”