Hourly Double EMA Crossover Strategy for Bitcoin Futures
Summary
The strategy computes fast and slow exponential moving averages from hourly price bars and treats a crossover as a directional signal. A bullish crossover sets a long bias, while a bearish crossover sets a short bias. Before calculating the indicators, it removes the most recent bar if its close time is still in the future, which is intended to avoid acting on an unfinished candle.
On tick updates, the strategy uses the latest price to submit a limit order when the signal calls for reversing or opening a position. It sizes the target position from a fixed trade-money amount divided by the latest bar close, rounded to the minimum volume. It also stores the intended position and includes routines to compare it with exchange positions, cancel open orders, and submit corrective orders. The code does not present backtest results or discuss fees, slippage, leverage, or risk controls; its exchange reconciliation logic and live order behavior would need careful review before use.
Key ideas
- The method uses hourly fast and slow exponential moving averages to detect bullish and bearish crossovers.
- An unfinished latest bar is excluded when its close time has not yet arrived.
- Trade size is derived from a fixed notional amount and rounded to the stated minimum volume.
- Tick handling submits limit orders to establish or reverse the strategy’s target position.
- Exchange positions and open orders can be checked to reconcile actual exposure with the saved target.
- No backtest evidence or comprehensive risk, cost, or execution analysis is provided.
Tags
From a private course collection; the original is not published.