• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 8:44am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 8:44am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

The Force 5min system 3,806 replies

MT4 Breakout Alert Bollinger Band & Donchian Channel indi? 0 replies

Bollinger Bands & SMA for the 1Min & 5Min Charts 29 replies

My journal on The Force 5min system 5 replies

  • Trading Systems
  • /
  • Reply to Thread
  • Subscribe
  • 7
Attachments: 5min Bollinger breakout system
Exit Attachments

5min Bollinger breakout system

  • Last Post
  •  
  • Page 1 2 3
  • Page 1 2 3
  •  
  • Post #1
  • Quote
  • First Post: Feb 24, 2007 5:08am Feb 24, 2007 5:08am
  •  brue
  • | Joined Dec 2006 | Status: Member | 11 Posts
Here is a profitable 5 min system I have come up with:

Trade EUR/USD 5 minute chart.
Indicators used: Upper Bollinger Band (period 14, 2 standard deviations, low price), Lower Bollinger Band (period 14, 2 standard deviations, high price), DeMarker (period 14), ADX (period 14, typical price), ATR (4 hour chart, period 100), EMA (period 14, typical price)

Open long when price is within 5 pips of upper band, demarker is greater than .7 or less than .3, and ADX is at least 40.
Open short when price is within 5 pips of lower band, demarker is greater than .7 or less than .3, and ADX is at least 40.
20 pip take profit, stop loss is large at 10 * ATR.

Also:
Close long when we are profitable and the price drops below the EMA.
Close short when we are profitable and the price goes above the EMA.

It's probably a bit more complicated than it needs to be, but there's a reason for everything. Using the low price for the high band and the high price for the low band seems to work the best. The DeMarker and ADX confirm that we're in trending mode, not ranging mode (a move outside the bands is more likely than a move inside them).

I only have 5 minute data going back to 10/27/2006 from my broker (ibfx), so that's all I've used to backtest. Setting the value at risk (the amount you would lose if the stop loss were hit) to 10% nets a profit of 25% in 4 months. A much more aggressive VAR of 50% (which might not be completely unreasonable, since the stoploss is rarely hit) it returns 215%, which works out to about 33% per month. Not too shabby... but it does carry some pretty big losses (200-300 pips); in one instance it sits almost a month on a trade before closing it out for a profit. Usually I've made systems that accept losses much more freely, so this is sort of an experiment for me.

I look forward to all of your comments. I've attached the EA; feel free to test it and let me know how it does for you. I'm especially interested in seeing results from a longer time period using IBFX or FXDD data, if anyone has access to that.

Thanks, and happy trading!
Attached Image
Attached File
File Type: mq4 Bands Breakout.mq4   8 KB | 18 downloads
  • Post #2
  • Quote
  • Feb 24, 2007 9:26am Feb 24, 2007 9:26am
  •  fxnewbie 71
  • | Joined Dec 2006 | Status: Member | 118 Posts
Quoting brue
Disliked
Here is a profitable 5 min system I have come up with:

Trade EUR/USD 5 minute chart.
Indicators used: Upper Bollinger Band (period 14, 2 standard deviations, low price), Lower Bollinger Band (period 14, 2 standard deviations, high price), DeMarker (period 14), ADX (period 14, typical price), ATR (4 hour chart, period 100), EMA (period 14, typical price)

Open long when price is within 5 pips of upper band, demarker is greater than .7 or less than .3, and ADX is at least 40.
Open short when price is within 5 pips of lower band, demarker is greater than .7 or less than .3, and ADX is at least 40.
20 pip take profit, stop loss is large at 10 * ATR.

Also:
Close long when we are profitable and the price drops below the EMA.
Close short when we are profitable and the price goes above the EMA.

It's probably a bit more complicated than it needs to be, but there's a reason for everything. Using the low price for the high band and the high price for the low band seems to work the best. The DeMarker and ADX confirm that we're in trending mode, not ranging mode (a move outside the bands is more likely than a move inside them).

