Dual EMA Breakpoint Signals for Cryptocurrency Futures
Summary
This teaching example describes a trend strategy for cryptocurrency futures using two exponential moving averages. It looks for a local peak or trough in both EMA series: matching troughs trigger a long entry, while matching peaks trigger a short entry. A signal can reverse an existing position after attempting to close it. The example also closes positions after a fixed profit distance from the recorded entry price.
The article presents program structure for reading bars, calculating and plotting EMAs, tracking position state, canceling pending orders, and submitting futures orders. It provides illustrative backtest settings for an ETH/USDT futures contract, but no quantified performance results or comparisons. The author stresses that outcomes depend heavily on parameter choices and frames the material as a programming lesson rather than a deployable system. The sample has important practical limits: it does not establish robustness, account for fees or slippage in the discussion, or explain safeguards for live execution, and it explicitly cautions against using the example in a trading bot.
Key ideas
- The strategy uses matching turning points in two EMAs to generate directional futures signals.
- A signal may close an opposing position and then open a position in the new direction.
- Positions are also closed when price moves a fixed target distance from the recorded entry price.
- The example demonstrates bar handling, indicator plotting, and basic order management.
- It offers no performance evidence and is intended for program design education.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.