Skip to content
All library documents

Portfolio and Margin Rules for Realistic Futures and Equity Backtests

Article Quant Q&A · Author: quantresearcher_lambda

Summary

The document asks for reference material to help build a backtesting system that models futures and equities realistically. It highlights the need to account for buying power, profit and loss, and margin, including the different conventions that apply to stocks traded on margin and futures contracts.

It does not provide a calculation method, cite a resource, or present evidence; it is a request for guidance rather than an instructional answer. Its useful takeaway is that backtests need asset-specific rules and calculations to represent trading operations. The discussion does not specify a jurisdiction, broker, or contract, so it leaves the applicable regulations and exact margin requirements unresolved.

Key ideas

  • Backtests need to represent buying power, profit and loss, and margin.
  • Equity margin and futures margin follow different conventions.
  • The document asks for educational resources but does not recommend any.

Tags

Full text
# reference for portfolio / margin calculations in backtesting tool


# reference for portfolio / margin calculations in backtesting tool












I have been tasked with writing a backtesting tool from scratch. I understand a lot of trading operations, but I am primarily a researcher. I need to support futures and equities trading.

I need to make sure that the backtest reflects reality relatively accurately. For example trading stocks on margin, I need to know the conventions and regulatory rules that apply, and calculate buying power, pnl, margin, etc, depending on the asset class. E.g. futures margin and pnl works differently than equities.

Can anyone recommend a resource or resources that can help me fill in the gaps in my knowledge? Like a handbook of trading calculations or suchlike?

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

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