I only have 5 minute data going back to 10/27/2006 from my broker (ibfx), so that's all I've used to backtest. Setting the value at risk (the amount you would lose if the stop loss were hit) to 10% nets a profit of 25% in 4 months. A much more aggressive VAR of 50% (which might not be completely unreasonable, since the stoploss is rarely hit) it returns 215%, which works out to about 33% per month. Not too shabby... but it does carry some pretty big losses (200-300 pips); in one instance it sits almost a month on a trade before closing it out for a profit. Usually I've made systems that accept losses much more freely, so this is sort of an experiment for me.

I look forward to all of your comments. I've attached the EA; feel free to test it and let me know how it does for you. I'm especially interested in seeing results from a longer time period using IBFX or FXDD data, if anyone has access to that.

Thanks, and happy trading!
Ignored
hi brue,thanks for sharing your systedm but do u mind attached more charts to explain your theory,i dont quite understand your theory,sorry for my amateurish questions...thanks
 
 
  • Post #3
  • Quote
  • Feb 25, 2007 4:47pm Feb 25, 2007 4:47pm
  •  skyline
  • Joined Apr 2006 | Status: Metatrader Programmer | 1,391 Posts
Brue, at first look I backtested your EA over Alpari 1 year data and my eyes jumped out of my face since it seemed to be really good. Then I started to analyze more accuratly the code and the orders and I found that you use very very high stoploss. The problem stay here for me :

20 pip take profit, stop loss is large at 10 * ATR.

In the code you use ATR(100) on the H4 timeframe, this get an average value of 40-50 pips so you are using a 400-500 SL for only 20 TP thus more than 20:1 Risk/Reward. Maybe a more reasonable value will be to use SL = ATR/4 to get some R/R in your favour but I really doubt that the performance will be the same (there will be more losses)
My conclusions are that using your method with these figures will lead sooner or later to blown your account.

Take care
 
 
  • Post #4
  • Quote
  • Feb 25, 2007 11:48pm Feb 25, 2007 11:48pm
  •  WHTenn
  • Joined Nov 2006 | Status: Member | 1,758 Posts
Hey there.... if you would, can you send up a picture of a chart as you see it?

Thanks a lot and good luck!
 
 
  • Post #5
  • Quote
  • Feb 27, 2007 7:21am Feb 27, 2007 7:21am
  •  forig
  • | Joined May 2006 | Status: Member | 33 Posts
Hi Brue, really very nice results. Thanks for sharing EA. I`ve got more than 500% profit while backtesting it for the period feb 2006 - feb 2007. And no loses at all out off 37 trades. But I think it would be better to add changable stop loss into the code, you know just for the soul calm . Can you do this?
Thanks.
Attached File
File Type: zip BBBR.zip   11 KB | 7 downloads
 
 
  • Post #6
  • Quote
  • Feb 27, 2007 7:33am Feb 27, 2007 7:33am
  •  brue
  • | Joined Dec 2006 | Status: Member | 11 Posts
Quoting forig
Disliked
Hi Brue, really very nice results. Thanks for sharing EA. I`ve got more than 500% profit while backtesting it for the period feb 2006 - feb 2007. And no loses at all out off 37 trades. But I think it would be better to add changable stop loss into the code, you know just for the soul calm . Can you do this?
Thanks.
Ignored
You can change the stop loss. There's a variable called StopLossATR, which is the multiple of the 100-period, 4-hour Average True Range to use as the stop loss. On the EUR/USD the 4-hour ATR 100 tends to be in the 25-40 pip range, so using the default multiple of 10 the stop loss will usually be between 250 and 400 pips. I know that that's a huge number, which is why the EA uses very small lot sizes, calculated based on the value at risk (VAR) percentage (default is 0.1 (10%) I think). The lot size is calculated so that the amount that you would lose if the stop loss were hit is 10% of your account value. It's a more adaptive way of setting stop loss and lot size than just saying you're always using a certain stop loss and a certain lot size.

To reduce the stop loss to a more comfortable level, you could change it to 1 or 2 (putting you usually in the 30-60 pip range), but then the system will hit the stop loss much more often and, at least in my testing, lose lots of money. The reason that I'm comfortable with this EA setting a very, very large stop loss is that the lot size is calculated so I can only lose a certain percentage of the account (the VAR). So even if the stop loss is 400 pips, by dynamically calculating lot size I'll never lose more than 10% of the account.

