backtesting.py icon indicating copy to clipboard operation
backtesting.py copied to clipboard

Need for "Trigger Type" info in Trades.

Open arunavo4 opened this issue 5 years ago • 3 comments

Need to get the info of whether the Sell was SL hit or TP hit.

arunavo4 avatar Oct 25 '20 05:10 arunavo4

And simply looking at trade.pl (or stats['_trades']['PnL']) is not an option since you're adjusting SL/TP levels mid-way?

kernc avatar Oct 25 '20 12:10 kernc

Yes, @kernc adjusting SL/TP midway, features like breakeven where I am moving the SL to Entry after x% was gained in the trade.

arunavo4 avatar Oct 26 '20 13:10 arunavo4

I'd like to be able to pass some label aka custom column with trades

stats = backtest.run()
stats._trades.tail(20)

This works, but custom info is needed also. For example, was the trade stopped out or closed because the regime changed.

Can I do it now somehow? Or is it not implemented yet?

Overall, terrific backtesting engine, after all my troubles with Zipline.

s-kust avatar Dec 06 '20 14:12 s-kust