Skip to content
All library documents

Sizing Futures Orders by Account Balance and Automating Take-Profit and Stop-Loss

Article FMZ digest · Author: 发明者量化-小小梦

Summary

The document explains a workflow for sizing futures orders from a percentage of available account balance, then attaching conditional take-profit and stop-loss orders after an entry fills. Its quantity method converts the chosen balance allocation into coin quantity using the current price, then into contracts using the market’s contract value. It also checks minimum and maximum order limits and rounds quantity to the exchange’s precision requirements.

For exits, it describes closing in the direction opposite the open position, calculating trigger levels from entry price and configured percentages, and monitoring paired conditional orders so the untriggered order can be canceled. A state machine tracks the cycle from entry through monitoring to completion. The article notes that conditional orders are supported in live trading but not backtesting on the described platform, and that fast markets can delay execution. It gives implementation guidance rather than performance evidence; the sizing formula allocates capital but does not itself define or guarantee a maximum loss.

Key ideas

  • Order quantity is calculated from available balance, a chosen allocation ratio, current price, and contract value.
  • Quantities must be rounded to exchange precision and checked against minimum and maximum order limits.
  • Take-profit and stop-loss orders close a position in the direction opposite to its entry.
  • When one conditional exit triggers, the other should be canceled and the order state updated.
  • The described conditional-order workflow is for live trading and is not supported in the platform’s backtests.

Tags

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