Hope this helps...
 
 
  • Post #7
  • Quote
  • Feb 27, 2007 3:59pm Feb 27, 2007 3:59pm
  •  martypatty
  • | Joined Nov 2006 | Status: Riding in the Storm | 39 Posts
Thought I would post some results from today's trending market. I'm using 5 pairs on the 5-min chart. Default settings.
Attached File
File Type: zip Statement Bands Breakout Feb 27 07.zip   2 KB | 5 downloads
 
 
  • Post #8
  • Quote
  • Feb 27, 2007 4:47pm Feb 27, 2007 4:47pm
  •  Craig
  • Joined Feb 2006 | Status: Blah blah blah | 1,410 Posts
Two problems here,

1. The EA is trading of the in-bar data, this renders the backtest completely invalid.
2. When I try it on alpari data it totally bombs, linear equity curves like the one in the first post are signifigant of messed up data (the ibfx data is s**t).
The breaking of a wave cannot explain the whole sea.
 
 
  • Post #9
  • Quote
  • Feb 27, 2007 4:48pm Feb 27, 2007 4:48pm
  •  brue
  • | Joined Dec 2006 | Status: Member | 11 Posts
Quoting martypatty
Disliked
Thought I would post some results from today's trending market. I'm using 5 pairs on the 5-min chart. Default settings.
Ignored
Wow, 6.4% in one day! Looks like most of that was from shorting the USD/JPY, although it's still quite profitable with just the other pairs. I currently have this running on only the EUR/USD, but may have to consider... the backtests for EUR/CHF and USD/JPY on the little data that I have are also both profitable. Thanks for posting your results.
 
 
  • Post #10
  • Quote
  • Feb 27, 2007 5:01pm Feb 27, 2007 5:01pm
  •  brue
  • | Joined Dec 2006 | Status: Member | 11 Posts
Quoting Craig
Disliked
Two problems here,

1. The EA is trading of the in-bar data, this renders the backtest completely invalid.
2. When I try it on alpari data it totally bombs, linear equity curves like the one in the first post are signifigant of messed up data (the ibfx data is s**t).
Ignored
Craig--

1. Are you talking about the EA's use of indicators, or the use of the current Bid/Ask price to open/close trades? All of the indicators use the previous bar's data (offset of 1), so I don't think that poses a problem for backtesting.

As far as using the current price to trade, you're probably right that it makes the backtest less reliable. However, changing the EA to only trade the first tick of a new bar (by adding "if (Volume[0] > 1) return;" to the beginning of the start() function, the results seem to actually improve a little bit. Is there something I'm missing here?

2. I noticed the same thing; if you adjust the parameters a bit (I think just adjusting StopLossATR to a smaller level will do it), it's similarly profitable to the curve I posted. I've noticed this before; a simple bollinger bands reversal EA that I wrote performed spectacularly on Alpari but terribly on IBFX. Alpari's data has a lot more spikes in it, longer candles, etc., which is probably the main reason for the difference.

I don't have an account at Alpari, and as far as I know I'm not able to get one, so for me the Alpari data is a moot point. If you know of a US broker that supports MetaTrader and is better than IBFX, I'm all ears... until then, IBFX is the data I have to trade on, so IBFX's data history is what I have to use to backtest.
 
 
  • Post #11
  • Quote
  • Feb 27, 2007 5:12pm Feb 27, 2007 5:12pm
  •  Craig
  • Joined Feb 2006 | Status: Blah blah blah | 1,410 Posts
1. Both, but if your data is messed up it won't matter, what version of MT are you using.
2. Tried adjusting it, same result.

