$* Statistical London Breakout Strategy *$

Hi Jonathan. Thanks for the info.

The problem appears to be with the Automatic GMT. When this is set to ‘false’ it back tests OK and live trades OK. Setting to ‘true’ stops it working. I am using an Alpari UK test account.

I have found a GMT offset of ‘0’ works on my system. I am in the UK so I guess that makes sense. Looking at the chart from the back test, the trades open at 15.15 on MT4 (i.e. 13.15 GMT).

Here are the settings:

COM_GMT_1=— Time(zone) Settings
COM_GMT_2=(GMT - HH:MM)
Reference_Candle_Time=15:15
Reference_Candle_Back=1
Close_Pending_Time=23:00
Use_Automatic_GMT=0
Manual_GMT_Offset=0
COM_TRADES_1=— Trade settings
COM_TRADES_2=SL;DEV_BUY;DEV_SELL|TP;TP_VAL|BE;BE_TRIG;BE_DEV|TS;TS_TRIG;TS_STEP|MM;MM_VAL
Trade_Info=0;30;10|1;400|0;0;0|0;0;0|0;0.01
Close_Pending_After_TP=1
Friday_Close_Hour=20
COM_EXE=— Trade execution settings
IsECN=0
Max_Slippage=30
Max_Retries=5
COM_EA=— EA Settings
Magic_Number=654653568
EA_Name=PC_Breakout_Alpha_1

drb.

Well, great that it works now!

I am on Alpari UK as well, that’s pretty strange. Which number does it show on the upper left corner at “GMT-Offset: x” when you put it on a chart with “true”?

That is the strange thing. When I set it to ‘true’, NONE of the data is shown. When set to ‘false’, all the data is there and the offset shows the value set.

I did not know about this display feature until it started to work!

-Jonathan…about multiple positions and TP ideas:

I’ve tried different things with mutiple TPs, but found with the london idea that when the SL was hit, it was hard to make up for the loss with partial position wins, because the loss took all the lots traded. That’s why I started using one TP that seems the most often to be hit and 1:1 risk\reward. I think multiple positions might work when the ref candle is smaller, like it is often with the NY 15 min idea, because one win could be same $$$ as one loss, and another bigger win on the other position half would be added bonus. I do wonder what would happen on days, like yesterday, where we had 3 losses in a row with NY before TP was finally hit, which added up to a little more than BE for the session.

I agree that finding the best average of TP for the last 3 months at a time would help nail down the best single TP. It would be nice with the NY if it was even higher than 40 pips, as that would have applied to yesterday’s scenario very well, as the price broke out 53 pips down. But with the london idea, after a ton of testing different ideas, the simplest approach turned out to be the most profitable. The reason is it’s so easy to get into one day of action, when what really matters is what happened after a month’s worth of trading days\opportunities. By using both London and NY, I believe we can double the potential profit in $$$'s, and let the one trade per side (buy\sell) per session work for us. Each session is the opportunity, and I believe trying to get multiple trades within a session will reduce total profitalbility. Of course, there are instances, like yesterday, where the price ranges very quickly, and as long as the risk reward still is better than 1:1, it’s ok to reenter for that session.

USDJPY hit it’s 25 pip TP, but up until now has had way too many consecutive losses, unsustainable, so I’m dropping interest in this pair.

I think using a bigger buffer for NY should be ok up to a point- we don’t want the risk to grow too much in relation to reward- but a buffer big enough to avoid yesterday’s first loss should be appropriate-about 5 pips above and 3 below.

@drbios
This is really strange. Well, I guess you can use the manual offset for now, I’ll try to figure it out. Which operating system are you using?

@pipcompounder
Yes, I’ve read through all the different attempts that were made in the TP direction. It definitely makes sense to do as you say! What I’m thinking about though is maybe not to lock in the profits right away but maybe do it like this:

If the profit line is hit the EA will wait for the next 15M candle to close. Let us assume a long position. If this candle closes above the TP line we will put the stop at the bottom of this candle and move it along as the next candles come in. If it does not close below it or maybe retreats a certain value (5-10 pips?) the position will be closed.

What do you think?

