Skip to content
All library documents

Scheduling a Double EMA Strategy for Binance Futures

Code Quant course library

Summary

This program wires a double exponential moving average strategy to a Bitcoin perpetual futures market. It creates an authenticated HTTP client, subscribes to websocket market data, and passes incoming ticks to the strategy. A background scheduler periodically requests hourly candle data, checks open orders, and retrieves position information.

The main loop also checks the strategy’s position state repeatedly, while an initial candle-data request runs at startup. These components illustrate a basic live-trading process that combines streaming data, scheduled account and order checks, and strategy callbacks. The document does not describe the EMA signal rules, position sizing, or trade outcomes, so it provides no evidence of profitability or operational robustness. Its embedded credentials are sensitive and should not be reproduced or reused.

Key ideas

  • A websocket subscription delivers market ticks to the strategy callback.
  • Hourly candle data is fetched on a schedule, alongside recurring open-order and position checks.
  • The main loop repeatedly asks the strategy to check its position state.
  • The strategy’s entry and exit rules and performance are not described.

Tags

From a private course collection; the original is not published.