+ Reply to Thread
Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast
Results 21 to 30 of 46

Thread: MQL4 Random Entry Systems

  1. #21
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    362

    A Really Random Robot

    Here's a slight variation on the "random entry" theme. This version of the expert advisor actually uses a random number generator to decide whether to go long or short. It ought to be a pretty good simulation of simply tossing a coin to decide on the direction of each trade.

    This version has an extra input setting. If "ReallyRandom" is set to true, then every backtest run should see a different sequence of simulated tosses of the coin. If that input is instead set to false, every backtest run should see exactly the same sequence of simulated coin tosses.

    Compare it with the original version of GuruEx01 and see what difference a really random entry makes, compared to using the last tick to determine the entry direction.
    Attached Files
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  2. #22
    Junior Member
    Join Date
    Jul 2010
    Posts
    20
    Thanks Jim,
    I will test the new random EA with a pleasure. I hope the testing will be very useful and will broaden my mind.
    Last edited by Stan; 08-10-2010 at 08:31 AM.

  3. #23
    Junior Member Mintaka's Avatar
    Join Date
    Apr 2010
    Posts
    29
    Probably I will test it too. Maybe even the Russian version.
    I really appreciate your honesty and decency to add this section by every robot you posted -
    # Wealth Warning! This expert is for educational purposes only.
    # It should NEVER be used on a live account.
    If you keep your mind humble, pride will vanish like morning mist - Dilgo Khyentse Rinpoche

  4. #24
    Junior Member
    Join Date
    Jul 2010
    Posts
    19
    Hi Jim,
    Try testing it with a "random" entry instead. Draw a horizontal "line in the sand" across your chart at an arbitrary level, and base your entry around that.
    Does that give you any useful information about the value added by your fancy entry?
    I tried this, and also tested "A Really Random Robot" with a SL/TP of 500. I tested over the last 2-3 months with cable and EURUSD. Several hundred trades. And I am getting pretty similar results to the "last tick" based result, if anything more wins.

    The implication is that several variants of random do not lose. BTW, I was wrong thinking "last bar" (instead of "last tick") loses. In fact it gives pretty similar results. However, reverse of last tick and last bar both start draining.

    So, random stays neutral, whearas I have seen many (most!) indicator based EA's lose. So most indicators have a negative effect, worse than random. That would certainly explain why most most people lose at trading!

    The result is one I cannot comprehend. Unless the backtester is somehow at fault. What does GuruEx01 do in forward test?

    BTW, MQL4 MathsRand is not really random, bacause the result stays indentical over the same period. I will try to call a Win DLL and use a different external rand and get different results each time.
    Like a long-legged fly upon the stream, His mind moves upon silence. - W.B. Yates

  5. #25
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    362
    Hi pkotak,

    Quote Originally Posted by pkotak View Post
    The result is one I cannot comprehend. Unless the backtester is somehow at fault.
    The MT4 strategy tester is certainly less than perfect.

    What does GuruEx01 do in forward test?
    I've never tried GuruEx01 on a live account. I did try GuruEx02 (with added Martingale Money Management) on a live account once. It blew up before I had a chance to start a poll on when it would blow up!

    BTW, MQL4 MathsRand is not really random, bacause the result stays indentical over the same period. I will try to call a Win DLL and use a different external rand and get different results each time.
    It does seem to behave rather strangely. Once you've used it in "Not Really Random" mode it seems to get stuck there. However, if you only ever use it in "Really Random" mode different runs do give different results. Here are a couple I ran in quick succession just now, using 500/500 once more:

    ReallyRandom-2.jpg

    ReallyRandom-1.jpg
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  6. #26
    Junior Member
    Join Date
    Jul 2010
    Posts
    19
    Hi Jim,
    I did try GuruEx02 (with added Martingale Money Management) on a live account once. It blew up before I had a chance to start a poll on when it would blow up!
    And if you now test GuruEx02 in the backtester over the same period, with the same parameters, does it blow up in the same way as live?
    Last edited by pkotak; 08-11-2010 at 11:15 AM.
    Like a long-legged fly upon the stream, His mind moves upon silence. - W.B. Yates

  7. #27
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    362
    Hi pkotak,

    Quote Originally Posted by pkotak View Post
    And if you now test GuruEx02 in the backtester over the same period, with the same parameters, does it blow up in the same way as live?
    A priori I assumed almost certainly not. The individual trades realised by these random and pseudo-random "robots" vary enormously. A 0.1 pip difference in spread between brokers can lead to very different equity curves, and live trading will almost certainly not begin at exactly the same moment as a backtest, even using the same broker. In addition when performing a backtest with a floating spread broker such as Alpari, the live spread at the moment you start the backtest will affect the outcome also.

    Then I performed the experiment you suggested. First of all I discovered that Alpari UK have archived all trade data older than October 3rd, 2009, so it's no longer available through the MetaTrader 4 client terminal. I had to download the archived data and create my own equity curve using Excel. Here are my results on a live account:

    GuruEx02-Live.jpg

    And here is my best attempt at a backtest starting at the same time (i.e. June 3rd 2009):

    GuruEx02-03-Jun09.jpg

    As you can see, in this case the "robot" survived rather longer before the ultimate "Death by Martingale".
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  8. #28
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    362

    The Rhythm of the Markets - Track 1

    Hi pkotak,

    Out of idle curiosity I increased the initial balance by a factor of 10, and plugged in your suggested input settings of 500/500. Then I ran another backtest starting on the same date. This is what the MT4 strategy tester showed me:

    GuruEx02-Jun09-500-500.jpg

    No "Death by Martingale" yet.

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  9. #29
    Junior Member
    Join Date
    Jul 2010
    Posts
    19
    Hi Jim,

    Ok, having looked at the random ea results more closely, I begin to understand. Doesn't explain the result fully, but its a start.

    With the baseline of a balanced SL/TP, and roughly equal winning/losing trades, the factor deciding how the result "looks at first glance" depends on start deposit and the number of trades (which depends on the width of the SL/TP) . With 0.1 lots and 500 SL/TP we are losing 1.70 per loss, not enough to show an obvious dent with a few hundred trades if the start balance is large. Your original settings of 10000/1000 need a very large number of trades for sequences of SL being hit to show up, and when they do, they would set the result back badly.

    Would've helped if I paid more attention to start with.
    Last edited by pkotak; 08-12-2010 at 06:12 AM. Reason: typo
    Like a long-legged fly upon the stream, His mind moves upon silence. - W.B. Yates

  10. #30
    Junior Member
    Join Date
    Apr 2010
    Posts
    4
    Quote Originally Posted by Jim View Post
    Alpari used to provide downloadable archives of their historical data, but it looks like they've stopped doing that now. Here's the EUR/USD data I was using.
    Hi Gurus, I wonder if you could help me with a problem. Not long ago my computer broke and I lost all the data on my hard drive including my historical data for Alpari MT4. I downloaded your EUR/USD data and was hoping someone could provide a link for GBP/USD history.

+ Reply to Thread
Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts