rquantmodalgorithmic-tradingquantstratblotter

Tradestats trade vs transaction


Can someone explain the difference between the "number of trades" and the "number of transactions" when using library(blotter);tradeStats(portfolio_name)?

According to the help docs a trade is 'flat-to-flat' by default, and a transaction is the number produced by addTxn.

When starting from a clean environment and only running one strategy why are these numbers different?


Solution

  • In this nomenclature, 'Trades' are round trips, and 'Transactions' are each individual transaction (buy/sell) with the market.

    addTxn creates transactions in blotter.

    tradeStats called with use=trades pairs these transactions into round turns, either using tradeDef=flat.to.flat or tradeDef=flat.to.reduced (more round-turn trade definitions may be added in the future).

    The reason for the difference is that 'post trade analysis' usually is talking about profit or loss, drawdowns, and other 'trade' statistics that can only be calculated by pairing entries and exits.

    This strategy development process essay discusses some of the issues with post trade analysis in more depth in the section "Evaluating Trades".