ForexPippy breakout EA

User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

ForexPippy breakout EA

Post by SteveHopwood »

SERIOUS WARNING
  • Most Forex traders lose all their money.
    Using the robot posted here in trading Forex does not guarantee success.
    Trading this robot could lead to serious financial loss.
    Trading this robot without understanding its underlying trading strategies guarantees traders will lose their money.
    This is not a set-and-forget ea; there is no such thing and anyone who tries to claim there is, is either stupid or lying. This ea requires frequent manual intervention.
    At best, a trading robot is only 90% as good as the manual strategy it trades. At best. At worst, it can be much less effective. If the strategy is rubbish, so is the robot.
    To trade this robot, you have to understand:
    How to use EA's.
DO NOT USE THIS EA ON A LIVE ACCOUNT. IT IS EXPERIMENTAL.


Read the genesis of this robot, read post 2 here, which is a copy of forexpippy's post 1 in his own thread.

EA inputs
You will find descriptions of many of the inputs in the attached Shell User Guide. I wrote it for issue with bots I code in the future. Where you see inputs described that you do not see in the EA's inputs list, ignore them.

Time inputs
I have broken with my usual practise of entering times in our own local time. Instead, you enter them in your criminal's server time. You will see that the screen display shows this. I have done this because we are aiming for a box calculation between roughly 4.00 and 7.00 am gmt; few brokers have candles that are gmt-based. It is easier, I think, to input the box and trading times in crims terms. Some of you will find these hard to work out; sorry but there is nothing I can do to help. YOu need to work out your trading hours and then translate them to your crim's server time. Good luck; they confuse the Hell out of me.

The indicator
Thanks to George, you no longer need the indicator running on your chart. FP has the calculations 'in-house' and will draw the lines for you. It may well be worthwhile keeping the indi running, so you can study the recent past behaviour of the markets.

The Box
Now that FP will draw the box for you, you need to decide on these inputs:
  • BoxStartHour: the start of the breakout box. The default equates to 4.00 am gmt, converted for my gmt+1 Cowboy IBFX account. I think.
    BoxEndHour: the end of the breakout box. Your trading time start_hourm should be the same. I think.
    BoxExtendHour: the time to extend the box lines. Once these are left behind by the candles, there will be no further trading for the day.
    MaxPipsHiToLo: this limits the size of the trading box. If it is bigger than this input, then there will be no trading. The default is pure guesswork and probably needs adapting to individual pairs.
Ask line
Line-based 'pending' trades have the advantage of hiding your activities from the crims. Buys look a little strange unless you also have the Ask showing on your chart, as it looks as though they are being sent prematurely.

Hanover
The Hanover module allows us to trade in the direction indicated by hanover's Recent Strength indi. I consider this to be the most significant development in my time at FF. Details in the Hanover thread at http://www.forexfactory.com/showthread.php?t=319709 If you use Hanover, I recommend lawgirl's ratio of 1:4 to 1:6 between your trading and higher-direction time frames. For example, if trading the M5 chart, use M30 as your Hanover time frame.

As well as Hanover, there is lots of extra stuff not in the spec - take profit, stop loss, management etc. I have left it all there so I don't have to add it later when contributors ask, "Steve, can we please have................"

Coders
TrendDetectionModule() looks at all the choices made by the user and sets RsiTrend etc to the appropriate direction, then consults them as part of the trade decision process in LookForTradingOpportunities(). This makes adding your own fav filters easy.

In conclusion
FP is only at the start of its construction and there are a number of subtleties to be added; the first one will be min/max box sizes. The basics are there, so have fun.

:D

Matters of general interest

Read this post:
http://www.forexfactory.com/showthread. ... ost4923611 Newbie traders, read this for inspiration and warning. Those of you who have suffered losses, read it for inspiration. There is a thread devoted to Sam's trading method at http://www.forexfactory.com/showthre...25#post5118825

Masterly summary of hedging: http://www.forexfactory.com/showthread. ... ost4977179

EA coding
I receive may requests to code EA's. Traders, if I code your EA for free, then I will share it here. If you want me to code your EA without sharing, then my fee is $100 payable into my paypal account. I explain why at http://www.forexfactory.com/showthread. ... ost4431794, at the bottom of the post.

Useful utilities/EA's/scripts
MaryJane has posted a fabulous utility to allow us to resize EA input windows: http://www.forexfactory.com/showthread.php?t=299017
Multi purpose trade manager: http://www.forexfactory.com/showthread.php?t=89371
Account equity analyser: http://www.forexfactory.com/showthre...16#post4693716 Also at http://www.forexfactory.com/showthread. ... ost4709098, which includes a template for both USD and the Euro.
Past-trades display indi by squalou; shows a graphical display of the success/failure of trades in your History tab. Breathtaking piece of work. http://www.forexfactory.com/showthread. ... ost3830610
My shell EA – the code I use to produce EA's so quickly. http://www.stevehopwoodforex.com/phpBB3 ... p?f=5&t=15