Suggest you read this (http://www.forex-tsd.com/metatrader-...at-i-love.html)
The breaking of a wave cannot explain the whole sea.
 
 
  • Post #12
  • Quote
  • Feb 27, 2007 5:38pm Feb 27, 2007 5:38pm
  •  brue
  • | Joined Dec 2006 | Status: Member | 11 Posts
Quoting Craig
Disliked
1. Both, but if your data is messed up it won't matter, what version of MT are you using.
2. Tried adjusting it, same result.

Suggest you read this (http://www.forex-tsd.com/metatrader-...at-i-love.html)
Ignored
1. Data quality aside, I don't see the problem here. I'm still relatively new at this, so maybe there's something I don't know? How would you correct the problem?

2. Try setting the starting balance to 100,000, and the VAR to 0.01. The lot size calculation assumes a mini-account and a minimum lot size of 0.01 mini lots. As far as I know, Alpari's minimum is 1 lot, so to get the same effect as testing $1000 with var 10% on IBFX you'd have to use 100 times the starting balance (to allow the smallest lot increments) and one tenth the VAR (to account for standard lots being 10 times as large). Using the default settings, I get a profit of $5639 from 1/1/06 to 2/28/07 with some pretty big swings both ways. From 1/1/01 to today I get a loss of -$6628, with the account minimum being -$15k and the max at about +$43k. I'd be interested to hear if you get similar results.

I'm more interested in hearing what you have to say about #1 though. What am I doing wrong here?
 
 
  • Post #13
  • Quote
  • Feb 27, 2007 6:06pm Feb 27, 2007 6:06pm
  •  Craig
  • Joined Feb 2006 | Status: Blah blah blah | 1,410 Posts
If you test a EA on a 1min timeframe, metatrader has no data for what happens 'inside' the 1min candle, so it generates semi-random fill data, trading off this 'filled in' data produces scapler EAs which generate huge profits (as it tends to be more volatile than real data). As you go up in timeframes the problem is less apparent as you have more data inside the candle. In summary, the a realistic backtest one should only open trades at the start of a bar to avoid doing calculations of any sort on the generated data. Compound this with the fact that your data is probably corrupted if you are using the 'download' button in history center and you have a recipe for disappointment.

Check out (http://articles.mql4.com/163) the english is pretty turged, but you should get the idea. Getting good backtests is a tricky process, suggest you check out any of the the popular MQL sites as all this stuff has been gone over a million times on sites like TSD.

If you do this stuff for long enough, you draw the conculsion that indicator EAs just don't work very well, so many people have being trying this stuff for such a long time now you would think that somebody would be able to find the 'magic combo', but no. People get EAs which work in certain market conditions but nothing that is consistant.
The breaking of a wave cannot explain the whole sea.
 
 
  • Post #14
  • Quote
  • Mar 1, 2007 1:03pm Mar 1, 2007 1:03pm
  •  abgcompu
  • | Commercial Member | Joined Dec 2006 | 37 Posts
Quoting brue
Disliked
Here is a profitable 5 min system I have come up with:

Trade EUR/USD 5 minute chart.
Indicators used: Upper Bollinger Band (period 14, 2 standard deviations, low price), Lower Bollinger Band (period 14, 2 standard deviations, high price), DeMarker (period 14), ADX (period 14, typical price), ATR (4 hour chart, period 100), EMA (period 14, typical price)

Open long when price is within 5 pips of upper band, demarker is greater than .7 or less than .3, and ADX is at least 40.
Open short when price is within 5 pips of lower band, demarker is greater than .7 or less than .3, and ADX is at least 40.
20 pip take profit, stop loss is large at 10 * ATR.

Also:
Close long when we are profitable and the price drops below the EMA.
Close short when we are profitable and the price goes above the EMA.

It's probably a bit more complicated than it needs to be, but there's a reason for everything. Using the low price for the high band and the high price for the low band seems to work the best. The DeMarker and ADX confirm that we're in trending mode, not ranging mode (a move outside the bands is more likely than a move inside them).

I only have 5 minute data going back to 10/27/2006 from my broker (ibfx), so that's all I've used to backtest. Setting the value at risk (the amount you would lose if the stop loss were hit) to 10% nets a profit of 25% in 4 months. A much more aggressive VAR of 50% (which might not be completely unreasonable, since the stoploss is rarely hit) it returns 215%, which works out to about 33% per month. Not too shabby... but it does carry some pretty big losses (200-300 pips); in one instance it sits almost a month on a trade before closing it out for a profit. Usually I've made systems that accept losses much more freely, so this is sort of an experiment for me.

I look forward to all of your comments. I've attached the EA; feel free to test it and let me know how it does for you. I'm especially interested in seeing results from a longer time period using IBFX or FXDD data, if anyone has access to that.

Thanks, and happy trading!
Ignored
THANKS
 
 
  • Post #15
  • Quote
  • Mar 1, 2007 2:12pm Mar 1, 2007 2:12pm
  •  comeinvest
  • | Joined Jul 2006 | Status: Financial confidence | 434 Posts
Hi there,

It's possible to implement a fixed stop lost for this EA?

Thanks
 
 
  • Post #16
  • Quote
  • Mar 1, 2007 2:19pm Mar 1, 2007 2:19pm
  •  brue
  • | Joined Dec 2006 | Status: Member | 11 Posts
Quoting comeinvest
Disliked
Hi there,

It's possible to implement a fixed stop lost for this EA?

Thanks
Ignored
No problem. A version like that is attached. I tested it quickly and the results look pretty similar to the first version. I'd be curious to know what you find.

In using it, remember that position size is calculated based on whatever value-at-risk (VAR) you set. So if you set a stop loss of 200 and your account size is $1000, VAR of 10% will be 0.5 lots, etc.
Attached File
File Type: mq4 Bands Breakout fixed stoploss.mq4   8 KB | 5 downloads
 
 
  • Post #17
  • Quote
  • Mar 1, 2007 2:36pm Mar 1, 2007 2:36pm
  •  martypatty
  • | Joined Nov 2006 | Status: Riding in the Storm | 39 Posts
Statement for the last 3 days.
Attached File
File Type: zip Statement Bands Breakout Feb 27-Mar2 07.zip   2 KB | 3 downloads
 
 
  • Post #18
  • Quote
  • Mar 1, 2007 2:50pm Mar 1, 2007 2:50pm
  •  comeinvest
  • | Joined Jul 2006 | Status: Financial confidence | 434 Posts
I find it strange cos i only have 1 trade for the 3 whole months. I wonder where i gone wrong~~
 
 
  • Post #19
  • Quote
  • Mar 3, 2007 3:15pm Mar 3, 2007 3:15pm
  •  Chandra
  • | Joined Sep 2006 | Status: Member | 321 Posts
Hi Bru:
I am copying down here the comments of Skyline. Can you answer his concern about 400 -500 pips SL?
--------
Here is the copy of Skyline's posting:

Brue, at first look I backtested your EA over Alpari 1 year data and my eyes jumped out of my face since it seemed to be really good. Then I started to analyze more accuratly the code and the orders and I found that you use very very high stoploss. The problem stay here for me :

20 pip take profit, stop loss is large at 10 * ATR.

In the code you use ATR(100) on the H4 timeframe, this get an average value of 40-50 pips so you are using a 400-500 SL for only 20 TP thus more than 20:1 Risk/Reward. Maybe a more reasonable value will be to use SL = ATR/4 to get some R/R in your favour but I really doubt that the performance will be the same (there will be more losses)
My conclusions are that using your method with these figures will lead sooner or later to blown your account.

Take care
 
 
  • Post #20
  • Quote
  • Mar 3, 2007 3:20pm Mar 3, 2007 3:20pm
  •  Chandra
  • | Joined Sep 2006 | Status: Member | 321 Posts
Quoting forig
Disliked
Hi Brue, really very nice results. Thanks for sharing EA. I`ve got more than 500% profit while backtesting it for the period feb 2006 - feb 2007. And no loses at all out off 37 trades. But I think it would be better to add changable stop loss into the code, you know just for the soul calm . Can you do this?
Thanks.
Ignored
What was your minimum drawdown and maxmum draw down?
Did you have any SL in place?
Thank you.
-Chandra
 
 
  • Trading Systems
  • /
  • 5min Bollinger breakout system
  • Reply to Thread
    • Page 1 2 3
    • Page 1 2 3
0 traders viewing now
  • More
Top of Page
Forex Factory Blog Updated: Alerting All Members
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022