Skip to content
All library documents

Volatility Breakout Entries with a Moving Average Exit

Article Strategy library · Author: QCoder

Summary

This document presents a volatility-based strategy rewritten in Pine from an earlier public strategy. It calculates a log-price ratio over a configurable lookback, smooths that series with a simple moving average, and tracks the moving average's highest and lowest values over the same lookback. A long position opens when the volatility series crosses above its recent upper band; a short opens when it crosses below its recent lower band. Longs close when the series crosses below its average, and shorts close when it crosses above it.

The published settings specify BTC_USD on Bitfinex, daily bars, and a one-year backtest period. No performance statistics or comparison are supplied, so these settings establish the test configuration but not evidence of profitability. Position quantity is calculated from current strategy equity divided by price and rounded to two decimal places. The short description gives no discussion of transaction costs, drawdowns, or market regimes, and the strategy's volatility measure is a log-price ratio rather than a conventional realized-volatility estimate.

Key ideas

  • The strategy compares a log-price ratio with its moving average and rolling upper and lower bounds.
  • Crosses above the upper bound trigger long entries, while crosses below the lower bound trigger short entries.
  • Positions close when the volatility series crosses back through its moving average.
  • The published test uses BTC_USD on Bitfinex with daily bars over one year, but reports no performance results.
  • Position quantity is tied to account equity divided by price.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.