Allow adding reasons for the end of certain trades, for example, tagging the ending order of a buy trade with a reason R and writing R into this order and trade.
### Discussed in https://github.com/kernc/backtesting.py/discussions/1298 <div type='discussions-op-text'> <sup>Originally posted by **silverwolf-x** August 4, 2025</sup> I want to add reasons for the end of certain trades, for example, how do I tag the ending order of the buy trade from 2013-02-26, indicating that I ended the trade due to reason R, and write R into this order and trade. ```python from datetime import date from backtesting import Backtest, Strategy from backtesting.lib import crossover from backtesting.test import SMA, GOOG class SmaCross(Strategy): n1 = 10 n2 = 20 def init(self): close = self.data.Close self.sma1 = self.I(SMA, close, self.n1) self.sma2 = self.I(SMA, close, self.n2) def next(self): if not self.data.index[-1].date() >= date(2013, 2, 1): if crossover(self.sma1, self.sma2): self.position.close() self.buy() elif crossover(