Most promising trading EA's
jiva: http://www.stevehopwoodforex.com/phpBB3 ... hp?f=5&t=3
You do not have the required permissions to view the files attached to this post.
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. [email protected] 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
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

forexpippy's post 1 with system details

Post by SteveHopwood »

This is a copy of forexpippy's post 1 at http://www.stevehopwoodforex.com/phpBB3 ... p=330#p330
_____________________________________________________________________________

I've been trading Frankfurt/London open breakouts recently, which is based on a hybrid of two of Lawgirl's strategies (3/8 MA cross and 4 H1 candle breakouts) that I've adjusted to fit with my London breakout trades. It's been pretty successful so far, so I'd like to share what I've learned and hopefully take it further by developing an EA.

The logic, as I'm sure you will be aware from other London open BO strategies, is as follows:

The Asian session (particularly the last 4 hours) is generally pretty light on volume for pairs like EURUSD and GBPUSD, which makes the PA bounce around in a fairly tight range of around 10-35 pips. Once Frankfurt and London open at 7am and 8am GMT respectively, there is a surge in volume creating volatility and giving PA direction, often setting the trend for the day.

None of this is new or rocket science. The tricky part is avoiding false BOs, setting appropriate SLs and making sure your TPs are realistic. In addition, the BOs of each individual pair tends to go through phases (e.g. big moves in line with the trend, short bursts followed by indecision, fairly flat trading, hugely volatile all round etc). From my manual trading of this strategy, I've noticed that I'm "in tune" with a particular pair as the week(s) pass, and get a feel for the type of BOs that can be expected (save for any big news driven BOs). The addition of the 3/8 EMAs for confirmation is working really, really well. This, combined with what we already know about London opening BOs, could provide a nice edge.

I've noticed that, more often than not, a cross of the 3/8 EMAs in the Asian Range, followed by those EMAs breaking out of the range, normally nets a minimum of 20 pips, even if the BO turns out to be false.

The strategy I use:

1. Use Daily_LinesBoxes_OC.mq4 to set the "Asian Range". I tend to monitor from 3am GMT until 7am GMT to set the range (however longer or shorter periods work well too, they just produce different results).

2. Put 3 and 8 EMA onto the chart and wait for a BO on either side of the Asian Range on the M30. At the moment, I'm waiting until the close of the M30 candle AND both the 3 and 8 EMAs have exited the Asian Range.

3. Upon the 3 and 8 EMAs on M30 exiting the Asian Range, drop down to M5 and check PA is still moving in the right direction (wait for a nice parallel set of 3/8 EMAs pointing sharply in the intended direction of trade). Enter trade.

4. At the moment, I'm exiting for a simple 20 pip profit, with a 15 pip stop loss. I've experimented with trailing, jumping and decaying stop losses to varying degrees of success. I've also tried partial closure of trades. However, my findings are that a small TP seems to work best, since even false BOs tend to catch 20 pips.

This is what a normal set up looks like:

Image

NB: At the moment, I consider that this strategy works best by taking ONE breakout per pair, each day. Therefore it would be entirely possible to set the EA in the morning before the markets open, then let it work its magic.

What I think would be useful:

I think that a versatile BO trading EA would be beneficial, since it would allow us to not only backtest various BO settings, but also allow us to tailor the EA to work in harmony with each particular pair, for each particular type of BO. What I mean by "versatile" is simply to have a series of parameters which we will add or manipulate the set up and triggers etc.

The idea is that you can have a look at the market before you set the EA, pick your settings and then leave it to monitor for an entry after 7am GMT.

Therefore, would any coding genius be able to put the following components together in an EA? I know there is currently a 3/8 MA crossover EA in existence, so would it be fairly easy to adapt that to work in conjunction with BOs?

Daily_LinesBoxes_OC.mq4

(indicator is attached to this post)

Set max pips (if the size of the box is bigger than this, no trade will be taken)
Set min pips (if the size of the box is smaller than this, no trade will be taken)
General settings (user to input indicator settings such as start and finish time of box)

Trend Trading

Trend trading only (if set to true, a trade will only be taken in line with current trend, as set by user, so will need options to allow for example a 200 EMA on H1 to dictate tend).


Timing


Do not trade before (no trade will be take before this time)
Do not trade after (no trade taken after this time, useful for avoiding known news or low volume times for example)


Buy Trigger

Signal a buy trade when (user to select one or more of following):
  • Last candle on x TF is above Asian Range
    Current candle on x TF is above Asian Range
    3 and/or 8 EMA on x TF is above Asian Range
    3 and/or 8 EMA on x TF is above Asian Range
    On last close of period on x TF, 3 and/or 8 EMA was above Asian Range
    Wait for cross of 3 and 8 EMA on x TF
(we would need "pip buffers" for each of these, e.g. to ensure the PA has moved sufficiently in the desired direction)

Sell Trigger

(same as for buy, but applicable to movements below Asian Range)

Stop Loss

Fixed SL (a set number of pips) or
Other side of Asian Range (EA places SL on other side of Asian Range from BO)

Take Profit

