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 1 of 5 123 ... LastLast
Results 1 to 10 of 47

Thread: MQL4 London Breakout System

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

    MQL4 London Breakout System

    We've added another MetaTrader 4 expert advisor to our range of examples that come complete with source code. It's a modified version of our first example robot, but instead of "random" entries this one enters on the breakout from a range, a bit like our fourth example robot. It's ended up looking a lot like the "London Breakout" robots that seem to be all the rage at the moment.

    Here it is, along with the backtest results obtained using the default settings (which are totally unoptimised) with EUR/USD on an Alpari live account for the first 3 months of 2010 (i.e. until the clocks changed)

    GuruEx06.zip

    GurusEx06-Q1-10.jpg

    That was the first version. Here's the latest and greatest version:

    GuruEx06v105.zip
    Last edited by Jim; 09-07-2011 at 04:50 PM. Reason: Added version 1.05
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  2. #2
    Junior Member
    Join Date
    Apr 2010
    Posts
    20
    Thanks for the examples, Jim.

    Quote Originally Posted by Jim View Post
    ... this one enters on the breakout from a range ...
    Could you elaborate on how the range is calculated, please. Perhaps it's something to do with session high's and lows?

  3. #3
    Junior Member Mintaka's Avatar
    Join Date
    Apr 2010
    Posts
    29
    I am curious. My Meta Trader 4 EUR/USD account is hardly making any money the last 3 months in opposite to my GBP/USD. Compared to my real account your graph of backtest results for your London breakout robot on EUR/USD for Q1 2010 shows a profit. I am going to download your robot and test it. Will keep you inform. Thanks

  4. #4
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494
    Quote Originally Posted by Highfield View Post
    Could you elaborate on how the range is calculated, please. Perhaps it's something to do with session high's and lows?
    Example 4 entered on a breakout from the range of a fixed number of previous bars, which could potentially happen at any time of day or night.

    This one instead looks to enter on a breakout above or below the high/low of the "overnight range". The start and end times of this "session" are configurable in the EA. Some people like to use the "Tokyo session" to define the start and end times. Others prefer a few hours leading up to the opening of the "Frankfurt session" (usually taken to be 7 AM UK time), or the "London session" (8 AM UK time).

    If you experiment with the EA please be aware it is very simple minded! The start and end times have to be set using your broker's server time, which varies from one broker to another. Examples 1 and 4 didn't give two hoots about this, but for example 6 you might well find it is vital to get the session times set just right. Depending on how your broker handles this issue in their historical data, you might need to run a separate set of backtests when Daylight Saving Time is in force, for example.
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  5. #5
    Junior Member Mintaka's Avatar
    Join Date
    Apr 2010
    Posts
    29

    EUR/USD test ActivTrades

    I did a few tests. I also did the test for EUR/USD the same time period as you had; I used ActivTrades Demo account. My graph isn't the same as yours. Here is the graph from the test I took.

    TesterGraph.jpg

    This is very interesting why always is so!
    If you keep your mind humble, pride will vanish like morning mist - Dilgo Khyentse Rinpoche

  6. #6
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494
    Hi Mintaka,

    I suspect one problem you are having is that an ActivTrades standard account only uses 4 decimal places. If you have a standard account then you need to divide the ProfitTarget and StopLoss input settings by 10. See this picture:

    GuruEx06-Activ-4DP.jpg

    However it doesn't seem as though this is the only issue. I will investigate further!
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  7. #7
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494
    Once you get the DPs straight the results are much more compatible, but with the following exception. For order #36 ActivTrades logs it as a loss, whereas Alpari logs it as a win. Alpari's fractional pip spread (1.6 in my backtest) compared to ActivTrades spread of 2 is enough to make the difference between order #36 hitting the target at 2010.02.23 09:15 on Alpari, and just missing it and then being stopped out at 2010.02.23 12:08 on ActivTrades.
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  8. #8
    Junior Member Mintaka's Avatar
    Join Date
    Apr 2010
    Posts
    29
    Hi Jim, I did what you suggest. Indeed the graphs looks almost the same now. Thanks.
    If you keep your mind humble, pride will vanish like morning mist - Dilgo Khyentse Rinpoche

  9. #9
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494

    MQL4 London Breakout Robot Improvements

    Quote Originally Posted by Jim View Post
    We've added another MetaTrader 4 expert advisor to our range of examples that come complete with source code. It's ended up looking a lot like the "London Breakout" robots that seem to be all the rage at the moment.
    We've now added some bells and whistles (and fixed a bug!) to our MQL4 London Breakout expert advisor. Here are the changes:

    * Added a box showing the "overnight" range on the chart
    * Fixed a bug when trading session continues past midnight
    * Changed default SL/TP settings to 300/300
    * Added "FadeEntry" input setting

    We've also now changed from using Alpari UK to a Smart Live Markets demo account for the majority of our backtests. That's because backtests on Alpari demo accounts now simulate ridiculous spreads, especially at weekends. Smart Live use fixed spreads, which makes backtest results more consistent, and their quotes also use the same time zone as both Alpari and MetaQuotes, which makes tying together historical data easier.

    Here's the latest version of the source code:

    GuruEx06v101.zip

    and here's the result of our first backtest using GBP/USD:

    GuruEx06-GU-300-300-1.jpg

    That used some commonly suggested input settings for trading the London open, and involves trading a breakout of a range starting at the opening of the "Tokyo session" (Currently 1 AM BST according to the Forex Factory session times), and finishing at the opening of the "London session" (8 AM BST). The period the test covered was from March 28th (when British Summer Time began) to August 13th.

    As you can see, those results don't look very clever. We figured that since this particular variation on the London Breakout theme didn't make money we'd try doing exactly the opposite! We changed one of our shiny new input settings:

    GuruEx06v101.jpg

    Then when we tried the backtest once again this is what the MetaTrader 4 strategy tester revealed to us:

    GuruEx06-GU-Fade-300-300-1.jpg

    That setting changes the EA to reverse all the signals. When the system says "buy the breakout" the revised robot puts its money on a retracement by selling instead. Our "London False Breakout" strategy seems to be working rather better than the original at the moment!
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  10. #10
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494
    [Repost]

    Hi Jim,

    Could someone explain and describe what are the following parameters: Slippage, StpMode, StartTrading and StartRange?

    Thanks in advance

    Stan

Page 1 of 5 123 ... 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
  •