Double Moving Average Crossover Strategy with Stops
Summary
This strategy uses a fast and a slow moving average to trade a cryptocurrency futures contract. A bullish crossover opens a long position or reverses a short position; a bearish crossover opens short or reverses long. Signals use earlier completed bars rather than the current bar’s moving averages, a choice intended to avoid unstable intrabar signals. Position size is calculated from the stated asset balance, opening price, and contract value.
The implementation also checks intrabar highs and lows against fixed stop thresholds and updates its asset balance using estimated trade profit or loss. It shows a historical data loop and an asset plotting step, but provides no results or evaluation. Fees, slippage, funding, and other execution assumptions are not discussed, and the stop-loss calculations merit review before interpreting any simulated outcomes.
Key ideas
- The strategy enters or reverses positions when fast and slow moving averages cross.
- Signals use prior bars instead of the current bar’s moving-average values.
- Position size is derived from asset balance, price, and contract value.
- Long and short positions have separate fixed stop thresholds checked against bar extremes.
- The document shows a backtest workflow but reports no performance results.
Tags
From a private course collection; the original is not published.