Source: https://hamster-bot.com/en/algo/zigzag-double

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

# ZigZag Double, ZigZag MarketOrder

ZigZag variants with separate settings for long and short. The buy level is built from one ZigZag (`long_length`, `long_detection`), the sell level from another (`short_length`, `short_detection`). For example, you can enter long on more sensitive levels and short on coarser ones.

The bot runs the strategy over history and keeps a "virtual position". If by history a position in this direction is already open (for example, the real position closed by take-profit or stop), no repeated entry in the same direction is made - the bot waits for the next signal.

- **ZigZag Double** (`zigzag_double`) - entry and reversal with stop orders at the levels, as in Strategy Trend Zig Zag
- **ZigZag MarketOrder** (`zigzag_marketorder`) - the same levels, but entry with a market order when a candle has crossed the level and the price is beyond it. The reversal is also a market order
- **ZZ-Double-Market-Filter** (`zz-double-market-filter`) - ZigZag MarketOrder with a built-in screener: entries are allowed only after a price and volume impulse (see parameters below)

As in the other ZigZag strategies, the position is closed if the levels cross (the upper below the lower) or the price moves beyond the opposite level by more than 1%.

#### Parameters

- `long_length`, `long_detection` - reversal search depth and EMA length for the long level (default 5 and 3)
- `short_length`, `short_detection` - the same for the short level (default 5 and 3)

**ZZ-Double-Market-Filter only**

- `screener_up_threshold_pct`, `screener_bars_back` - screener signal: the price has risen by the set % from the lowest close of the last `screener_bars_back` candles (default 5% over 3 candles). 0 - the screener never triggers
- `screener_use_24h_vol_filter`, `screener_min_24h_vol_usdt` - additionally require a 24h turnover of at least the set amount in USDT (default 1 000 000)
- `screener_use_vol_growth_filter`, `screener_vol_growth_candles`, `screener_vol_growth_threshold_pct` - the current candle's volume must exceed the lowest volume of N candles by the set % (default 15 candles, 50%)
- `screener_use_low_filter` - enter long only if the current candle touched the level
- `use_tema_filter`, `tema_length`, `tema_src` - TEMA trend filter (default 200, close): long only when TEMA is rising, short only when it is falling

When the screener triggers, the "gate opens" for the bot and one trade on ZigZag signals is allowed. After that trade closes, the gate closes until the next screener signal.

---

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).