Figuring out the TP in a quick look back by the EA automatically should be no problem in principle. 3 Months would be a bit too much though I think. In my opinion this strategy has to be very versatile and be at the heart beat of the market. So I think about 3 weeks would be better as sometimes the market conditions change quite rapidly. We would have to experiment and I’m very willing to do this though I would first like your guys support that this actually make sense.

Hm, that 1:1 ration got me thinking, so if it is higher than that we incorporate a reentry?

Also I’ve been thinking about including money management features into the EA. This would include risking a certain percentages of the account or a certain amount of money per trade. Is anyone interested in this or should I just leave it at fixed lot sizes?

@NY buffer
In my EA you can do that in the “Trade_Info” setting.
SL;DEV_BUY;DEV_SELL
Those three need changing, DEV_BUY is the distance from candle high to entry in pips, DEV_SELL its significant other.

Regards,
Jonathan

Hi Jonathan,

I am using Windows 7 professional SP1 (64bit).

Thanks.

drB.

Hi Jonathan
I think the money management idea is very sound. I was planning on doing this manually. For example, if after 30 days, my account has grown by 10%, i would want to take advantage of that and increase my lots by 10%. Actually does not need to be locked into a time period. As the account grows/decreases, the lot size could be adjusted by that growth %.

Indeed, I’ll add this functionality then :slight_smile:

@drbios
I’m using the same OS even… Let’s see if anyone else encounters this problem.
You are in the timezone EST right? If so I will do some testing in that direction.

If the profit line is hit the EA will wait for the next 15M candle to close. Let us assume a long position. If this candle closes above the TP line we will put the stop at the bottom of this candle and move it along as the next candles come in. If it does not close below it or maybe retreats a certain value (5-10 pips?) the position will be closed.

If there is some way you can make it happen while retaining the TP, in other words, basically guaranteeing a set TP as a minimum, than that would be good. It would be nice to capture some of those extra pips on the really big moves, like last week.

Also I’ve been thinking about including money management features into the EA. This would include risking a certain percentages of the account or a certain amount of money per trade. Is anyone interested in this or should I just leave it at fixed lot sizes?

I personally would love a MM system…that would keep me from having to get to my VPS all the time to adjust lot sizes.
A percentage as risk works well, but I favor, even more, a lot size relative to account size. For example, a setting for how many lots per $100 of account balance. A percentage of risk is nice when the ref candle is very small, because the lots can be bigger, and smaller when the ref candle is big, but may not make a big difference until the account itself is large ($5000+)

Hm, that 1:1 ratio got me thinking, so if it is higher than that we incorporate a reentry?

It would need to be better than at least 1:2 to have lots split into multiple TP points, in my opinion. I am not in favor of re-entry unless both pending orders already hit SL quickly, within an hour of being placed, or so. I tried to have reentries all day long, but it ended up losing in the end. One try a day per session per side (buy\sell). The session itself is the opportunity. Sortof a daily breakout, just not on daily TF.

If there is some way you can make it happen while retaining the TP, in other words, basically guaranteeing a set TP as a minimum, than that would be good. It would be nice to capture some of those extra pips on the really big moves, like last week.

Exactly my thinking. Well, I could do a TP point rather than a real TP which, when hit, sets the stoploss like about 10 pips below. We would have to figure out if losing that 5-10pips is worth the chance of double or so.

I personally would love a MM system…that would keep me from having to get to my VPS all the time to adjust lot sizes.
A percentage as risk works well, but I favor, even more, a lot size relative to account size. For example, a setting for how many lots per $100 of account balance. A percentage of risk is nice when the ref candle is very small, because the lots can be bigger, and smaller when the ref candle is big, but may not make a big difference until the account itself is large ($5000+)

I’m not quite sure I understand. Certain lot size per 100$ in the account would be pretty much the same as “risk x% of the account size” right? The lot size always is relative to the account that way.

It would need to be better than at least 1:2 to have lots split into multiple TP points, in my opinion. I am not in favor of re-entry unless both pending orders already hit SL quickly, within an hour of being placed, or so. I tried to have reentries all day long, but it ended up losing in the end. One try a day per session per side (buy\sell). The session itself is the opportunity. Sortof a daily breakout, just not on daily TF.

I like the idea of reentry when stopped out within a certain time period. I will add something like this tomorrow.

I’m not quite sure I understand. Certain lot size per 100$ in the account would be pretty much the same as “risk x% of the account size” right? The lot size always is relative to the account that way.

