Example robot for MetaTrader 5

Bollinger Band Stretch

Trades EURUSD on 1-hour bars. It buys when 3 bars in a row close between the two Bollinger Bands below the average price. It sells when 3 close between the two bands above it. The price has stretched away from the average but not broken out.

Market
EURUSD
Bars
1-hour bars (H1)
Clock
UTC
What it does
Opens trades

The builder opens with this robot loaded. Change what you like, then check it. While we launch, getting it for your own accounts is free.

Bollinger Band Stretch in the builder: its 7 blocks, in rows. When: New bar, Every closed 1-hour bar, 07:00 to 20:00 UTC. If: Price and a band, 3 bars close between the lower bands; Price and a band, 3 bars close between the upper bands. Then: Buy, with a stop loss, after a stretch down; Sell, with a stop loss, after a stretch up. Safety limits: Daily loss limit, 3% of the account; Stop loss, 2 x ATR on every trade.

The rules, in plain words

Each rule is one or more blocks in the builder. Every number can be changed before you check the robot.

When
Every time a 1-hour bar closes, Monday to Friday, between 07:00 and 20:00 UTC (the London and New York sessions).
What it looks at
Bollinger Bands around the average price of the last 20 bars, two on each side. The near band is 1 deviation from the average. The far band is 2 deviations from it.
Buy if
3 bars in a row closed between the two lower bands: below the near band, but not below the far one.
Sell if
3 bars in a row closed between the two upper bands: above the near band, but not above the far one.
Then
It opens one trade with a stop loss twice the ATR away. The ATR is how far the price moves in one bar on average, over the last 14 bars. The take profit is 1.5 times the stop's distance, in the other direction.
Trade size
Each trade risks 1% of the account, and is never bigger than 5 lots.

Its safety limits

When a limit is reached, the robot stops opening new trades. You can change the numbers, but you cannot delete the limits.

  • Daily loss limit3%

    After a 3% loss in one day, counted from the balance at 00:00 UTC, it opens no new trades until the next day.

  • Stop loss on every trade2 x ATR

    Each trade closes by itself if the price moves twice the ATR against it.

  • Trading hours07:00 to 20:00 UTC

    It opens trades only in these hours, Monday to Friday.

  • Most trades open at once1

    It waits for its trade to close before it opens another.

  • Trades per day3

    After three trades in one day it waits for the next day.

  • Wait between trades2 bars

    After a trade closes it waits two bars before the next one.

  • Open risk at most2%

    It opens no trade that would put more than 2% of the account at risk at once.

  • Biggest trade size5 lots

    A trade bigger than this is not placed.

  • Spread at most30 points

    When the spread is wider than this, it waits.

What it does not do

Every robot here does only what its blocks say. These are the things people often expect from a robot that this one does not do.

A limit stops new trades. It cannot stop prices from jumping, so a loss can sometimes go past the limit you set. More on the safety page.

Bollinger Band Stretch

Not this

  • It does not buy or sell a breakout: a close past the far band does not count.
  • It opens no trade outside its hours.
  • It holds one trade at a time, and never makes a trade bigger after a loss.
  • Past results do not tell you what will happen next.

Build it, test it, get it

Open the robot in the builder and change what you like. The builder checks it by itself as you change it. Then test it on past prices in your own MetaTrader 5, and get it for your accounts.

The step-by-step guide covers every click, from the builder to a running robot.

Three steps

From this page to your chart

  1. Build. Press Open it in the builder and change any number. The builder checks it by itself as you go and says what is missing, in plain words. Building a robot

  2. Test. Download the free test copy and run it in the Strategy Tester. For this robot choose EURUSD and H1. Testing a robot

  3. Get it. Enter the MetaTrader 5 account numbers it may run on. While we launch, it is free. We email you when it is ready to download. The account lock

Questions about this robot

More answers on the questions page and what it costs.

What are Bollinger Bands?

Bollinger Bands are lines drawn above and below the average price of the last 20 bars, wider apart when the price moves a lot and closer together when it is calm. A deviation is how far the price usually strays from that average. The near bands are 1 deviation from the average, and the far bands are twice as far.

Why only between the two bands?

A bar that closes between the near band and the far band shows the price has moved well away from its average without running off. The idea is that a price stretched like that often comes part of the way back. Because the robot waits for 3 bars in a row, one sharp bar is not enough. A close past the far band may be the start of a breakout, so it does not count.

Where do the stop loss and take profit go?

The stop loss is twice the ATR away from the entry price. The ATR is how far the price moves in one bar on average, over the last 14 bars. The take profit is 1.5 times that distance in the other direction: if the stop loss is 20 points away, the take profit is 30 points away.

More example robots

  • RSI Mean Reversion

    Buys GBPUSD when the RSI says it is oversold and the price is above its long-term average, sells when it is overbought below that average, and gets out when the RSI returns to the middle.

    Market
    GBPUSD
    Bars
    15-minute bars (M15)
    What it does
    Opens trades

    Read its rules

  • EMA Cross Trend

    Follows the trend on EURUSD, one hour at a time. It buys when a fast moving average crosses above a slow one while the price is above its long-term average, and sells on the opposite cross.

    Market
    EURUSD
    Bars
    1-hour bars (H1)
    What it does
    Opens trades

    Read its rules

  • London Breakout

    At 08:00 London time it places one order above and one below the night's price range on GBPUSD. The first order to fill cancels the other, and everything is closed before the weekend.

    Market
    GBPUSD
    Bars
    1-hour bars (H1)
    What it does
    Opens trades

    Read its rules

All seven example robots

Start building

Open the builder and build your first robot. It is free while we launch.