Regular visitors will have noticed ever increasing amounts of spam on the Trading Gurus Community Forum. On November 24th 2012 we implemented some changes:

1. New users will be moderated 2. Registered users who have a post count of zero will not be able to view attachments or download code. 3. Registered users who have a post count of zero will not be able to create a new thread

As an additional countermeasure we anticipate introducing a modest paywall in the near future.

If this is your first visit here our apologies for the inconvenience.

Existing users may wish to contribute their ideas to this thread.

Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 50

Thread: MQL4 Random Entry Systems

  1. #11
    Junior Member
    Join Date
    Jul 2010
    Posts
    20
    Hi Jim,
    my tests was as simple as it is possible. I wanted just familiarize with the MT4 functionality,
    and I was corious how the application is running and how the all menus and windows look like.
    The most interesting thing was, what happens with the virtual (fortunately) cash when I start
    your robot example5. After a several attempts to get the robot running, the whole installation
    started to earn/lose money. I have noticed, that the Alpari version of MT4 as opposed from the original one
    uses five decimal places what is more pleasant for me (the trend line in the chart behaviours more dynamicaly).
    I tryed to test the robot using historical data also, and the basic problem was to get the trend line of the account balance
    for a period from the far past, e.g. April, 1st to the Dezember 31th of 2009. Currently I know, there is a lot of data (for the M1 option), and it takes some time until the whole range of data will be downloaded. Secondly there was probably too less RAM
    (512kB) allocated to my virtual machine (VMware Player) and the MT4 backtest did not wanted to show the trend line.
    So I could not repeat exactly your result by testing EA example5. For a shorter periods results was not so nice
    but also positive.
    I have got an interesting result for the period January, 1st to the March, 31th ( or, it was from May, 1st to the July, 15th I am not sure now) of the 2010. The trend line rose during the first approximately two months, and then after a short period of horizontall
    course it fell down, but the result was still positive.
    Unfortunately I did not kept a record of date and time of the short ( a few hours) periods, when I tested your EA on-line
    and observed a 40-65 EUR profit after two or three such periods of testing. The starting amount of cash was 5000EUR,
    5 decimal places, default EA input parameters, EUR/USD pair.
    By the way, I noticed a strange lack of historical data (EUR/USD) (or fault of the trendline) observing them on the chart, I think, at the end of March or on the start of April. Does it have something with Daylight Saving Time to do? I think. it has bad influence
    on proper working of robots. I think they have to work around some way that problem.

    Cheers,
    Stan

  2. #12
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494
    Hi Stan,

    Quote Originally Posted by Stan View Post
    Hi Jim,
    I tryed to test the robot using historical data also, and the basic problem was to get the trend line of the account balance
    for a period from the far past, e.g. April, 1st to the Dezember 31th of 2009. Currently I know, there is a lot of data (for the M1 option), and it takes some time until the whole range of data will be downloaded. Secondly there was probably too less RAM
    (512kB) allocated to my virtual machine (VMware Player) and the MT4 backtest did not wanted to show the trend line.
    So I could not repeat exactly your result by testing EA example5. For a shorter periods results was not so nice
    but also positive.
    512 Kb ought to be enough RAM to do some serious backtesting with MT4. Never tried it inside VMware personally, though I don't see why that should affect things.

    I have got an interesting result for the period January, 1st to the March, 31th ( or, it was from May, 1st to the July, 15th I am not sure now) of the 2010. The trend line rose during the first approximately two months, and then after a short period of horizontall course it fell down, but the result was still positive.
    Unfortunately I did not kept a record of date and time of the short ( a few hours) periods, when I tested your EA on-line
    and observed a 40-65 EUR profit after two or three such periods of testing. The starting amount of cash was 5000EUR, 5 decimal places, default EA input parameters, EUR/USD pair.
    Thanks for the info. When I have a spare moment or two I'll try a backtest of my own, and see if we can compare notes.

    By the way, I noticed a strange lack of historical data (EUR/USD) (or fault of the trendline) observing them on the chart, I think, at the end of March or on the start of April. Does it have something with Daylight Saving Time to do? I think. it has bad influence on proper working of robots. I think they have to work around some way that problem.
    MetaQuotes seem to have a problem with their historical data at the moment. See this blog post for a bit more info:

    http://trading-gurus.com/fxcm-strate...free-download/

    Last time I checked there was a big gap for the second half of March, and from the second half of May too. That will make a total nonsense of any backtest you try that spans those periods. You can use the MT4 History Center to check what's missing if you're feeling keen!

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

  3. #13
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494
    This is the equity curve I got backtesting GuruEx05 on an Alpari UK demo account, with as far as I know no gaps in the historical data:

    GuruEx05-H1-10-1.jpg

    This is on EUR/USD, starting on January 3rd 2010 to date, with a $100 initial balance and using 1 micro-lot (0.01)

    41 trades, 39 wins, 2 losses. Average winning trade $10. Average losing trade $100.09!

    Does this look anything like what you see Stan?
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  4. #14
    Junior Member
    Join Date
    Jul 2010
    Posts
    20
    Hi Jim,
    there is what I achieved, but it looks like not so optimistic...
    Generally, I am not able to run tests using M1, M5, and M15 periods.
    For the above periods Strategy tester loads only a part of the data.
    The first one available for me is M30.
    There is a big difference in results when I am using e.g. H1 and M30.
    Unfortunately I can not attach reports, they are .htm files.
    Starting date is 04.01.2010 to date, initial balance 10000EUR or 100EUR, lots 0.01.
    Attached Images Attached Images
    Last edited by Stan; 07-28-2010 at 03:38 PM.

  5. #15
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494
    Thanks for those Stan - A picture is worth a 1000 words!

    This EA relies on being fed with tick data during a backtest, in the same way that it would receive price quotes in live trading. MT4 doesn't provide historical tick data, but instead simulates ticks. It doesn't do a terribly good job even starting with M1 historical data. As you can see, the longer the timeframe you start from the worse things get, particularly since it sounds like in your case you are missing big chunks of M1 data, and probably some on higher timeframes too.

    For this EA particularly, you need to make sure you only backtest over periods for which you have complete M1 historical data.

    Hope that makes sense!
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  6. #16
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494
    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.

    Ideally you need to set up a completely separate installation of MT4 to use for backtesting. Then import this data and maybe we'll at last be able to match each others backtest results?

    Let me know if it's not obvious how to do any of that.

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

  7. #17
    Junior Member
    Join Date
    Jul 2010
    Posts
    19
    Hi Jim, my first post. Programmer and experimenting with forex. Like everyone else (they can admit it or no) looking for the holy grail (but not expecting to find it!).

    I find the EA's you have posted interesting, and I like the program architecture. I am particularly interested in the Random Entry EA, because the backtest results are counter-intuitive. I have tested it a few times (M30, SL,TP of 500) and it seems to me to run neutral (small loss, small gain) over short and medium periods (3 months), and this poses the question: Why?.

    By rights, the EA should lose as spread eats away the capital. Perhaps it will over very lagre numbers of bets. My tests show around 400 orders, and I would have thought that would be ample to start draining the account. I modifed your program to base the bet on the last two bars, and that loses. I once made a random EA where i made bets opposite to the last result and that always drained.
    Have you tried any other random strategies? What are your thoughts on why this EA does not lose fast?
    Last edited by pkotak; 08-05-2010 at 06:31 PM.

  8. #18
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494
    Quote Originally Posted by pkotak View Post
    Hi Jim, my first post. Programmer and experimenting with forex. Like everyone else (they can admit it or no) looking for the holy grail (but not expecting to find it!).
    Hello pkotak, and welcome!

    Please feel free to pop over to the Introductions section, where you can introduce yourself at greater length, if that idea appeals to you.

    Here's a quote I like about the search for the FX Holy Grail:
    There is no Holy Grail, there is only the Holy Trinity. Discipline, Money Management and Probability
    I find the EA's you have posted interesting, and I like the program architecture. I am particularly interested in the Random Entry EA, because the backtest results are counter-intuitive. I have tested it a few times (M30, SL,TP of 500) and it seems to me to run neutral (small loss, small gain) over short and medium periods (3 months), and this poses the question: Why?.

    By rights, the EA should lose as spread eats away the capital. Perhaps it will over very lagre numbers of bets. My tests show around 400 orders, and I would have thought that would be ample to start draining the account. I modifed your program to base the bet on the last two bars, and that loses. I once made a random EA where i made bets opposite to the last result and that always drained.
    Have you tried any other random strategies? What are your thoughts on why this EA does not lose fast?
    Thanks for the compliment, and this EA is meant to be counter-intuitive! Why? That's a very good question. Ask it frequently. Rephrase it slightly. Why all those indicators? That's a good one too.

    I've never tried this EA on any timeframe apart from M1 by the way, using MT4's "Every tick" model. MetaTrader's only simulating ticks of course, and not terribly well at that! It's also interesting that Stan got rather different results on different timeframes. Since the EA doesn't use bars internally at all (as originally written at least) changing timeframe shouldn't change the backtest results. How did you settle on M30?

    You can experiment with the other input settings, and almost certainly find a combination where GuruEx01 will lose money fast! Maybe that isn't a very good place to start designing your own trading system? If you can find a few combinations of input settings where it manages to make some money on even a cursory basis, maybe one of those is a much better place to start your journey? If you're prepared to put in the effort, you'll find that search much more rewarding than the search for the Holy Grail.

    Once you have your baseline, you're then in a position to be able to assess how much value your entry adds to your system. And maybe this particular pseudo-random entry is in actual fact just a teeny bit better than the toss of a coin? Maybe that last tick is already adding a bit of value?

    Am I making any sense at all yet?

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

  9. #19
    Junior Member
    Join Date
    Jul 2010
    Posts
    19
    Hi Jim,
    Ok, as the inventor of this EA, I suspect you have already trodden the path I have embarked on, and will have done the same experiments and will perhaps know answers or have hypotheses for some of the points I am raising. I want to raise a few more points about the strange results of this EA, and I will do this across 2 or 3 posts, but first, to respond to the points you have made:

    i) M30 was rather a random selection, and surprisingly, there are (small) differences for results in different timeframes, at least for the 500 SL,TP setting. Perhaps the timeframes are not exactly aligned and the backtester starts its ticks at slightly different points. This EA should drain in pretty much all circumstances. What is shocking to me is that even with balanced SL/TP and spread included, the EA returns a neutral result with anything above a SL/TP setting of 200. Anything below that drains, as expected because of spread. I will test it on a weekend on Alpari when the backtest spread is huge and see if it still wins.

    ii) I agree that "that last tick is already adding a bit of value", but it cannot be nearly enough to overcome spread and create a near even result over periods of several days, weeks, months. In terms of "Forex space", the two events, the triggering tick, and the eventual outcome minutes or even hours later, are "space-like separated" and cannot be strongly causally linked. Unless its a "quantum-correlated-spooky-action-at-a-distance" type of Forex equivalent. Unlikely, and AE of your signature quote wouldn't have liked it. That leaves a couple of remaining possibilites. One, the tick simulation in the backtester is somehow the culprit, and forward testing will break the result. Or two, the result is genuine and verified in forward test, in which case the possibility exists that something quite subtle is going on, with profound effects. I would like to discuss both of these possibilities in a separate post.

    iii) The point you made about "Why all those indicators" is indeed very apposite. To be anything other than noise, an indicator must indicate at some level a yea or nae. To my eyes, if the result of this EA is real, then it sets a baseline. To be useful, an indicator must at least run even like this EA, and if it doesn't then it has a negative effect. I suppose one should test indicators both with and without spread. Any EA I have ever tested built from the "standard" indicators always loses, some all the time and some when conditions turn unfavorable, e.g. flat trend, high volatility, etc. The question is, would all those "standard" indicators win if there were no spread?

    iv) Some more tests I did: last bar (instead of last tick) loses. Why? Last two bars and last two ticks both lose. Reverse bet to last tick loses, interesting result that last one because it has implications about the soundness of the Metatrader backtester.

    v) As to designing my own trading system, I am trying to do that, but I am not yet totally convinced that a profitable one of the type I am looking for is possible, for the following reasons:
    With any trading, crudely there two possible winning types results, slow and fast. Fast would be grail. Slow can be "fundamentals" like Company undervalue, Currency weakening etc, and will be 3 to 300 percent per annum slow. Sound and believeable but slow unless you are Warren Buffet or Soros and have a big initial stake. Or slow can be very few "qualifying triggers" and hence very few bets and such a system winning would not convince me because the resultset would be too small to prove anything. The only slow system I could believe in would be one that made a very large number of bets and won almost imperceptibly over a long period, like zero on the roulette wheel. The point is, with "Discipline, Money Management and Probability" you can stay alive for a long time against the roulette wheel, but you ultimately lose. And the zero in Forex is with the Brokers.

    I feel that a winning trading system and a "holy grail" are very closely linked. As a programmer I believe that if a system can be articulated, it can be coded (at least in Forex). If that is the case, then even a slow winning system, if automated, and scaled (multiple accounts, multiple currencies, etc.), will be near grail. And the grail cannot exist, because if it did, compounding it would kill all of Forex. Of course this limiting case is nonsense, and hope lies in the fact that there are "people" on the other side of a trade, and hence winners and losers. I also have a gut feel that there is probably such a thing as residual momentum in many Forex situations and perhaps one can exploit this if one can detect it.
    Last edited by pkotak; 08-08-2010 at 08:29 AM.
    Like a long-legged fly upon the stream, His mind moves upon silence. - W.B. Yates

  10. #20
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494
    Hi pkotak,

    Quote Originally Posted by pkotak View Post
    Have you tried any other random strategies?
    Here's another "random" thought. Let's attack the problem from the other end. Let's assume you have a system that (on average) makes you money. It has a fancy entry, fancy money management, and a fancy exit. Your entry is based around some sort of "line in the sand". A breakout beyond prior resistance, or a retracement from some sort of pivot level for example. 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?

    Cheers,

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

Page 2 of 5 FirstFirst 1234 ... 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
  •