Diagnosing Buy and Sell Reporting in a Spot Backtest
Summary
The post describes a user’s issue with a simulated cryptocurrency spot backtest: its performance overview appears to classify buys as idle periods and does not record sells. The sample strategy uses a moving-average crossover, tracks position state with a Boolean flag, and submits fixed-size buy and sell orders when the crossover reverses. It also reports that the exchange position query is unsupported in the backtest environment.
The document offers no diagnosis or confirmed fix. It is a troubleshooting question with sample code, so it does not establish whether the chart behavior comes from order handling, reporting conventions, or the unsupported position method. The local flag is the only position tracking shown, and the post does not discuss fill checks, fees, or other validation that could explain discrepancies between intended orders and reported trades.
Key ideas
- The sample strategy enters on an upward moving-average crossover and exits on a downward crossover.
- It tracks whether it holds a position using a Boolean variable.
- The author reports unexpected buy and sell classifications in the backtest overview.
- The post says the exchange position query is unsupported in the tested backtest setup.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.