Fixed TP (a set number of pips) or
3 and 8 EMA recross on x TF or
Trailing stop, jumping stop etc

Hanover

Hanover would seem to work well with this.

Risk Management

Fixed lot size or
Risk based lot size (e.g. if set to 2%, it will work out lot size based on current price and SL)


Would love any comments or suggestions :) Please let me know if I've missed anything.

Steven

: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. [email protected] 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: ForexPippy breakout EA

Post by garyfritz »

Please see my post on forexpippy's thread: http://www.stevehopwoodforex.com/phpBB3 ... 1048#p1048

Some crafty position sizing may be able to dramatically improve the results.
garyfritz

Re: ForexPippy breakout EA

Post by garyfritz »

Khalid, I've studied this extensively and I trade real money based on it. No disrespect intended, but is your opinion based on actual experience or hearsay?

Trading at *full* Kelly is certainly only for insane people who enjoy losing all their money. :lol:

But no sensible person trades at full Kelly. Trading at 1/10 or 1/5 Kelly scales back considerably from the "optimal" full Kelly value, and the drawdowns are much less. You choose how aggressive you want to be.

The important concept, though, is the variable position sizing based on past performance. Rather than arbitrarily saying "this EA seems to work best on USDJPY and EURUSD," you can measure the EA's performance on ALL pairs. Trading only the higher-Kelly pairs ensures that you trade on the pairs that (historically at least) performed well with your EA in the past. Using Kelly-weighted position sizing means you place bigger bets on the pairs that have performed the best.

In the breakout system I mentioned, trading at K/10 returns about 8%/month with 10% DD (up until the last few months). K/5 returns 14%/mo with 20% DD, and that's what I personally trade (partly because of 50:1 limitations in the US). K/2 returns 31%/mo with 50% DD, and full Kelly returns 45%/mo with 80-90% DD. (BTW the 45%/mo is **after** a 95% DD!! From 1/10 to 8/11 it had a really ridiculous return...) In reality, though, you'd probably need 500:1 leverage to trade at full Kelly -- and you'd be crazy to do so.

So Kelly betting auto-selects the best pairs to trade, and weights the best pairs the highest. That optimizes your results. You select the level of risk you're willing to take in exchange for return.

I don't agree with your comment that "successful trading depends on" much more. Certainly creating successful results is a very complex and challenging task involving many factors. But you can analyze the results of your trading very simply and scientifically. As long as you can continue to produce the same results in the future as you did in the past (which of course raises issues of curve-fitted backtests &etc), a Kelly analysis is a perfectly valid way to characterize your trading performance and guide your performance in the future.
garyfritz

Re: ForexPippy breakout EA

Post by garyfritz »

I do absolutely agree you should know what you're doing to use an approach like this. If nothing else you need to be able to accurately backtest your systems on a basket of symbols.

I would be very interested to hear what methods you have moved to, if you would be willing to share!
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: ForexPippy breakout EA

Post by gaheitman »

SteveHopwood wrote: The bot takes its hi-lo from the box lines drawn on the screen by the indi.
Steve,

Attached is a script containing a procedure to calculate the box high/low. I wanted it to be completely parameterized, so you'll need to pass it all the settings along with the variables you want to hold the calculated high/low values. It is defined as:

Code: Select all

bool GetBoxHiLo(int StartHour, int StartMin, int EndHour, int EndMin, int TimeFrame, double& hi, double& lo)
The original indicator did not support minutes, but I went ahead and added them. The procedure does not do much error checking and doesn't draw the lines on the chart.

Let me know if you have any questions.

George
You do not have the required permissions to view the files attached to this post.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: ForexPippy breakout EA

Post by SteveHopwood »

Fantastic again George. Thanks.

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

Re: ForexPippy breakout EA

Post by SteveHopwood »

Latest update in post 1, folks. I ask you to read the post for details.

I was wrong to say that the indi lines would entirely control the trading times, so my version took trades far too early. Even so, the bot ended the day in profit.

This is looking promising.

: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. [email protected] 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
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: ForexPippy breakout EA

Post by gaheitman »

SteveHopwood wrote:Latest update in post 1, folks. I ask you to read the post for details.

I was wrong to say that the indi lines would entirely control the trading times, so my version took trades far too early. Even so, the bot ended the day in profit.

This is looking promising.

:D
One odd thing about the lines. Since they are drawn based on the candle bodies only, there is an option in the code I gave you for the timeframe to use when determining the hi/lo of the bodies. In general, the smaller the time frame the larger the overall box will be since there are likely several opens/closes on 5 minute candles within the wick you see on the hourly candle. The original indicator works the same way.

I'm not sure it matters, but I would think you'd want to be able to select that as well, just in case.

George
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: ForexPippy breakout EA

Post by SteveHopwood »

forexpippy, George, not a clue and don't much care. I have worn myself out today adapting stuff to the EA via about 15 logic fuzzies and have had enough. Any other probs people have they can sort out for themselves. Post 1 describes what I have done.

: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. [email protected] 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.
Post Reply

Return to “Automated trading systems”