Skip to content
All library documents

MACD and Bollinger Band Entries with ATR-Based Exits

Code Quant course library

Summary

The document outlines a long and short cryptocurrency strategy that combines MACD direction with Bollinger Band breakouts. Long entries require a bullish MACD cross with the fast line above zero and a price break above the upper band; short entries use the opposite conditions. It also describes dynamic position sizing based on a fixed amount of account risk, in the style of a trend-following approach, and exits after a reversal by a specified ATR-based amount.

The accompanying program shows how the strategy is connected to hourly market data, order and position updates, and a scheduled polling process. It does not provide backtest results or measured evidence that the rules are profitable. The excerpt also leaves important implementation details, such as the precise risk calculation and ATR exit logic, to the strategy module, so performance and operational behavior cannot be assessed from this document alone.

Key ideas

  • The entry rules combine MACD crossovers and zero-line position with Bollinger Band breaks.
  • The strategy defines mirrored conditions for long and short trades.
  • Position size is intended to adjust dynamically according to a risk amount.
  • An ATR-based trailing reversal is described as the exit method.
  • The program schedules hourly candle retrieval and more frequent account-state polling.

Tags

From a private course collection; the original is not published.