Skip to content
All library documents

Configuring Per-Contract Futures Fees and Close-Today Charges in Backtests

Article vn.py community

Summary

This forum exchange discusses modeling different futures commission schedules by contract, including cases where closing a position opened the same day incurs a higher fee. It says the backtester’s basic settings handle percentage fees and describes fixed fees as needing special treatment, while per-instrument rates and close-today distinctions require custom logic. A proposed approach stores opening, ordinary closing, and close-today fees in a configuration file, then selects the applicable fee based on instrument and order status.

The answer says the backtesting interface does not directly load such a file, so configuration would need to be read by strategy code or supported through engine changes. The examples are illustrative rather than verified API guidance: they assume custom fee-setting methods and an order classification mechanism, and do not establish that the shown hooks exist in the framework. Correct handling depends on accurately distinguishing today’s position from older holdings and on aligning the fee model with each venue’s actual schedule.

Key ideas

  • Futures commission schedules may differ by instrument and by whether a closing order offsets a same-day position.
  • The proposed model separates opening, regular closing, and close-today fees for each contract.
  • The exchange’s standard backtester settings are described as lacking direct per-contract dynamic fee configuration.
  • A custom implementation must determine order type and position age correctly, and the suggested API calls require validation.

Tags

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