Bollinger Mean Reversion
Bollinger Mean Reversion is a strategy that trades EURUSD on 1-hour bars. It holds at most 1 open trade and closes its trade on an opposite signal.
pending orders
strategy "Bollinger Mean Reversion"market: EURUSDbars: 1hmax_open: 1opposite: closeinput length = 20input width = 2.0bands = bollinger(close, length, multiplier: width)when crosses_below(close, bands.lower) and rsi(close, 14) < 30:buy limit: bands.lower, risk: 1%, stop: bands.lower - atr(14), target: bands.middle, expires: 5 barswhen crosses_above(close, bands.upper) and rsi(close, 14) > 70:sell limit: bands.upper, risk: 1%, stop: bands.upper + atr(14), target: bands.middle, expires: 5 barsplot bands.upper, color: grayplot bands.middle, color: blueplot bands.lower, color: grayBollinger Mean Reversion is a strategy that trades EURUSD on 1-hour bars. It holds at most 1 open trade and closes its trade on an opposite signal.
You can change 2 inputs: length (default 20) and width (default 2.0).
It calculates bands as the Bollinger Bands (source the close, length length, multiplier width).
When the close crosses below bands.lower and the 14-bar RSI is below 30, it buys with a limit order at bands.lower, risking 1% of the balance, with a stop at bands.lower minus the 14-bar ATR, with a target at bands.middle and expiring after 5 bars.
When the close crosses above bands.upper and the 14-bar RSI is above 70, it sells with a limit order at bands.upper, risking 1% of the balance, with a stop at bands.upper plus the 14-bar ATR, with a target at bands.middle and expiring after 5 bars.
On the chart, it plots bands.upper, bands.middle and bands.lower.