Skip to content
All library documents

Configurable Dollar-Cost Averaging and Safety Orders for Crypto

Article Strategy library · Author: jthegit

Summary

This script is a configurable dollar-cost averaging simulation for crypto. It offers a base order, recurring purchases at a chosen interval in candles, and optional safety orders that can be triggered after a specified price decline. Safety-order size and spacing can be scaled, and the user can set a maximum number of safety orders. Inputs also include a date window and a choice of price source, such as close or an OHLC-derived value. The strategy declaration specifies cash-based sizing and includes commission and slippage assumptions.

The visible excerpt exposes take-profit and trailing settings, but labels take-profit functionality as unfinished and ends before the order and exit logic is shown. It therefore does not establish how the configured safety orders or exits are executed, nor does it provide backtest results. DCA can increase exposure as price falls, and scaled safety orders can concentrate risk; the settings alone do not show how much capital a complete run might require. Treat this as a partial simulation specification rather than evidence of a tested strategy.

Key ideas

  • The script supports recurring purchases at a configurable interval and base amount.
  • Optional safety orders can respond to price declines with configurable size and spacing scales.
  • Users can choose a test date range and select among several price sources.
  • The displayed take-profit feature is marked unfinished, and the excerpt omits subsequent order logic.
  • No performance results or full account-risk assessment are provided.

Tags

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