I didn’t explain the difference very well. I would prefer a set lot size as % of account balance. The alternative is % risk of account balance relative to the SL amount, which is the same as candle size. I think I like the lot size to be consistent relative to account size, regardless of size of SL.

Ok, I got you now, sorry for the confusion!

Here we go, this version contains the MM approaches we just discussed.
In order to use them, just change the following values in the “Trade_Info” setting:
MM;MM_VAL

MM:
[ul]
[li]0 - Risk Fixed Lot Size
[/li][li]1 - Risk Account Percentage Considering SL
[/li][li]2 - Risk Fixed Lot Size Per $100 In The Account
[/li][/ul]

MM_VAL:
The according value to the before chosen option.

If you tried it, please give me a feedback if everything went smooth.


A quick word on the EA Code:
As I understood throughout this thread, quite a few people are interested in how an EA works and want to understand it. Therefore I chose to reveal the coding here following the example of Crisscross. If you have any questions, feel free to ask them and I’ll be glad to give an answer if I can.
On another note regarding the topic. I chose to reveal the code, yes, though there is some pretty advanced stuff in there that I have developed over the years for reuse. This is the first time that I have decided to make this kind of coding publicly available because I trust you guys here. If you want to re-use this code I would like it if you would inform me and at least keep the copyright intact.

Just wanted to get this off my chest :slight_smile:

PC_Breakout_Alpha_2.zip (6.44 KB)

I like the idea of reentry when stopped out within a certain time period. I will add something like this tomorrow.

So, right now, the EA just places the pending orders once, correct? So yesterday after double losses, it would just wait until the next session, today?
Having it re-enter within a definable time period after ref candle ends is a good idea.

EDIT: WOW! You’re very fast! I haven’t even been able to download the first version! Thanks again, and everybody, please honor these guys that created these EAs by using them properly. Thanks

Yes, right now it only places the first two without reentry. I will add this function tomorrow as it’s getting late here (GMT+1) and I want to be fresh for the London opening :wink:

Haha thanks, believe me, especially the % function wasn’t created fast though. I use this stuff over and over so I only had to copy it in and hook it up to the “Trade_Info” thing. Your approach was pretty easy to do so thats why it was so fast!

You are very welcome, we all benefit here so I’m glad to do it!

Here we go, this version contains the MM approaches we just discussed.
In order to use them, just change the following values in the “Trade_Info” setting:
MM;MM_VAL

MM:

0 - Risk Fixed Lot Size
1 - Risk Account Percentage Considering SL
2 - Risk Fixed Lot Size Per $100 In The Account

MM_VAL:
The according value to the before chosen option.

So if I want 2 - Risk Fixed Lot Size Per $100 In The Account, I put the “2” there, and then if I wanted for example 2 micro lots per $100, would I put 0.02? or 2? on the MM_VAL:

Yup, the “0.02”. So a full set of this for the NY 15m breakout would be this:


0;30;10|1;400|0;0;0|0;0;0|[B]2;0.02[/B]

Sorry that I made this kind of complicated but it’s in the interest of testing flexibility, I hope you can see the benefits!

EDIT:
If you wanted the buffer in it would be this (both sides +4 pips):


0;[B]70;50[/B]|1;400|0;0;0|0;0;0|2;0.02

Thank you so much, again, Jonathan!!!

Now get some sleep, it must be morning over there already!

Hi Jonathan
I too need to switch that to false otherwise, I dont see the data on the left of the chart. I am using Windows 7 64bit too.
If I turn this to false, should I still be using 8:00 and 13:00 as the London and NY opens if my chart says 10:00 and 15:00? My offset is set to 2.

Okay, obviously I have to repair that…
Yes, please have it set to 2 and use 08:00 (09:00 respectively so it is placed after the 08:00 candle) and for NY 13:15 proved to work pretty good.

Hi Jonathan,

I am in the UK. So I was using a manual offset of ‘0’ and for London H1 EA, I then using 11.00 retrospectively. This then opens the trades at 9.00 GMT using the 8.00 GMT candle OK.

This is obviously the same as using a manual offset of ‘2’ and then using 9.00 retrospectively. Your method makes more sense when editing the EA parameters.

drb.