Replies: 2 comments 2 replies
-
Hi, I will do something like that to solve your probleme,
|
Beta Was this translation helpful? Give feedback.
1 reply
-
You could use post-run trade data to compute those statistics after the fact, e.g.:
bt = Backtest(data, ...)
stats = bt.run()
trades = states._trades
for trade in trades.itertuples():
peak_high = data.High.iloc[trade.EntryBar:trade.ExitBar + 1]
peak_high / trade.EntryPrice
... |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello , thank you for a great package and for using clearly logic.
I want to add new measures for stats['_trades'] (variable take from your example) that show me a max possible profit on each trade (or highest price in lifetime of the trade) and max drawdown on each trade (or min value of price in lifetime of the trade ). What a best way to realize it, by your opinion?
Beta Was this translation helpful? Give feedback.
All reactions