Source: https://hamster-bot.com/en/algo/mrs2

[← All strategies](https://hamster-bot.com/en/algo)

# MRS2, MRS2 FAST

A version of MRS with separate closing lines for long and short and a set of filters that cancel orders at dangerous moments. One opening line per side, no averaging in.

Order type used: Limit. The opening and closing orders move along their own lines.

By default the bot does not trade if the opening line ends up on the other side of the closing line (for example, the buy line is above the long closing line) - such a trade is a loss from the start.

#### Parameters

- `ma_long`, `ma_short`, `ma_close_long`, `ma_close_short` - opening and closing lines. Configured the same way as lines in MRS
- `use_settings_from_open_long`, `use_settings_from_open_short` - build the closing line with the type, source and length of the opening MA (the offset is taken from the closing line)
- `distance_filter` - minimum distance in % between the opening and closing line (default 0.3). If closer, orders are cancelled (the potential profit is too small)
- `filter_pump_1` - post-pump filter. When the price (`source`) crosses the closing line upwards, the level of that line `offset` candles back is remembered. While the buy line is above this level, the bot does not buy
- `filter_pump_2` - sharp rise filter. If over the last `count` candles the high is `value` times bigger than the low and the high came after the low, trading is paused
- `filter_close_position` - when a filter triggers, not only cancel orders but also close the open position
- `unconditional_placement` - always place orders, without checking the relative position of the lines
- `allow_close_by_market_order` - if the whole candle went above the closing line and the limit order was not filled, close the position with a market order
- `only_profit` - do not move the closing order below the entry price (for long) - close only in profit
- `replace_open_order` - with an open position, the size of the opening order is reduced by the position size
- `cancel_if_half_filled` - if the opening order is partially filled and the remaining part is less than twice the position, it is cancelled

**MRS2 FAST** (`mrs2fast`) - the same logic and the same settings (the `mrs2` block), but in one pass the bot performs all the needed order actions at once (update the closing order, move the opening order, etc.) instead of one action per pass. Orders keep up with the MA lines faster - useful on lower timeframes and with many bots.

---

Backtest the strategy on historical data in the [tester](https://hamster-bot.com/en/tester) and run it in [hamster-bot](https://hamster-bot.com/en/download).
